aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator/machine.h
diff options
context:
space:
mode:
authorChunyan Zhang <zhang.chunyan@linaro.org>2018-01-26 21:08:47 +0800
committerMark Brown <broonie@kernel.org>2018-01-26 14:43:55 +0000
commitf7efad10b5c492892b1e5decf5d3ebb29fa5c9af (patch)
tree10ca83d0c4c018b03cdaf9a9597e3d75bf2e1a1c /include/linux/regulator/machine.h
parentregulator: empty the old suspend functions (diff)
downloadlinux-dev-f7efad10b5c492892b1e5decf5d3ebb29fa5c9af.tar.xz
linux-dev-f7efad10b5c492892b1e5decf5d3ebb29fa5c9af.zip
regulator: add PM suspend and resume hooks
In this patch, consumers are allowed to set suspend voltage, and this actually just set the "uV" in constraint::regulator_state, when the regulator_suspend_late() was called by PM core through callback when the system is entering into suspend, the regulator device would act suspend activity then. And it assumes that if any consumer set suspend voltage, the regulator device should be enabled in the suspend state. And if the suspend voltage of a regulator device for all consumers was set zero, the regulator device would be off in the suspend state. This patch also provides a new function hook to regulator devices for resuming from suspend states. Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regulator/machine.h')
-rw-r--r--include/linux/regulator/machine.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index c4a56df8931b..93a04893c739 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -66,17 +66,24 @@ enum regulator_active_discharge {
* state. One of enabled or disabled must be set for the
* configuration to be applied.
*
- * @uV: Operating voltage during suspend.
+ * @uV: Default operating voltage during suspend, it can be adjusted
+ * among <min_uV, max_uV>.
+ * @min_uV: Minimum suspend voltage may be set.
+ * @max_uV: Maximum suspend voltage may be set.
* @mode: Operating mode during suspend.
* @enabled: operations during suspend.
* - DO_NOTHING_IN_SUSPEND
* - DISABLE_IN_SUSPEND
* - ENABLE_IN_SUSPEND
+ * @changeable: Is this state can be switched between enabled/disabled,
*/
struct regulator_state {
- int uV; /* suspend voltage */
- unsigned int mode; /* suspend regulator operating mode */
+ int uV;
+ int min_uV;
+ int max_uV;
+ unsigned int mode;
int enabled;
+ bool changeable;
};
/**