summaryrefslogtreecommitdiff
path: root/drivers/power/regulator/regulator_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/regulator/regulator_common.c')
-rw-r--r--drivers/power/regulator/regulator_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c
index e3565d32a01..c80f10c3aa3 100644
--- a/drivers/power/regulator/regulator_common.c
+++ b/drivers/power/regulator/regulator_common.c
@@ -45,6 +45,16 @@ int regulator_common_of_to_plat(struct udevice *dev,
dev_read_u32_default(dev, "u-boot,off-on-delay-us", 0);
}
+ ret = device_get_supply_regulator(dev, "vin-supply", &plat->vin_supply);
+ if (ret) {
+ debug("Regulator vin regulator not defined: %d\n", ret);
+ if (ret != -ENOENT)
+ return ret;
+ }
+
+ if (plat->vin_supply)
+ regulator_set_enable_if_allowed(plat->vin_supply, true);
+
return 0;
}