diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2013-10-15 15:14:20 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-17 19:56:05 -0400 |
commit | a06ccd9c3785fa5550917ae036944f4e080b5749 (patch) | |
tree | 9314ebad2316f4f1e016f53e8f10eb0fbf911190 /include/linux/regulator/consumer.h | |
parent | 0cdfcc0f9352a4c076fbb51299e2b12a35619a51 (diff) |
regulator: core: Add ability to create a lookup alias for supply
These patches add the ability to create an alternative device on which
a lookup for a certain supply should be conducted.
A common use-case for this would be devices that are logically
represented as a collection of drivers within Linux but are are
presented as a single device from device tree. It this case it is
necessary for each sub device to locate their supply data on the main
device.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux/regulator/consumer.h')
-rw-r--r-- | include/linux/regulator/consumer.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 27be915caa96..e530681bea70 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -146,6 +146,32 @@ struct regulator *__must_check devm_regulator_get_optional(struct device *dev, | |||
146 | void regulator_put(struct regulator *regulator); | 146 | void regulator_put(struct regulator *regulator); |
147 | void devm_regulator_put(struct regulator *regulator); | 147 | void devm_regulator_put(struct regulator *regulator); |
148 | 148 | ||
149 | int regulator_register_supply_alias(struct device *dev, const char *id, | ||
150 | struct device *alias_dev, | ||
151 | const char *alias_id); | ||
152 | void regulator_unregister_supply_alias(struct device *dev, const char *id); | ||
153 | |||
154 | int regulator_bulk_register_supply_alias(struct device *dev, const char **id, | ||
155 | struct device *alias_dev, | ||
156 | const char **alias_id, int num_id); | ||
157 | void regulator_bulk_unregister_supply_alias(struct device *dev, | ||
158 | const char **id, int num_id); | ||
159 | |||
160 | int devm_regulator_register_supply_alias(struct device *dev, const char *id, | ||
161 | struct device *alias_dev, | ||
162 | const char *alias_id); | ||
163 | void devm_regulator_unregister_supply_alias(struct device *dev, | ||
164 | const char *id); | ||
165 | |||
166 | int devm_regulator_bulk_register_supply_alias(struct device *dev, | ||
167 | const char **id, | ||
168 | struct device *alias_dev, | ||
169 | const char **alias_id, | ||
170 | int num_id); | ||
171 | void devm_regulator_bulk_unregister_supply_alias(struct device *dev, | ||
172 | const char **id, | ||
173 | int num_id); | ||
174 | |||
149 | /* regulator output control and status */ | 175 | /* regulator output control and status */ |
150 | int __must_check regulator_enable(struct regulator *regulator); | 176 | int __must_check regulator_enable(struct regulator *regulator); |
151 | int regulator_disable(struct regulator *regulator); | 177 | int regulator_disable(struct regulator *regulator); |
@@ -250,6 +276,59 @@ static inline void devm_regulator_put(struct regulator *regulator) | |||
250 | { | 276 | { |
251 | } | 277 | } |
252 | 278 | ||
279 | static inline int regulator_register_supply_alias(struct device *dev, | ||
280 | const char *id, | ||
281 | struct device *alias_dev, | ||
282 | const char *alias_id) | ||
283 | { | ||
284 | return 0; | ||
285 | } | ||
286 | |||
287 | static inline void regulator_unregister_supply_alias(struct device *dev, | ||
288 | const char *id) | ||
289 | { | ||
290 | } | ||
291 | |||
292 | static inline int regulator_bulk_register_supply_alias(struct device *dev, | ||
293 | const char **id, | ||
294 | struct device *alias_dev, | ||
295 | const char **alias_id, | ||
296 | int num_id) | ||
297 | { | ||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | static inline void regulator_bulk_unregister_supply_alias(struct device *dev, | ||
302 | const char **id, | ||
303 | int num_id) | ||
304 | { | ||
305 | } | ||
306 | |||
307 | static inline int devm_regulator_register_supply_alias(struct device *dev, | ||
308 | const char *id, | ||
309 | struct device *alias_dev, | ||
310 | const char *alias_id) | ||
311 | { | ||
312 | return 0; | ||
313 | } | ||
314 | |||
315 | static inline void devm_regulator_unregister_supply_alias(struct device *dev, | ||
316 | const char *id) | ||
317 | { | ||
318 | } | ||
319 | |||
320 | static inline int devm_regulator_bulk_register_supply_alias( | ||
321 | struct device *dev, const char **id, struct device *alias_dev, | ||
322 | const char **alias_id, int num_id) | ||
323 | { | ||
324 | return 0; | ||
325 | } | ||
326 | |||
327 | static inline void devm_regulator_bulk_unregister_supply_alias( | ||
328 | struct device *dev, const char **id, int num_id) | ||
329 | { | ||
330 | } | ||
331 | |||
253 | static inline int regulator_enable(struct regulator *regulator) | 332 | static inline int regulator_enable(struct regulator *regulator) |
254 | { | 333 | { |
255 | return 0; | 334 | return 0; |