diff options
author | Chunyan Zhang <zhang.chunyan@linaro.org> | 2018-01-26 16:08:45 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-01-26 17:43:46 +0300 |
commit | 72069f9957a11896e79e95c8b55ec815e97c2187 (patch) | |
tree | 4859acc5ba19cd5f438c9c4b931e74f9c9b9c0c4 /include/linux/regulator | |
parent | c360a6df02cdba47c0590ffc7d15ec6687183e8c (diff) | |
download | linux-72069f9957a11896e79e95c8b55ec815e97c2187.tar.xz |
regulator: leave one item to record whether regulator is enabled
The items "disabled" and "enabled" are a little redundant, since only one
of them would be set to record if the regulator device should keep on
or be switched to off in suspend states.
So in this patch, the "disabled" was removed, only leave the "enabled":
- enabled == 1 for regulator-on-in-suspend
- enabled == 0 for regulator-off-in-suspend
- enabled == -1 means do nothing when entering suspend mode.
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r-- | include/linux/regulator/machine.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 9cd4fef37203..ce89c5548c89 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h @@ -42,6 +42,16 @@ struct regulator; #define REGULATOR_CHANGE_DRMS 0x10 #define REGULATOR_CHANGE_BYPASS 0x20 +/* + * operations in suspend mode + * DO_NOTHING_IN_SUSPEND - the default value + * DISABLE_IN_SUSPEND - turn off regulator in suspend states + * ENABLE_IN_SUSPEND - keep regulator on in suspend states + */ +#define DO_NOTHING_IN_SUSPEND (-1) +#define DISABLE_IN_SUSPEND 0 +#define ENABLE_IN_SUSPEND 1 + /* Regulator active discharge flags */ enum regulator_active_discharge { REGULATOR_ACTIVE_DISCHARGE_DEFAULT, @@ -58,14 +68,15 @@ enum regulator_active_discharge { * * @uV: Operating voltage during suspend. * @mode: Operating mode during suspend. - * @enabled: Enabled during suspend. - * @disabled: Disabled during suspend. + * @enabled: operations during suspend. + * - DO_NOTHING_IN_SUSPEND + * - DISABLE_IN_SUSPEND + * - ENABLE_IN_SUSPEND */ struct regulator_state { int uV; /* suspend voltage */ unsigned int mode; /* suspend regulator operating mode */ - int enabled; /* is regulator enabled in this suspend state */ - int disabled; /* is the regulator disabled in this suspend state */ + int enabled; }; /** |