diff options
author | Sven Schwermer <sven@svenschwermer.de> | 2019-06-12 08:32:38 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-13 11:11:31 -0400 |
commit | 1164c546d59cdcea386ea4056362261a1d21ca5d (patch) | |
tree | d0c26c0d10a7def9e6af2e03ea69271b88b8f347 /drivers/power | |
parent | 5fc7cf8c8e268590f3b0037eecea7f6798209f78 (diff) | |
download | u-boot-1164c546d59cdcea386ea4056362261a1d21ca5d.tar.gz u-boot-1164c546d59cdcea386ea4056362261a1d21ca5d.tar.bz2 u-boot-1164c546d59cdcea386ea4056362261a1d21ca5d.zip |
regulator: Allow autosetting fixed regulators
Fixed regulators don't have a set_value method. Therefore, trying to
set their value will always return -ENOSYS.
Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/regulator/regulator-uclass.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 9118b8eb39..76be95bcd1 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -238,6 +238,9 @@ int regulator_autoset(struct udevice *dev) if (!uc_pdata->always_on && !uc_pdata->boot_on) return -EMEDIUMTYPE; + if (uc_pdata->type == REGULATOR_TYPE_FIXED) + return regulator_set_enable(dev, true); + if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV) ret = regulator_set_value(dev, uc_pdata->min_uV); if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UA)) |