blob: 95d555c2130a0b97581a932e1a8fd62f62f4d2f3 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Philipp Zabel61fc4132012-11-19 17:23:13 +01002#ifndef _LINUX_RESET_H_
3#define _LINUX_RESET_H_
4
Masahiro Yamadadfc1d9b2017-10-29 01:50:08 +09005#include <linux/types.h>
Hans de Goede6c96f052016-02-23 18:46:24 +01006
Masahiro Yamadadfc1d9b2017-10-29 01:50:08 +09007struct device;
8struct device_node;
Philipp Zabel61fc4132012-11-19 17:23:13 +01009struct reset_control;
10
Philipp Zabelb4240802014-03-07 15:18:47 +010011#ifdef CONFIG_RESET_CONTROLLER
12
Philipp Zabel61fc4132012-11-19 17:23:13 +010013int reset_control_reset(struct reset_control *rstc);
14int reset_control_assert(struct reset_control *rstc);
15int reset_control_deassert(struct reset_control *rstc);
Dinh Nguyen729de412014-10-10 10:21:14 -050016int reset_control_status(struct reset_control *rstc);
Philipp Zabelc84b0322019-02-21 16:25:53 +010017int reset_control_acquire(struct reset_control *rstc);
18void reset_control_release(struct reset_control *rstc);
Philipp Zabel61fc4132012-11-19 17:23:13 +010019
Hans de Goede6c96f052016-02-23 18:46:24 +010020struct reset_control *__of_reset_control_get(struct device_node *node,
Ramiro Oliveirabb475232017-01-13 17:57:41 +000021 const char *id, int index, bool shared,
Philipp Zabelc84b0322019-02-21 16:25:53 +010022 bool optional, bool acquired);
Philipp Zabel62e24c52016-02-05 13:41:39 +010023struct reset_control *__reset_control_get(struct device *dev, const char *id,
24 int index, bool shared,
Philipp Zabelc84b0322019-02-21 16:25:53 +010025 bool optional, bool acquired);
Philipp Zabel61fc4132012-11-19 17:23:13 +010026void reset_control_put(struct reset_control *rstc);
Masahiro Yamada1554bbd2017-10-29 01:50:06 +090027int __device_reset(struct device *dev, bool optional);
Hans de Goede6c96f052016-02-23 18:46:24 +010028struct reset_control *__devm_reset_control_get(struct device *dev,
Ramiro Oliveirabb475232017-01-13 17:57:41 +000029 const char *id, int index, bool shared,
Philipp Zabelc84b0322019-02-21 16:25:53 +010030 bool optional, bool acquired);
Philipp Zabel61fc4132012-11-19 17:23:13 +010031
Vivek Gautam17c82e22017-05-22 16:53:25 +053032struct reset_control *devm_reset_control_array_get(struct device *dev,
33 bool shared, bool optional);
34struct reset_control *of_reset_control_array_get(struct device_node *np,
Thierry Redingf31d5c22019-02-21 16:25:54 +010035 bool shared, bool optional,
36 bool acquired);
Vivek Gautam17c82e22017-05-22 16:53:25 +053037
Geert Uytterhoeveneaf91db2018-11-13 13:47:44 +010038int reset_control_get_count(struct device *dev);
39
Philipp Zabelb4240802014-03-07 15:18:47 +010040#else
41
42static inline int reset_control_reset(struct reset_control *rstc)
43{
Philipp Zabelb4240802014-03-07 15:18:47 +010044 return 0;
45}
46
47static inline int reset_control_assert(struct reset_control *rstc)
48{
Philipp Zabelb4240802014-03-07 15:18:47 +010049 return 0;
50}
51
52static inline int reset_control_deassert(struct reset_control *rstc)
53{
Philipp Zabelb4240802014-03-07 15:18:47 +010054 return 0;
55}
56
Dinh Nguyen729de412014-10-10 10:21:14 -050057static inline int reset_control_status(struct reset_control *rstc)
58{
Dinh Nguyen729de412014-10-10 10:21:14 -050059 return 0;
60}
61
Philipp Zabelc84b0322019-02-21 16:25:53 +010062static inline int reset_control_acquire(struct reset_control *rstc)
63{
64 return 0;
65}
66
67static inline void reset_control_release(struct reset_control *rstc)
68{
69}
70
Philipp Zabelb4240802014-03-07 15:18:47 +010071static inline void reset_control_put(struct reset_control *rstc)
72{
Philipp Zabelb4240802014-03-07 15:18:47 +010073}
74
Masahiro Yamada1554bbd2017-10-29 01:50:06 +090075static inline int __device_reset(struct device *dev, bool optional)
Daniel Lezcano41136522016-04-01 21:38:16 +020076{
Masahiro Yamada1554bbd2017-10-29 01:50:06 +090077 return optional ? 0 : -ENOTSUPP;
Philipp Zabelb4240802014-03-07 15:18:47 +010078}
79
Hans de Goede6c96f052016-02-23 18:46:24 +010080static inline struct reset_control *__of_reset_control_get(
81 struct device_node *node,
Ramiro Oliveirabb475232017-01-13 17:57:41 +000082 const char *id, int index, bool shared,
Philipp Zabelc84b0322019-02-21 16:25:53 +010083 bool optional, bool acquired)
Axel Lin5bcd0b72015-09-01 07:56:38 +080084{
Philipp Zabel0ca10b62017-03-20 11:25:16 +010085 return optional ? NULL : ERR_PTR(-ENOTSUPP);
Axel Lin5bcd0b72015-09-01 07:56:38 +080086}
87
Philipp Zabel62e24c52016-02-05 13:41:39 +010088static inline struct reset_control *__reset_control_get(
89 struct device *dev, const char *id,
Philipp Zabelc84b0322019-02-21 16:25:53 +010090 int index, bool shared, bool optional,
91 bool acquired)
Philipp Zabel62e24c52016-02-05 13:41:39 +010092{
93 return optional ? NULL : ERR_PTR(-ENOTSUPP);
94}
95
Hans de Goede6c96f052016-02-23 18:46:24 +010096static inline struct reset_control *__devm_reset_control_get(
Ramiro Oliveirabb475232017-01-13 17:57:41 +000097 struct device *dev, const char *id,
Philipp Zabelc84b0322019-02-21 16:25:53 +010098 int index, bool shared, bool optional,
99 bool acquired)
Hans de Goede6c96f052016-02-23 18:46:24 +0100100{
Philipp Zabel0ca10b62017-03-20 11:25:16 +0100101 return optional ? NULL : ERR_PTR(-ENOTSUPP);
Hans de Goede6c96f052016-02-23 18:46:24 +0100102}
103
Vivek Gautam17c82e22017-05-22 16:53:25 +0530104static inline struct reset_control *
105devm_reset_control_array_get(struct device *dev, bool shared, bool optional)
106{
107 return optional ? NULL : ERR_PTR(-ENOTSUPP);
108}
109
110static inline struct reset_control *
Thierry Redingf31d5c22019-02-21 16:25:54 +0100111of_reset_control_array_get(struct device_node *np, bool shared, bool optional,
112 bool acquired)
Vivek Gautam17c82e22017-05-22 16:53:25 +0530113{
114 return optional ? NULL : ERR_PTR(-ENOTSUPP);
115}
116
Geert Uytterhoeveneaf91db2018-11-13 13:47:44 +0100117static inline int reset_control_get_count(struct device *dev)
118{
119 return -ENOENT;
120}
121
Hans de Goede6c96f052016-02-23 18:46:24 +0100122#endif /* CONFIG_RESET_CONTROLLER */
123
Masahiro Yamada1554bbd2017-10-29 01:50:06 +0900124static inline int __must_check device_reset(struct device *dev)
125{
126 return __device_reset(dev, false);
127}
128
129static inline int device_reset_optional(struct device *dev)
130{
131 return __device_reset(dev, true);
132}
133
Hans de Goede6c96f052016-02-23 18:46:24 +0100134/**
Lee Jonesa53e35d2016-06-06 16:56:50 +0100135 * reset_control_get_exclusive - Lookup and obtain an exclusive reference
136 * to a reset controller.
Hans de Goede6c96f052016-02-23 18:46:24 +0100137 * @dev: device to be reset by the controller
138 * @id: reset line name
139 *
140 * Returns a struct reset_control or IS_ERR() condition containing errno.
Geert Uytterhoeven34845c92018-09-26 15:20:03 +0200141 * If this function is called more than once for the same reset_control it will
Hans de Goede0b522972016-02-23 18:46:26 +0100142 * return -EBUSY.
143 *
144 * See reset_control_get_shared for details on shared references to
145 * reset-controls.
Hans de Goede6c96f052016-02-23 18:46:24 +0100146 *
147 * Use of id names is optional.
148 */
Lee Jonesa53e35d2016-06-06 16:56:50 +0100149static inline struct reset_control *
150__must_check reset_control_get_exclusive(struct device *dev, const char *id)
Axel Lin5bcd0b72015-09-01 07:56:38 +0800151{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100152 return __reset_control_get(dev, id, 0, false, false, true);
153}
154
155/**
156 * reset_control_get_exclusive_released - Lookup and obtain a temoprarily
157 * exclusive reference to a reset
158 * controller.
159 * @dev: device to be reset by the controller
160 * @id: reset line name
161 *
162 * Returns a struct reset_control or IS_ERR() condition containing errno.
163 * reset-controls returned by this function must be acquired via
164 * reset_control_acquire() before they can be used and should be released
165 * via reset_control_release() afterwards.
166 *
167 * Use of id names is optional.
168 */
169static inline struct reset_control *
170__must_check reset_control_get_exclusive_released(struct device *dev,
171 const char *id)
172{
173 return __reset_control_get(dev, id, 0, false, false, false);
Axel Lin5bcd0b72015-09-01 07:56:38 +0800174}
175
Hans de Goede6c96f052016-02-23 18:46:24 +0100176/**
Hans de Goede0b522972016-02-23 18:46:26 +0100177 * reset_control_get_shared - Lookup and obtain a shared reference to a
178 * reset controller.
179 * @dev: device to be reset by the controller
180 * @id: reset line name
181 *
182 * Returns a struct reset_control or IS_ERR() condition containing errno.
183 * This function is intended for use with reset-controls which are shared
Geert Uytterhoeven12c62b92018-10-08 13:15:43 +0200184 * between hardware blocks.
Hans de Goede0b522972016-02-23 18:46:26 +0100185 *
186 * When a reset-control is shared, the behavior of reset_control_assert /
187 * deassert is changed, the reset-core will keep track of a deassert_count
188 * and only (re-)assert the reset after reset_control_assert has been called
189 * as many times as reset_control_deassert was called. Also see the remark
190 * about shared reset-controls in the reset_control_assert docs.
191 *
192 * Calling reset_control_assert without first calling reset_control_deassert
193 * is not allowed on a shared reset control. Calling reset_control_reset is
194 * also not allowed on a shared reset control.
195 *
196 * Use of id names is optional.
197 */
198static inline struct reset_control *reset_control_get_shared(
199 struct device *dev, const char *id)
200{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100201 return __reset_control_get(dev, id, 0, true, false, false);
Hans de Goede0b522972016-02-23 18:46:26 +0100202}
203
Lee Jonesa53e35d2016-06-06 16:56:50 +0100204static inline struct reset_control *reset_control_get_optional_exclusive(
Lee Jones3c35f6e2016-06-06 16:56:49 +0100205 struct device *dev, const char *id)
206{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100207 return __reset_control_get(dev, id, 0, false, true, true);
Lee Jones3c35f6e2016-06-06 16:56:49 +0100208}
209
Lee Jonesc33d61a2016-06-06 16:56:52 +0100210static inline struct reset_control *reset_control_get_optional_shared(
211 struct device *dev, const char *id)
212{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100213 return __reset_control_get(dev, id, 0, true, true, false);
Lee Jonesc33d61a2016-06-06 16:56:52 +0100214}
215
Hans de Goede0b522972016-02-23 18:46:26 +0100216/**
Lee Jonesa53e35d2016-06-06 16:56:50 +0100217 * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
218 * to a reset controller.
Hans de Goede6c96f052016-02-23 18:46:24 +0100219 * @node: device to be reset by the controller
220 * @id: reset line name
221 *
222 * Returns a struct reset_control or IS_ERR() condition containing errno.
223 *
224 * Use of id names is optional.
225 */
Lee Jonesa53e35d2016-06-06 16:56:50 +0100226static inline struct reset_control *of_reset_control_get_exclusive(
Hans de Goede6c96f052016-02-23 18:46:24 +0100227 struct device_node *node, const char *id)
228{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100229 return __of_reset_control_get(node, id, 0, false, false, true);
Hans de Goede6c96f052016-02-23 18:46:24 +0100230}
231
232/**
Geert Uytterhoeven12c62b92018-10-08 13:15:43 +0200233 * of_reset_control_get_shared - Lookup and obtain a shared reference
Lee Jones40faee8e2016-06-06 16:56:51 +0100234 * to a reset controller.
235 * @node: device to be reset by the controller
236 * @id: reset line name
237 *
238 * When a reset-control is shared, the behavior of reset_control_assert /
239 * deassert is changed, the reset-core will keep track of a deassert_count
240 * and only (re-)assert the reset after reset_control_assert has been called
241 * as many times as reset_control_deassert was called. Also see the remark
242 * about shared reset-controls in the reset_control_assert docs.
243 *
244 * Calling reset_control_assert without first calling reset_control_deassert
245 * is not allowed on a shared reset control. Calling reset_control_reset is
246 * also not allowed on a shared reset control.
247 * Returns a struct reset_control or IS_ERR() condition containing errno.
248 *
249 * Use of id names is optional.
250 */
251static inline struct reset_control *of_reset_control_get_shared(
252 struct device_node *node, const char *id)
253{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100254 return __of_reset_control_get(node, id, 0, true, false, false);
Lee Jones40faee8e2016-06-06 16:56:51 +0100255}
256
257/**
Lee Jonesa53e35d2016-06-06 16:56:50 +0100258 * of_reset_control_get_exclusive_by_index - Lookup and obtain an exclusive
259 * reference to a reset controller
260 * by index.
Hans de Goede6c96f052016-02-23 18:46:24 +0100261 * @node: device to be reset by the controller
262 * @index: index of the reset controller
263 *
264 * This is to be used to perform a list of resets for a device or power domain
265 * in whatever order. Returns a struct reset_control or IS_ERR() condition
266 * containing errno.
267 */
Lee Jonesa53e35d2016-06-06 16:56:50 +0100268static inline struct reset_control *of_reset_control_get_exclusive_by_index(
Hans de Goede6c96f052016-02-23 18:46:24 +0100269 struct device_node *node, int index)
270{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100271 return __of_reset_control_get(node, NULL, index, false, false, true);
Hans de Goede6c96f052016-02-23 18:46:24 +0100272}
273
274/**
Geert Uytterhoeven12c62b92018-10-08 13:15:43 +0200275 * of_reset_control_get_shared_by_index - Lookup and obtain a shared
Lee Jones40faee8e2016-06-06 16:56:51 +0100276 * reference to a reset controller
277 * by index.
278 * @node: device to be reset by the controller
279 * @index: index of the reset controller
280 *
281 * When a reset-control is shared, the behavior of reset_control_assert /
282 * deassert is changed, the reset-core will keep track of a deassert_count
283 * and only (re-)assert the reset after reset_control_assert has been called
284 * as many times as reset_control_deassert was called. Also see the remark
285 * about shared reset-controls in the reset_control_assert docs.
286 *
287 * Calling reset_control_assert without first calling reset_control_deassert
288 * is not allowed on a shared reset control. Calling reset_control_reset is
289 * also not allowed on a shared reset control.
290 * Returns a struct reset_control or IS_ERR() condition containing errno.
291 *
292 * This is to be used to perform a list of resets for a device or power domain
293 * in whatever order. Returns a struct reset_control or IS_ERR() condition
294 * containing errno.
295 */
296static inline struct reset_control *of_reset_control_get_shared_by_index(
297 struct device_node *node, int index)
298{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100299 return __of_reset_control_get(node, NULL, index, true, false, false);
Lee Jones40faee8e2016-06-06 16:56:51 +0100300}
301
302/**
Lee Jonesa53e35d2016-06-06 16:56:50 +0100303 * devm_reset_control_get_exclusive - resource managed
304 * reset_control_get_exclusive()
Hans de Goede6c96f052016-02-23 18:46:24 +0100305 * @dev: device to be reset by the controller
306 * @id: reset line name
307 *
Lee Jonesa53e35d2016-06-06 16:56:50 +0100308 * Managed reset_control_get_exclusive(). For reset controllers returned
309 * from this function, reset_control_put() is called automatically on driver
310 * detach.
311 *
312 * See reset_control_get_exclusive() for more information.
Hans de Goede6c96f052016-02-23 18:46:24 +0100313 */
Lee Jonesa53e35d2016-06-06 16:56:50 +0100314static inline struct reset_control *
315__must_check devm_reset_control_get_exclusive(struct device *dev,
316 const char *id)
Hans de Goede6c96f052016-02-23 18:46:24 +0100317{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100318 return __devm_reset_control_get(dev, id, 0, false, false, true);
319}
320
321/**
322 * devm_reset_control_get_exclusive_released - resource managed
323 * reset_control_get_exclusive_released()
324 * @dev: device to be reset by the controller
325 * @id: reset line name
326 *
327 * Managed reset_control_get_exclusive_released(). For reset controllers
328 * returned from this function, reset_control_put() is called automatically on
329 * driver detach.
330 *
331 * See reset_control_get_exclusive_released() for more information.
332 */
333static inline struct reset_control *
334__must_check devm_reset_control_get_exclusive_released(struct device *dev,
335 const char *id)
336{
337 return __devm_reset_control_get(dev, id, 0, false, false, false);
Philipp Zabelb4240802014-03-07 15:18:47 +0100338}
339
Hans de Goede0b522972016-02-23 18:46:26 +0100340/**
341 * devm_reset_control_get_shared - resource managed reset_control_get_shared()
342 * @dev: device to be reset by the controller
343 * @id: reset line name
344 *
345 * Managed reset_control_get_shared(). For reset controllers returned from
346 * this function, reset_control_put() is called automatically on driver detach.
347 * See reset_control_get_shared() for more information.
348 */
349static inline struct reset_control *devm_reset_control_get_shared(
350 struct device *dev, const char *id)
351{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100352 return __devm_reset_control_get(dev, id, 0, true, false, false);
Hans de Goede0b522972016-02-23 18:46:26 +0100353}
354
Lee Jonesa53e35d2016-06-06 16:56:50 +0100355static inline struct reset_control *devm_reset_control_get_optional_exclusive(
Philipp Zabelb4240802014-03-07 15:18:47 +0100356 struct device *dev, const char *id)
357{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100358 return __devm_reset_control_get(dev, id, 0, false, true, true);
Philipp Zabelb4240802014-03-07 15:18:47 +0100359}
360
Lee Jonesc33d61a2016-06-06 16:56:52 +0100361static inline struct reset_control *devm_reset_control_get_optional_shared(
362 struct device *dev, const char *id)
363{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100364 return __devm_reset_control_get(dev, id, 0, true, true, false);
Lee Jonesc33d61a2016-06-06 16:56:52 +0100365}
366
Hans de Goede6c96f052016-02-23 18:46:24 +0100367/**
Lee Jonesa53e35d2016-06-06 16:56:50 +0100368 * devm_reset_control_get_exclusive_by_index - resource managed
369 * reset_control_get_exclusive()
Hans de Goede6c96f052016-02-23 18:46:24 +0100370 * @dev: device to be reset by the controller
371 * @index: index of the reset controller
372 *
Lee Jonesa53e35d2016-06-06 16:56:50 +0100373 * Managed reset_control_get_exclusive(). For reset controllers returned from
374 * this function, reset_control_put() is called automatically on driver
375 * detach.
376 *
377 * See reset_control_get_exclusive() for more information.
Hans de Goede6c96f052016-02-23 18:46:24 +0100378 */
Lee Jonesa53e35d2016-06-06 16:56:50 +0100379static inline struct reset_control *
380devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
Hans de Goedee3ec0a82014-04-13 14:09:15 +0200381{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100382 return __devm_reset_control_get(dev, NULL, index, false, false, true);
Hans de Goede0b522972016-02-23 18:46:26 +0100383}
384
Hans de Goede0b522972016-02-23 18:46:26 +0100385/**
386 * devm_reset_control_get_shared_by_index - resource managed
Geert Uytterhoeven12c62b92018-10-08 13:15:43 +0200387 * reset_control_get_shared
Hans de Goede0b522972016-02-23 18:46:26 +0100388 * @dev: device to be reset by the controller
389 * @index: index of the reset controller
390 *
391 * Managed reset_control_get_shared(). For reset controllers returned from
392 * this function, reset_control_put() is called automatically on driver detach.
393 * See reset_control_get_shared() for more information.
394 */
Lee Jones0bcc0ea2016-06-06 16:56:53 +0100395static inline struct reset_control *
396devm_reset_control_get_shared_by_index(struct device *dev, int index)
Hans de Goede0b522972016-02-23 18:46:26 +0100397{
Philipp Zabelc84b0322019-02-21 16:25:53 +0100398 return __devm_reset_control_get(dev, NULL, index, true, false, false);
Hans de Goedee3ec0a82014-04-13 14:09:15 +0200399}
400
Lee Jonesa53e35d2016-06-06 16:56:50 +0100401/*
402 * TEMPORARY calls to use during transition:
403 *
404 * of_reset_control_get() => of_reset_control_get_exclusive()
405 *
406 * These inline function calls will be removed once all consumers
407 * have been moved over to the new explicit API.
408 */
Lee Jonesa53e35d2016-06-06 16:56:50 +0100409static inline struct reset_control *of_reset_control_get(
410 struct device_node *node, const char *id)
411{
412 return of_reset_control_get_exclusive(node, id);
413}
414
415static inline struct reset_control *of_reset_control_get_by_index(
416 struct device_node *node, int index)
417{
418 return of_reset_control_get_exclusive_by_index(node, index);
419}
420
421static inline struct reset_control *devm_reset_control_get(
422 struct device *dev, const char *id)
423{
424 return devm_reset_control_get_exclusive(dev, id);
425}
426
427static inline struct reset_control *devm_reset_control_get_optional(
428 struct device *dev, const char *id)
429{
430 return devm_reset_control_get_optional_exclusive(dev, id);
431
432}
433
434static inline struct reset_control *devm_reset_control_get_by_index(
435 struct device *dev, int index)
436{
437 return devm_reset_control_get_exclusive_by_index(dev, index);
438}
Vivek Gautam17c82e22017-05-22 16:53:25 +0530439
440/*
441 * APIs to manage a list of reset controllers
442 */
443static inline struct reset_control *
444devm_reset_control_array_get_exclusive(struct device *dev)
445{
446 return devm_reset_control_array_get(dev, false, false);
447}
448
449static inline struct reset_control *
450devm_reset_control_array_get_shared(struct device *dev)
451{
452 return devm_reset_control_array_get(dev, true, false);
453}
454
455static inline struct reset_control *
456devm_reset_control_array_get_optional_exclusive(struct device *dev)
457{
458 return devm_reset_control_array_get(dev, false, true);
459}
460
461static inline struct reset_control *
462devm_reset_control_array_get_optional_shared(struct device *dev)
463{
464 return devm_reset_control_array_get(dev, true, true);
465}
466
467static inline struct reset_control *
468of_reset_control_array_get_exclusive(struct device_node *node)
469{
Thierry Redingf31d5c22019-02-21 16:25:54 +0100470 return of_reset_control_array_get(node, false, false, true);
Vivek Gautam17c82e22017-05-22 16:53:25 +0530471}
472
473static inline struct reset_control *
Thierry Reding22815f182019-02-21 16:25:55 +0100474of_reset_control_array_get_exclusive_released(struct device_node *node)
475{
476 return of_reset_control_array_get(node, false, false, false);
477}
478
479static inline struct reset_control *
Vivek Gautam17c82e22017-05-22 16:53:25 +0530480of_reset_control_array_get_shared(struct device_node *node)
481{
Thierry Redingf31d5c22019-02-21 16:25:54 +0100482 return of_reset_control_array_get(node, true, false, true);
Vivek Gautam17c82e22017-05-22 16:53:25 +0530483}
484
485static inline struct reset_control *
486of_reset_control_array_get_optional_exclusive(struct device_node *node)
487{
Thierry Redingf31d5c22019-02-21 16:25:54 +0100488 return of_reset_control_array_get(node, false, true, true);
Vivek Gautam17c82e22017-05-22 16:53:25 +0530489}
490
491static inline struct reset_control *
492of_reset_control_array_get_optional_shared(struct device_node *node)
493{
Thierry Redingf31d5c22019-02-21 16:25:54 +0100494 return of_reset_control_array_get(node, true, true, true);
Vivek Gautam17c82e22017-05-22 16:53:25 +0530495}
Philipp Zabel61fc4132012-11-19 17:23:13 +0100496#endif