Skip to contentSkip to conversation

regulator: fixed: Modify enable-active-high behavior

PATCH Superseded Patrice Chotard 2 participants 4 messages Jul 25, 2019 – Sep 10, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: fixed: Modify enable-active-high behavior

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

---

 drivers/power/regulator/regulator_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/power/regulator/regulator_common.c +3 -1
index 3dabbe2a85..2e8a083c75 100644
@@ -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 */
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 regulator: fixed: Modify enable-active-high behavior

Quoted 6 lines · Patrice Chotard

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.

Quoted 6 lines

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

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

Signature · 8 lines
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>
#2 lore raw

PATCH 1/1 regulator: fixed: Modify enable-active-high behavior

In reply to Patrice Chotard

Hi,

It's a gentle reminder to not forgot this patch

Thanks

Patrice

Quoted 32 lines · Patrice Chotard

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

---

 drivers/power/regulator/regulator_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/power/regulator/regulator_common.c +3 -1
index 3dabbe2a85..2e8a083c75 100644
@@ -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 */
#3 lore raw

PATCH 1/1 regulator: fixed: Modify enable-active-high behavior

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

Patrice

Quoted 41 lines · Patrice CHOTARD

Hi,

It's a gentle reminder to not forgot this patch

Thanks

Patrice

Quoted 32 lines · Patrice Chotard

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

---

 drivers/power/regulator/regulator_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/power/regulator/regulator_common.c +3 -1
index 3dabbe2a85..2e8a083c75 100644
@@ -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 */