diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2023-10-26 17:48:24 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-11-13 04:26:28 +0300 |
commit | 1e22152aa59d793743fc53051dd7a042f362aecb (patch) | |
tree | 44090a81b836b7c09c3c193cd71d70aa3f0f6271 /drivers/regulator/of_regulator.c | |
parent | 759e2bd96971763db1cfaf6cafc07654b12aa21e (diff) | |
download | linux-1e22152aa59d793743fc53051dd7a042f362aecb.tar.xz |
regulator: Implement uv_survival_time for handling under-voltage events
Add 'uv_survival_time' field to regulation_constraints for specifying
survival time post critical under-voltage event. Update the regulator
notifier call chain and Device Tree property parsing to use this new
field, allowing a configurable timeout before emergency shutdown.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/20231026144824.4065145-6-o.rempel@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/of_regulator.c')
-rw-r--r-- | drivers/regulator/of_regulator.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 3bdd6f1919a4..03afc160fc72 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -175,6 +175,13 @@ static int of_get_regulation_constraints(struct device *dev, if (!ret) constraints->enable_time = pval; + ret = of_property_read_u32(np, "regulator-uv-survival-time-ms", &pval); + if (!ret) + constraints->uv_less_critical_window_ms = pval; + else + constraints->uv_less_critical_window_ms = + REGULATOR_DEF_UV_LESS_CRITICAL_WINDOW_MS; + constraints->soft_start = of_property_read_bool(np, "regulator-soft-start"); ret = of_property_read_u32(np, "regulator-active-discharge", &pval); |