diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-02-08 20:18:25 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-02-10 10:14:29 +0100 |
commit | 26a4c789170d197c30c3feaa4761d4696662349b (patch) | |
tree | d4ce10cd1d24a4a625a223aa19bde74482148138 /drivers | |
parent | 6ee83ce08b24ed66dd24b7bc572a363ff95b4d6c (diff) | |
download | barebox-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.c | 3 |
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; |