All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
@ 2018-05-31  7:57 Patrice Chotard
  2018-06-01 14:24 ` Simon Glass
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Patrice Chotard @ 2018-05-31  7:57 UTC (permalink / raw)
  To: u-boot

From: Patrick Delaunay <patrick.delaunay@st.com>

Don't disable regulator which are tagged as "regulator-always-on" in DT.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

 drivers/power/regulator/regulator-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 4da8e43259fc..4511625ff251 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
 int regulator_set_enable(struct udevice *dev, bool enable)
 {
 	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+	struct dm_regulator_uclass_platdata *uc_pdata;
 
 	if (!ops || !ops->set_enable)
 		return -ENOSYS;
 
+	uc_pdata = dev_get_uclass_platdata(dev);
+	if (!enable && uc_pdata->always_on)
+		return -EACCES;
+
 	return ops->set_enable(dev, enable);
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
  2018-05-31  7:57 [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator Patrice Chotard
@ 2018-06-01 14:24 ` Simon Glass
  2018-07-10 14:57 ` Patrice CHOTARD
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2018-06-01 14:24 UTC (permalink / raw)
  To: u-boot

On 31 May 2018 at 01:57, Patrice Chotard <patrice.chotard@st.com> wrote:
> From: Patrick Delaunay <patrick.delaunay@st.com>
>
> Don't disable regulator which are tagged as "regulator-always-on" in DT.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>
>  drivers/power/regulator/regulator-uclass.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
  2018-05-31  7:57 [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator Patrice Chotard
  2018-06-01 14:24 ` Simon Glass
@ 2018-07-10 14:57 ` Patrice CHOTARD
  2018-10-30 10:50 ` Jack Mitchell
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Patrice CHOTARD @ 2018-07-10 14:57 UTC (permalink / raw)
  To: u-boot

Hi Jaehoon

It's a gentle reminder to not forgot this patch.

Thanks

Patrice

On 05/31/2018 09:57 AM, Patrice Chotard wrote:
> From: Patrick Delaunay <patrick.delaunay@st.com>
> 
> Don't disable regulator which are tagged as "regulator-always-on" in DT.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
> 
>   drivers/power/regulator/regulator-uclass.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index 4da8e43259fc..4511625ff251 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
>   int regulator_set_enable(struct udevice *dev, bool enable)
>   {
>   	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
> +	struct dm_regulator_uclass_platdata *uc_pdata;
>   
>   	if (!ops || !ops->set_enable)
>   		return -ENOSYS;
>   
> +	uc_pdata = dev_get_uclass_platdata(dev);
> +	if (!enable && uc_pdata->always_on)
> +		return -EACCES;
> +
>   	return ops->set_enable(dev, enable);
>   }
>   
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
  2018-05-31  7:57 [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator Patrice Chotard
  2018-06-01 14:24 ` Simon Glass
  2018-07-10 14:57 ` Patrice CHOTARD
@ 2018-10-30 10:50 ` Jack Mitchell
  2018-11-05 16:51   ` Patrice CHOTARD
  2018-10-30 11:00 ` Jack Mitchell
  2018-10-31 10:02 ` Jack Mitchell
  4 siblings, 1 reply; 7+ messages in thread
From: Jack Mitchell @ 2018-10-30 10:50 UTC (permalink / raw)
  To: u-boot

On 31/05/2018 08:57, Patrice Chotard wrote:
> From: Patrick Delaunay <patrick.delaunay@st.com>
> 
> Don't disable regulator which are tagged as "regulator-always-on" in DT.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
> 
>  drivers/power/regulator/regulator-uclass.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index 4da8e43259fc..4511625ff251 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
>  int regulator_set_enable(struct udevice *dev, bool enable)
>  {
>  	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
> +	struct dm_regulator_uclass_platdata *uc_pdata;
>  
>  	if (!ops || !ops->set_enable)
>  		return -ENOSYS;
>  
> +	uc_pdata = dev_get_uclass_platdata(dev);
> +	if (!enable && uc_pdata->always_on)
> +		return -EACCES;
> +
>  	return ops->set_enable(dev, enable);
>  }
>  
> 

Another ping for this, I've just spent a few hours this morning
debugging the firefly-rk3288 failing to boot due to a required regulator
being disabled in the emmc reset routine. I came up with almost the
exact same patch, so

Reviewed-by: Jack Mitchell <jack@embed.me.uk>
Tested-by: Jack Mitchell <jack@embed.me.uk>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
  2018-05-31  7:57 [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator Patrice Chotard
                   ` (2 preceding siblings ...)
  2018-10-30 10:50 ` Jack Mitchell
@ 2018-10-30 11:00 ` Jack Mitchell
  2018-10-31 10:02 ` Jack Mitchell
  4 siblings, 0 replies; 7+ messages in thread
From: Jack Mitchell @ 2018-10-30 11:00 UTC (permalink / raw)
  To: u-boot

On 31/05/2018 08:57, Patrice Chotard wrote:
> From: Patrick Delaunay <patrick.delaunay@st.com>
> 
> Don't disable regulator which are tagged as "regulator-always-on" in DT.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
> 
>  drivers/power/regulator/regulator-uclass.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index 4da8e43259fc..4511625ff251 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
>  int regulator_set_enable(struct udevice *dev, bool enable)
>  {
>  	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
> +	struct dm_regulator_uclass_platdata *uc_pdata;
>  
>  	if (!ops || !ops->set_enable)
>  		return -ENOSYS;
>  
> +	uc_pdata = dev_get_uclass_platdata(dev);
> +	if (!enable && uc_pdata->always_on)
> +		return -EACCES;
> +
>  	return ops->set_enable(dev, enable);
>  }
>  
> 

Another ping for this, I've just spent a few hours this morning
debugging the firefly-rk3288 failing to boot due to a required regulator
being disabled in the emmc reset routine. I came up with almost the
exact same patch, so

Reviewed-by: Jack Mitchell <jack@embed.me.uk>
Tested-by: Jack Mitchell <jack@embed.me.uk>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
  2018-05-31  7:57 [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator Patrice Chotard
                   ` (3 preceding siblings ...)
  2018-10-30 11:00 ` Jack Mitchell
@ 2018-10-31 10:02 ` Jack Mitchell
  4 siblings, 0 replies; 7+ messages in thread
From: Jack Mitchell @ 2018-10-31 10:02 UTC (permalink / raw)
  To: u-boot

On 31/05/2018 08:57, Patrice Chotard wrote:
> From: Patrick Delaunay <patrick.delaunay@st.com>
> 
> Don't disable regulator which are tagged as "regulator-always-on" in DT.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
> 
>  drivers/power/regulator/regulator-uclass.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index 4da8e43259fc..4511625ff251 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
>  int regulator_set_enable(struct udevice *dev, bool enable)
>  {
>  	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
> +	struct dm_regulator_uclass_platdata *uc_pdata;
>  
>  	if (!ops || !ops->set_enable)
>  		return -ENOSYS;
>  
> +	uc_pdata = dev_get_uclass_platdata(dev);
> +	if (!enable && uc_pdata->always_on)
> +		return -EACCES;
> +
>  	return ops->set_enable(dev, enable);
>  }
>  
> 

Another ping for this, I've just spent a few hours this morning
debugging the firefly-rk3288 failing to boot due to a required regulator
being disabled in the emmc reset routine. I came up with almost the
exact same patch, so

Reviewed-by: Jack Mitchell <jack@embed.me.uk>
Tested-by: Jack Mitchell <jack@embed.me.uk>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator
  2018-10-30 10:50 ` Jack Mitchell
@ 2018-11-05 16:51   ` Patrice CHOTARD
  0 siblings, 0 replies; 7+ messages in thread
From: Patrice CHOTARD @ 2018-11-05 16:51 UTC (permalink / raw)
  To: u-boot

Hi Jaehoon

This patch has been updated to "superseded" in patchwork, i don't know
if it was intentional or not.

Nevertheless, Jack has encountered the same issue as us on its platform.

Do you want me to resend it or will you pick up it with reviewed-by and
tested-by added by Jack ?

Regards

Patrice

On 10/30/18 11:50 AM, Jack Mitchell wrote:
> On 31/05/2018 08:57, Patrice Chotard wrote:
>> From: Patrick Delaunay <patrick.delaunay@st.com>
>>
>> Don't disable regulator which are tagged as "regulator-always-on" in DT.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>> ---
>>
>>  drivers/power/regulator/regulator-uclass.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
>> index 4da8e43259fc..4511625ff251 100644
>> --- a/drivers/power/regulator/regulator-uclass.c
>> +++ b/drivers/power/regulator/regulator-uclass.c
>> @@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
>>  int regulator_set_enable(struct udevice *dev, bool enable)
>>  {
>>  	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
>> +	struct dm_regulator_uclass_platdata *uc_pdata;
>>  
>>  	if (!ops || !ops->set_enable)
>>  		return -ENOSYS;
>>  
>> +	uc_pdata = dev_get_uclass_platdata(dev);
>> +	if (!enable && uc_pdata->always_on)
>> +		return -EACCES;
>> +
>>  	return ops->set_enable(dev, enable);
>>  }
>>  
>>
> 
> Another ping for this, I've just spent a few hours this morning
> debugging the firefly-rk3288 failing to boot due to a required regulator
> being disabled in the emmc reset routine. I came up with almost the
> exact same patch, so
> 
> Reviewed-by: Jack Mitchell <jack@embed.me.uk>
> Tested-by: Jack Mitchell <jack@embed.me.uk>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-05 16:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31  7:57 [U-Boot] [PATCH] power: regulator: denied disable on always-on regulator Patrice Chotard
2018-06-01 14:24 ` Simon Glass
2018-07-10 14:57 ` Patrice CHOTARD
2018-10-30 10:50 ` Jack Mitchell
2018-11-05 16:51   ` Patrice CHOTARD
2018-10-30 11:00 ` Jack Mitchell
2018-10-31 10:02 ` Jack Mitchell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.