aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator/consumer.h
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-29 16:42:42 -0400
committerMark Brown <broonie@linaro.org>2013-07-31 04:56:39 -0400
commitde1dd9fd2156874b45803299b3b27e65d5defdd9 (patch)
tree031b04b662f93f38aab24fc4273376e07558327e /include/linux/regulator/consumer.h
parent4bdfb2729c3a396fe7400c9332c49aee2b971bd8 (diff)
regulator: core: Provide hints to the core about optional supplies
While the majority of supplies on devices are mandatory and can't be physically omitted for electrical reasons some devices do have optional supplies and need to know if they are missing, MMC being the most common of these. Currently the core accurately reports all errors when regulators are requested since it does not know if the supply is one that must be provided even if by a regulator software does not know about or if it is one that may genuinely be disconnected. In order to allow this behaviour to be changed and stub regulators to be provided in the former case add a new regulator request function regulator_get_optional() which provides a hint to the core that the regulator may genuinely not be connected. Currently the implementation is identical to the current behaviour, future patches will add support in the core for returning stub regulators in the case where normal regulator_get() fails and the board has requested it. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/regulator/consumer.h')
-rw-r--r--include/linux/regulator/consumer.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 60da4a62c402..e2bac6db4abc 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -137,6 +137,10 @@ struct regulator *__must_check devm_regulator_get(struct device *dev,
137 const char *id); 137 const char *id);
138struct regulator *__must_check regulator_get_exclusive(struct device *dev, 138struct regulator *__must_check regulator_get_exclusive(struct device *dev,
139 const char *id); 139 const char *id);
140struct regulator *__must_check regulator_get_optional(struct device *dev,
141 const char *id);
142struct regulator *__must_check devm_regulator_get_optional(struct device *dev,
143 const char *id);
140void regulator_put(struct regulator *regulator); 144void regulator_put(struct regulator *regulator);
141void devm_regulator_put(struct regulator *regulator); 145void devm_regulator_put(struct regulator *regulator);
142 146
@@ -212,14 +216,26 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
212} 216}
213 217
214static inline struct regulator *__must_check 218static inline struct regulator *__must_check
219devm_regulator_get(struct device *dev, const char *id)
220{
221 return NULL;
222}
223
224static inline struct regulator *__must_check
215regulator_get_exclusive(struct device *dev, const char *id) 225regulator_get_exclusive(struct device *dev, const char *id)
216{ 226{
217 return NULL; 227 return NULL;
218} 228}
219 229
230static inline struct regulator *__must_check
231regulator_get_optional(struct device *dev, const char *id)
232{
233 return NULL;
234}
235
220 236
221static inline struct regulator *__must_check 237static inline struct regulator *__must_check
222devm_regulator_get(struct device *dev, const char *id) 238devm_regulator_get_optional(struct device *dev, const char *id)
223{ 239{
224 return NULL; 240 return NULL;
225} 241}