regulator: fixed: Modify enable-active-high behavior
PATCH v2 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
---
Changes in v2:
- fix build issue
drivers/power/regulator/regulator_common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/power/regulator/regulator_common.c +6 -1
@@ -12,10 +12,15 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev, struct regulator_common_platdata *dev_pdata, const char *enable_gpio_name) { struct gpio_desc *gpio; +struct dm_regulator_uclass_platdata *uc_pdata;int flags =GPIOD_IS_OUT ;int ret; -if (dev_read_bool (dev,"enable-active-high" )) + uc_pdata =dev_get_uclass_platdata (dev); + +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
PATCH v2 1/1 regulator: fixed: Modify enable-active-high behavior
Hi,
It's a gentle reminder to not forgot this patch.
Thanks
Patrice
Quoted 41 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.yamlSigned-off-by Christophe Kerello <[email protected]>Signed-off-by Patrice Chotard <[email protected]>---
Changes in v2:
- fix build issuedrivers/power/regulator/regulator_common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/power/regulator/regulator_common.c +6
-1@@ -12,10 +12,15 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev, struct regulator_common_platdata *dev_pdata, const char *enable_gpio_name) { struct gpio_desc *gpio; +struct dm_regulator_uclass_platdata *uc_pdata;int flags =GPIOD_IS_OUT ;int ret; -if (dev_read_bool (dev,"enable-active-high" )) + uc_pdata =dev_get_uclass_platdata (dev); + +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 */
PATCH v2 1/1 regulator: fixed: Modify enable-active-high behavior
In reply to Patrice ChotardQuoted 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.yamlSigned-off-by Christophe Kerello <[email protected]>Signed-off-by Patrice Chotard <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/52e76c53/attachment.sig>