diff options
author | Mark Brown <broonie@kernel.org> | 2023-11-13 21:15:05 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-11-13 21:15:05 +0300 |
commit | 753e4d5c433da57da75dd4c3e1aececc8e874a62 (patch) | |
tree | a10c9d13347d764c620f014c7869d3e66ce4f9af /include/linux/regulator | |
parent | 413cfaa7ed8b120e7d934cbce26433e3f7b0ff76 (diff) | |
parent | 1e22152aa59d793743fc53051dd7a042f362aecb (diff) | |
download | linux-753e4d5c433da57da75dd4c3e1aececc8e874a62.tar.xz |
regulator: add under-voltage support (part 2)
Merge series from Oleksij Rempel <o.rempel@pengutronix.de>:
This series add under-voltage and emergency shutdown for system critical
regulators
Diffstat (limited to 'include/linux/regulator')
-rw-r--r-- | include/linux/regulator/machine.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 621b7f4a3639..0cd76d264727 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h @@ -49,6 +49,13 @@ struct regulator; #define DISABLE_IN_SUSPEND 1 #define ENABLE_IN_SUSPEND 2 +/* + * Default time window (in milliseconds) following a critical under-voltage + * event during which less critical actions can be safely carried out by the + * system. + */ +#define REGULATOR_DEF_UV_LESS_CRITICAL_WINDOW_MS 10 + /* Regulator active discharge flags */ enum regulator_active_discharge { REGULATOR_ACTIVE_DISCHARGE_DEFAULT, @@ -127,6 +134,8 @@ struct notification_limit { * @ramp_disable: Disable ramp delay when initialising or when setting voltage. * @soft_start: Enable soft start so that voltage ramps slowly. * @pull_down: Enable pull down when regulator is disabled. + * @system_critical: Set if the regulator is critical to system stability or + * functionality. * @over_current_protection: Auto disable on over current event. * * @over_current_detection: Configure over current limits. @@ -153,6 +162,13 @@ struct notification_limit { * regulator_active_discharge values are used for * initialisation. * @enable_time: Turn-on time of the rails (unit: microseconds) + * @uv_less_critical_window_ms: Specifies the time window (in milliseconds) + * following a critical under-voltage (UV) event + * during which less critical actions can be + * safely carried out by the system (for example + * logging). After this time window more critical + * actions should be done (for example prevent + * HW damage). */ struct regulation_constraints { @@ -204,6 +220,7 @@ struct regulation_constraints { unsigned int settling_time_up; unsigned int settling_time_down; unsigned int enable_time; + unsigned int uv_less_critical_window_ms; unsigned int active_discharge; @@ -214,6 +231,7 @@ struct regulation_constraints { unsigned ramp_disable:1; /* disable ramp delay */ unsigned soft_start:1; /* ramp voltage slowly */ unsigned pull_down:1; /* pull down resistor when regulator off */ + unsigned system_critical:1; /* critical to system stability */ unsigned over_current_protection:1; /* auto disable on over current */ unsigned over_current_detection:1; /* notify on over current */ unsigned over_voltage_detection:1; /* notify on over voltage */ |