Skip to content
Snippets Groups Projects
Commit e8e9715d authored by Patrice Chotard's avatar Patrice Chotard Committed by Tom Rini
Browse files

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

Signed-off-by: default avatarChristophe Kerello <christophe.kerello@st.com>
Signed-off-by: default avatarPatrice Chotard <patrice.chotard@st.com>
parent 5b7a2bf3
No related branches found
No related tags found
No related merge requests found
...@@ -12,10 +12,15 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev, ...@@ -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 regulator_common_platdata *dev_pdata, const char *enable_gpio_name)
{ {
struct gpio_desc *gpio; struct gpio_desc *gpio;
struct dm_regulator_uclass_platdata *uc_pdata;
int flags = GPIOD_IS_OUT; int flags = GPIOD_IS_OUT;
int ret; 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; flags |= GPIOD_IS_OUT_ACTIVE;
/* Get optional enable GPIO desc */ /* Get optional enable GPIO desc */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment