[PATCH v4 5/6] regulator: fixed: request vin-supply as needed

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Jul 24 12:00:05 PDT 2022


So far, we never considered fixed-regulator vin-supply. This worked as
long as the vin-supply on the board was already turned on.

Do as Linux does and request vin-supply as needed. For deep probe
enabled boards, this may result in breakage that can be resolved with
barebox,allow-dummy-supply. For other boards, a warning will be
printed and the vin-supply populated with the dummy regulator.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
v3 -> v4:
  - no change
v2 -> v3:
  - no change
v1 -> v2:
  - new patch
---
 drivers/regulator/fixed.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index ec64f39b86c7..bdb01c0a9554 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -72,6 +72,9 @@ static int regulator_fixed_probe(struct device_d *dev)
 	if (!of_property_read_u32(np, "off-on-delay-us", &delay))
 		fix->rdesc.off_on_delay = delay;
 
+	if (of_find_property(np, "vin-supply", NULL))
+		fix->rdesc.supply_name = "vin";
+
 	ret = of_regulator_register(&fix->rdev, np);
 	if (ret)
 		goto err;
-- 
2.30.2




More information about the barebox mailing list