All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior
@ 2019-07-25  7:12 Patrice Chotard
  2019-08-07 17:20 ` Tom Rini
  2019-09-10  9:54 ` Patrice CHOTARD
  0 siblings, 2 replies; 4+ messages in thread
From: Patrice Chotard @ 2019-07-25  7:12 UTC (permalink / raw)
  To: u-boot

Regulator should not be enabled at probe time if regulator-boot-on
property is not in the dt node.

"enable-active-high" property is only used to indicate the GPIO
polarity.

See kernel documentation :
 - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
 - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

 drivers/power/regulator/regulator_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c
index 3dabbe2a85..2e8a083c75 100644
--- a/drivers/power/regulator/regulator_common.c
+++ b/drivers/power/regulator/regulator_common.c
@@ -15,7 +15,9 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev,
 	int flags = GPIOD_IS_OUT;
 	int ret;
 
-	if (dev_read_bool(dev, "enable-active-high"))
+	if (!dev_read_bool(dev, "enable-active-high"))
+		flags |= GPIOD_ACTIVE_LOW;
+	if (uc_pdata->boot_on)
 		flags |= GPIOD_IS_OUT_ACTIVE;
 
 	/* Get optional enable GPIO desc */
-- 
2.17.1

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

* [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior
  2019-07-25  7:12 [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior Patrice Chotard
@ 2019-08-07 17:20 ` Tom Rini
  2019-09-10  9:54 ` Patrice CHOTARD
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-08-07 17:20 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 25, 2019 at 09:12:39AM +0200, Patrice Chotard wrote:

> Regulator should not be enabled at probe time if regulator-boot-on
> property is not in the dt node.
> 
> "enable-active-high" property is only used to indicate the GPIO
> polarity.
> 
> See kernel documentation :
>  - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
>  - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml
> 
> Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

This breaks building on a number of platforms including khadas-vim

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190807/97272bf6/attachment.sig>

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

* [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior
  2019-07-25  7:12 [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior Patrice Chotard
  2019-08-07 17:20 ` Tom Rini
@ 2019-09-10  9:54 ` Patrice CHOTARD
  2019-09-10 11:37   ` Patrice CHOTARD
  1 sibling, 1 reply; 4+ messages in thread
From: Patrice CHOTARD @ 2019-09-10  9:54 UTC (permalink / raw)
  To: u-boot

Hi,

It's a gentle reminder to not forgot this patch

Thanks

Patrice

On 7/25/19 9:12 AM, Patrice Chotard wrote:
> Regulator should not be enabled at probe time if regulator-boot-on
> property is not in the dt node.
>
> "enable-active-high" property is only used to indicate the GPIO
> polarity.
>
> See kernel documentation :
>  - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
>  - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml
>
> Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>
>  drivers/power/regulator/regulator_common.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c
> index 3dabbe2a85..2e8a083c75 100644
> --- a/drivers/power/regulator/regulator_common.c
> +++ b/drivers/power/regulator/regulator_common.c
> @@ -15,7 +15,9 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev,
>  	int flags = GPIOD_IS_OUT;
>  	int ret;
>  
> -	if (dev_read_bool(dev, "enable-active-high"))
> +	if (!dev_read_bool(dev, "enable-active-high"))
> +		flags |= GPIOD_ACTIVE_LOW;
> +	if (uc_pdata->boot_on)
>  		flags |= GPIOD_IS_OUT_ACTIVE;
>  
>  	/* Get optional enable GPIO desc */

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

* [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior
  2019-09-10  9:54 ` Patrice CHOTARD
@ 2019-09-10 11:37   ` Patrice CHOTARD
  0 siblings, 0 replies; 4+ messages in thread
From: Patrice CHOTARD @ 2019-09-10 11:37 UTC (permalink / raw)
  To: u-boot

Sorry it's not the correct patch version. I will send the reminder on the correct one (v2).

Patrice

On 9/10/19 11:54 AM, Patrice CHOTARD wrote:
> Hi,
>
> It's a gentle reminder to not forgot this patch
>
> Thanks
>
> Patrice
>
> On 7/25/19 9:12 AM, Patrice Chotard wrote:
>> Regulator should not be enabled at probe time if regulator-boot-on
>> property is not in the dt node.
>>
>> "enable-active-high" property is only used to indicate the GPIO
>> polarity.
>>
>> See kernel documentation :
>>  - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
>>  - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml
>>
>> Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>> ---
>>
>>  drivers/power/regulator/regulator_common.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c
>> index 3dabbe2a85..2e8a083c75 100644
>> --- a/drivers/power/regulator/regulator_common.c
>> +++ b/drivers/power/regulator/regulator_common.c
>> @@ -15,7 +15,9 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev,
>>  	int flags = GPIOD_IS_OUT;
>>  	int ret;
>>  
>> -	if (dev_read_bool(dev, "enable-active-high"))
>> +	if (!dev_read_bool(dev, "enable-active-high"))
>> +		flags |= GPIOD_ACTIVE_LOW;
>> +	if (uc_pdata->boot_on)
>>  		flags |= GPIOD_IS_OUT_ACTIVE;
>>  
>>  	/* Get optional enable GPIO desc */

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

end of thread, other threads:[~2019-09-10 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25  7:12 [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior Patrice Chotard
2019-08-07 17:20 ` Tom Rini
2019-09-10  9:54 ` Patrice CHOTARD
2019-09-10 11:37   ` Patrice CHOTARD

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.