From: Sven Schwermer Date: Wed, 12 Jun 2019 06:32:38 +0000 (+0200) Subject: regulator: Allow autosetting fixed regulators X-Git-Tag: v2019.10-rc1~31^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1164c546d59cdcea386ea4056362261a1d21ca5d;p=oweals%2Fu-boot.git 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 Cc: Jaehoon Chung Cc: Peng Fan Reviewed-by: Simon Glass --- 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))