diff options
author | Marco Felsch <m.felsch@pengutronix.de> | 2022-06-16 16:07:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-06-17 09:27:29 +0200 |
commit | b98aaaaf7401b76c3427377902e0f99ab551c06c (patch) | |
tree | a24828c53460f6add9244c17d1e971865348c576 | |
parent | 18fdefae0569628a5490d2594afde6ceed39a088 (diff) | |
download | barebox-b98aaaaf7401b76c3427377902e0f99ab551c06c.tar.gz barebox-b98aaaaf7401b76c3427377902e0f99ab551c06c.tar.xz |
regulator: fixed: add off-on-delay-us device-tree parsing support
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@pengutronix.de>
Link: https://lore.barebox.org/20220616140737.2294226-2-m.felsch@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/regulator/fixed.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |