diff options
| author | Heiko Stübner <heiko@sntech.de> | 2014-08-28 15:36:04 -0400 |
|---|---|---|
| committer | Mark Brown <broonie+linaro@kernel.org> | 2014-08-29 06:58:31 -0400 |
| commit | 7179569aeb52197fd2a9909ba226c4c9cc0e2e2a (patch) | |
| tree | 39757ab5ecbc23dc54a7b8489f4b104156439364 /include/linux | |
| parent | 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff) | |
regulator: core: Add REGULATOR_EVENT_PRE_VOLTAGE_CHANGE (and ABORT)
In some cases we need to know when a regulator is about to be changed.
Add a way for clients to be notified. Note that for set_voltage() we
don't necessarily know what voltage we'll end up with, so we tell the
client what the range will be so they can prepare.
Signed-off-by: Heiko Stübner <heiko@sntech.de>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie+linaro@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/regulator/consumer.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index f8a8733068a7..d347c805f923 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -93,7 +93,12 @@ struct regmap; | |||
| 93 | * OVER_TEMP Regulator over temp. | 93 | * OVER_TEMP Regulator over temp. |
| 94 | * FORCE_DISABLE Regulator forcibly shut down by software. | 94 | * FORCE_DISABLE Regulator forcibly shut down by software. |
| 95 | * VOLTAGE_CHANGE Regulator voltage changed. | 95 | * VOLTAGE_CHANGE Regulator voltage changed. |
| 96 | * Data passed is old voltage cast to (void *). | ||
| 96 | * DISABLE Regulator was disabled. | 97 | * DISABLE Regulator was disabled. |
| 98 | * PRE_VOLTAGE_CHANGE Regulator is about to have voltage changed. | ||
| 99 | * Data passed is "struct pre_voltage_change_data" | ||
| 100 | * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason. | ||
| 101 | * Data passed is old voltage cast to (void *). | ||
| 97 | * | 102 | * |
| 98 | * NOTE: These events can be OR'ed together when passed into handler. | 103 | * NOTE: These events can be OR'ed together when passed into handler. |
| 99 | */ | 104 | */ |
| @@ -106,6 +111,21 @@ struct regmap; | |||
| 106 | #define REGULATOR_EVENT_FORCE_DISABLE 0x20 | 111 | #define REGULATOR_EVENT_FORCE_DISABLE 0x20 |
| 107 | #define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40 | 112 | #define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40 |
| 108 | #define REGULATOR_EVENT_DISABLE 0x80 | 113 | #define REGULATOR_EVENT_DISABLE 0x80 |
| 114 | #define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100 | ||
| 115 | #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200 | ||
| 116 | |||
| 117 | /** | ||
| 118 | * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event | ||
| 119 | * | ||
| 120 | * @old_uV: Current voltage before change. | ||
| 121 | * @min_uV: Min voltage we'll change to. | ||
| 122 | * @max_uV: Max voltage we'll change to. | ||
| 123 | */ | ||
| 124 | struct pre_voltage_change_data { | ||
| 125 | unsigned long old_uV; | ||
| 126 | unsigned long min_uV; | ||
| 127 | unsigned long max_uV; | ||
| 128 | }; | ||
| 109 | 129 | ||
| 110 | struct regulator; | 130 | struct regulator; |
| 111 | 131 | ||
