mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-27 17:41:34 +00:00
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>
This commit is contained in:
parent
5fc7cf8c8e
commit
1164c546d5
1 changed files with 3 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue