diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-10-22 11:31:33 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-12-17 05:27:25 -0500 |
commit | 638f85c54f4fed0f8f1fbc23745a8f334112e892 (patch) | |
tree | 6d54bc8861cba1f74213e52df74815cf72246897 /include/linux/regulator/machine.h | |
parent | 1083c39346d482b9001944d05c09191027892226 (diff) |
regulator: Handle regulators without suspend mode configuration
Since some regulators in the system may not support suspend mode
configuration we need to allow some regulators to have a missing
suspend mode configuration. Do this by requiring that disabled
regulators are explicitly flagged and then skip over regulators
that have no state specified.
Try to avoid surprises by warning the if we could set the state
but no configuration is provided. This also ensures that an all
zeros configuration generates a warning rather than silently
disabling the regulator.
Reported-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/linux/regulator/machine.h')
-rw-r--r-- | include/linux/regulator/machine.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 87f5f176d4ef..234a8476cba8 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -43,16 +43,20 @@ struct regulator; | |||
43 | /** | 43 | /** |
44 | * struct regulator_state - regulator state during low power system states | 44 | * struct regulator_state - regulator state during low power system states |
45 | * | 45 | * |
46 | * This describes a regulators state during a system wide low power state. | 46 | * This describes a regulators state during a system wide low power |
47 | * state. One of enabled or disabled must be set for the | ||
48 | * configuration to be applied. | ||
47 | * | 49 | * |
48 | * @uV: Operating voltage during suspend. | 50 | * @uV: Operating voltage during suspend. |
49 | * @mode: Operating mode during suspend. | 51 | * @mode: Operating mode during suspend. |
50 | * @enabled: Enabled during suspend. | 52 | * @enabled: Enabled during suspend. |
53 | * @disabled: Disabled during suspend. | ||
51 | */ | 54 | */ |
52 | struct regulator_state { | 55 | struct regulator_state { |
53 | int uV; /* suspend voltage */ | 56 | int uV; /* suspend voltage */ |
54 | unsigned int mode; /* suspend regulator operating mode */ | 57 | unsigned int mode; /* suspend regulator operating mode */ |
55 | int enabled; /* is regulator enabled in this suspend state */ | 58 | int enabled; /* is regulator enabled in this suspend state */ |
59 | int disabled; /* is the regulator disbled in this suspend state */ | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | /** | 62 | /** |