summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-02-08 20:18:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-02-10 10:14:29 +0100
commit26a4c789170d197c30c3feaa4761d4696662349b (patch)
treed4ce10cd1d24a4a625a223aa19bde74482148138 /drivers
parent6ee83ce08b24ed66dd24b7bc572a363ff95b4d6c (diff)
downloadbarebox-26a4c789170d197c30c3feaa4761d4696662349b.tar.gz
barebox-26a4c789170d197c30c3feaa4761d4696662349b.tar.xz
regulator: add support for struct regulator_desc::off_on_delay
We already honour the enable time in the device tree, read it out of a new regulator_desc::off_on_delay as well, same as Linux does. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7ced283c11..ac3a9b048e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -176,6 +176,9 @@ int of_regulator_register(struct regulator_dev *rd, struct device_node *node)
ri->node = node;
+ if (rd->desc->off_on_delay)
+ ri->enable_time_us = rd->desc->off_on_delay;
+
if (rd->desc->fixed_uV && rd->desc->n_voltages == 1)
ri->min_uv = ri->max_uv = rd->desc->fixed_uV;