aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2016-06-06 11:56:52 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-06-29 15:24:53 -0400
commitc33d61a0c400c50f378ef03a386e646abca292ca (patch)
tree62ed6c8767cb9c3a5b571dbd41a5b2b162742c77
parent40faee8ee471ae526344cd5c62ff520d356de841 (diff)
reset: Supply *_shared variant calls when using *_optional APIs
Consumers need to be able to specify whether they are requesting an 'exclusive' or 'shared' reset line no matter which API (of_*, devm_*, etc) they are using. This change allows users of the optional_* API in particular to specify that their request is for a 'shared' line. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--include/linux/reset.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h
index fd69240907c8..c358106611af 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -141,6 +141,12 @@ static inline struct reset_control *reset_control_get_optional_exclusive(
141 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); 141 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
142} 142}
143 143
144static inline struct reset_control *reset_control_get_optional_shared(
145 struct device *dev, const char *id)
146{
147 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
148}
149
144/** 150/**
145 * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference 151 * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
146 * to a reset controller. 152 * to a reset controller.
@@ -270,6 +276,12 @@ static inline struct reset_control *devm_reset_control_get_optional_exclusive(
270 return __devm_reset_control_get(dev, id, 0, 0); 276 return __devm_reset_control_get(dev, id, 0, 0);
271} 277}
272 278
279static inline struct reset_control *devm_reset_control_get_optional_shared(
280 struct device *dev, const char *id)
281{
282 return __devm_reset_control_get(dev, id, 0, 1);
283}
284
273/** 285/**
274 * devm_reset_control_get_exclusive_by_index - resource managed 286 * devm_reset_control_get_exclusive_by_index - resource managed
275 * reset_control_get_exclusive() 287 * reset_control_get_exclusive()