[PATCH 2/2] regulator: fixed: add off-on-delay-us device-tree parsing support

Marco Felsch m.felsch at pengutronix.de
Thu Jun 16 07:07:37 PDT 2022


The core already handles the off_on_delay if we set it. So parse the
official device-tree property and set it if present.

Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
 drivers/regulator/fixed.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 9c660d5781..ae16df8a0c 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -52,6 +52,7 @@ static int regulator_fixed_probe(struct device_d *dev)
 {
 	struct device_node *np = dev->device_node;
 	struct regulator_fixed *fix;
+	u32 delay;
 	int ret;
 
 	if (!dev->device_node)
@@ -72,6 +73,9 @@ static int regulator_fixed_probe(struct device_d *dev)
 	fix->rdev.desc = &fix->rdesc;
 	fix->rdev.dev = dev;
 
+	if (!of_property_read_u32(np, "off-on-delay-us", &delay))
+		fix->rdesc.off_on_delay = delay;
+
 	if (of_find_property(np, "regulator-always-on", NULL) ||
 	    of_find_property(np, "regulator-boot-on", NULL)) {
 		fix->always_on = 1;
-- 
2.30.2




More information about the barebox mailing list