diff options
Diffstat (limited to 'include/linux/regulator/machine.h')
-rw-r--r-- | include/linux/regulator/machine.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index bac64fa390f2..87f5f176d4ef 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -41,7 +41,7 @@ struct regulator; | |||
41 | #define REGULATOR_CHANGE_DRMS 0x10 | 41 | #define REGULATOR_CHANGE_DRMS 0x10 |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct regulator_state - regulator state during low power syatem 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 state. |
47 | * | 47 | * |
@@ -117,25 +117,37 @@ struct regulation_constraints { | |||
117 | /* mode to set on startup */ | 117 | /* mode to set on startup */ |
118 | unsigned int initial_mode; | 118 | unsigned int initial_mode; |
119 | 119 | ||
120 | /* constriant flags */ | 120 | /* constraint flags */ |
121 | unsigned always_on:1; /* regulator never off when system is on */ | 121 | unsigned always_on:1; /* regulator never off when system is on */ |
122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | 122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ |
123 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ | 123 | unsigned apply_uV:1; /* apply uV constraint if min == max */ |
124 | }; | 124 | }; |
125 | 125 | ||
126 | /** | 126 | /** |
127 | * struct regulator_consumer_supply - supply -> device mapping | 127 | * struct regulator_consumer_supply - supply -> device mapping |
128 | * | 128 | * |
129 | * This maps a supply name to a device. | 129 | * This maps a supply name to a device. Only one of dev or dev_name |
130 | * can be specified. Use of dev_name allows support for buses which | ||
131 | * make struct device available late such as I2C and is the preferred | ||
132 | * form. | ||
130 | * | 133 | * |
131 | * @dev: Device structure for the consumer. | 134 | * @dev: Device structure for the consumer. |
135 | * @dev_name: Result of dev_name() for the consumer. | ||
132 | * @supply: Name for the supply. | 136 | * @supply: Name for the supply. |
133 | */ | 137 | */ |
134 | struct regulator_consumer_supply { | 138 | struct regulator_consumer_supply { |
135 | struct device *dev; /* consumer */ | 139 | struct device *dev; /* consumer */ |
140 | const char *dev_name; /* dev_name() for consumer */ | ||
136 | const char *supply; /* consumer supply - e.g. "vcc" */ | 141 | const char *supply; /* consumer supply - e.g. "vcc" */ |
137 | }; | 142 | }; |
138 | 143 | ||
144 | /* Initialize struct regulator_consumer_supply */ | ||
145 | #define REGULATOR_SUPPLY(_name, _dev_name) \ | ||
146 | { \ | ||
147 | .supply = _name, \ | ||
148 | .dev_name = _dev_name, \ | ||
149 | } | ||
150 | |||
139 | /** | 151 | /** |
140 | * struct regulator_init_data - regulator platform initialisation data. | 152 | * struct regulator_init_data - regulator platform initialisation data. |
141 | * | 153 | * |
@@ -166,6 +178,12 @@ struct regulator_init_data { | |||
166 | 178 | ||
167 | int regulator_suspend_prepare(suspend_state_t state); | 179 | int regulator_suspend_prepare(suspend_state_t state); |
168 | 180 | ||
181 | #ifdef CONFIG_REGULATOR | ||
169 | void regulator_has_full_constraints(void); | 182 | void regulator_has_full_constraints(void); |
183 | #else | ||
184 | static inline void regulator_has_full_constraints(void) | ||
185 | { | ||
186 | } | ||
187 | #endif | ||
170 | 188 | ||
171 | #endif | 189 | #endif |