aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator/machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/regulator/machine.h')
-rw-r--r--include/linux/regulator/machine.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 9cd4fef37203..93a04893c739 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -42,6 +42,16 @@ struct regulator;
42#define REGULATOR_CHANGE_DRMS 0x10 42#define REGULATOR_CHANGE_DRMS 0x10
43#define REGULATOR_CHANGE_BYPASS 0x20 43#define REGULATOR_CHANGE_BYPASS 0x20
44 44
45/*
46 * operations in suspend mode
47 * DO_NOTHING_IN_SUSPEND - the default value
48 * DISABLE_IN_SUSPEND - turn off regulator in suspend states
49 * ENABLE_IN_SUSPEND - keep regulator on in suspend states
50 */
51#define DO_NOTHING_IN_SUSPEND (-1)
52#define DISABLE_IN_SUSPEND 0
53#define ENABLE_IN_SUSPEND 1
54
45/* Regulator active discharge flags */ 55/* Regulator active discharge flags */
46enum regulator_active_discharge { 56enum regulator_active_discharge {
47 REGULATOR_ACTIVE_DISCHARGE_DEFAULT, 57 REGULATOR_ACTIVE_DISCHARGE_DEFAULT,
@@ -56,16 +66,24 @@ enum regulator_active_discharge {
56 * state. One of enabled or disabled must be set for the 66 * state. One of enabled or disabled must be set for the
57 * configuration to be applied. 67 * configuration to be applied.
58 * 68 *
59 * @uV: Operating voltage during suspend. 69 * @uV: Default operating voltage during suspend, it can be adjusted
70 * among <min_uV, max_uV>.
71 * @min_uV: Minimum suspend voltage may be set.
72 * @max_uV: Maximum suspend voltage may be set.
60 * @mode: Operating mode during suspend. 73 * @mode: Operating mode during suspend.
61 * @enabled: Enabled during suspend. 74 * @enabled: operations during suspend.
62 * @disabled: Disabled during suspend. 75 * - DO_NOTHING_IN_SUSPEND
76 * - DISABLE_IN_SUSPEND
77 * - ENABLE_IN_SUSPEND
78 * @changeable: Is this state can be switched between enabled/disabled,
63 */ 79 */
64struct regulator_state { 80struct regulator_state {
65 int uV; /* suspend voltage */ 81 int uV;
66 unsigned int mode; /* suspend regulator operating mode */ 82 int min_uV;
67 int enabled; /* is regulator enabled in this suspend state */ 83 int max_uV;
68 int disabled; /* is the regulator disabled in this suspend state */ 84 unsigned int mode;
85 int enabled;
86 bool changeable;
69}; 87};
70 88
71/** 89/**
@@ -225,12 +243,12 @@ struct regulator_init_data {
225 243
226#ifdef CONFIG_REGULATOR 244#ifdef CONFIG_REGULATOR
227void regulator_has_full_constraints(void); 245void regulator_has_full_constraints(void);
228int regulator_suspend_prepare(suspend_state_t state);
229int regulator_suspend_finish(void);
230#else 246#else
231static inline void regulator_has_full_constraints(void) 247static inline void regulator_has_full_constraints(void)
232{ 248{
233} 249}
250#endif
251
234static inline int regulator_suspend_prepare(suspend_state_t state) 252static inline int regulator_suspend_prepare(suspend_state_t state)
235{ 253{
236 return 0; 254 return 0;
@@ -239,6 +257,5 @@ static inline int regulator_suspend_finish(void)
239{ 257{
240 return 0; 258 return 0;
241} 259}
242#endif
243 260
244#endif 261#endif