summaryrefslogtreecommitdiffstats
path: root/include/linux/reset.h
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2016-06-06 11:56:49 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-06-29 15:24:52 -0400
commit3c35f6edc09b239a60de87a5aeb78563fc372704 (patch)
tree63a36f9ae0481aee1396ba32abe7c97c72c7d63f /include/linux/reset.h
parent1a695a905c18548062509178b98bc91e67510864 (diff)
reset: Reorder inline reset_control_get*() wrappers
We're about to split the current API into two, where consumers will be forced to be explicit when requesting reset lines. The choice will be to either the call the *_exclusive or *_shared variant depending on whether they can actually tolorate not being asserted when that request is made. The new API will look like this once reorded and complete: reset_control_get_exclusive() reset_control_get_shared() reset_control_get_optional_exclusive() reset_control_get_optional_shared() of_reset_control_get_exclusive() of_reset_control_get_shared() of_reset_control_get_exclusive_by_index() of_reset_control_get_shared_by_index() devm_reset_control_get_exclusive() devm_reset_control_get_shared() devm_reset_control_get_optional_exclusive() devm_reset_control_get_optional_shared() devm_reset_control_get_exclusive_by_index() devm_reset_control_get_shared_by_index() Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset.h')
-rw-r--r--include/linux/reset.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h
index ec0306ce7b92..33eaf11dabe2 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -107,12 +107,6 @@ static inline struct reset_control *__must_check reset_control_get(
107 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); 107 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
108} 108}
109 109
110static inline struct reset_control *reset_control_get_optional(
111 struct device *dev, const char *id)
112{
113 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
114}
115
116/** 110/**
117 * reset_control_get_shared - Lookup and obtain a shared reference to a 111 * reset_control_get_shared - Lookup and obtain a shared reference to a
118 * reset controller. 112 * reset controller.
@@ -141,6 +135,12 @@ static inline struct reset_control *reset_control_get_shared(
141 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); 135 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
142} 136}
143 137
138static inline struct reset_control *reset_control_get_optional(
139 struct device *dev, const char *id)
140{
141 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
142}
143
144/** 144/**
145 * of_reset_control_get - Lookup and obtain an exclusive reference to a 145 * of_reset_control_get - Lookup and obtain an exclusive reference to a
146 * reset controller. 146 * reset controller.
@@ -191,6 +191,21 @@ static inline struct reset_control *__must_check devm_reset_control_get(
191 return __devm_reset_control_get(dev, id, 0, 0); 191 return __devm_reset_control_get(dev, id, 0, 0);
192} 192}
193 193
194/**
195 * devm_reset_control_get_shared - resource managed reset_control_get_shared()
196 * @dev: device to be reset by the controller
197 * @id: reset line name
198 *
199 * Managed reset_control_get_shared(). For reset controllers returned from
200 * this function, reset_control_put() is called automatically on driver detach.
201 * See reset_control_get_shared() for more information.
202 */
203static inline struct reset_control *devm_reset_control_get_shared(
204 struct device *dev, const char *id)
205{
206 return __devm_reset_control_get(dev, id, 0, 1);
207}
208
194static inline struct reset_control *devm_reset_control_get_optional( 209static inline struct reset_control *devm_reset_control_get_optional(
195 struct device *dev, const char *id) 210 struct device *dev, const char *id)
196{ 211{
@@ -213,21 +228,6 @@ static inline struct reset_control *devm_reset_control_get_by_index(
213} 228}
214 229
215/** 230/**
216 * devm_reset_control_get_shared - resource managed reset_control_get_shared()
217 * @dev: device to be reset by the controller
218 * @id: reset line name
219 *
220 * Managed reset_control_get_shared(). For reset controllers returned from
221 * this function, reset_control_put() is called automatically on driver detach.
222 * See reset_control_get_shared() for more information.
223 */
224static inline struct reset_control *devm_reset_control_get_shared(
225 struct device *dev, const char *id)
226{
227 return __devm_reset_control_get(dev, id, 0, 1);
228}
229
230/**
231 * devm_reset_control_get_shared_by_index - resource managed 231 * devm_reset_control_get_shared_by_index - resource managed
232 * reset_control_get_shared 232 * reset_control_get_shared
233 * @dev: device to be reset by the controller 233 * @dev: device to be reset by the controller