1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_RESET_H_
3 #define _LINUX_RESET_H_
6 #include <linux/errno.h>
7 #include <linux/types.h>
14 * struct reset_control_bulk_data - Data used for bulk reset control operations.
16 * @id: reset control consumer ID
17 * @rstc: struct reset_control * to store the associated reset control
19 * The reset APIs provide a series of reset_control_bulk_*() API calls as
20 * a convenience to consumers which require multiple reset controls.
21 * This structure is used to manage data for these calls.
23 struct reset_control_bulk_data {
25 struct reset_control *rstc;
28 #ifdef CONFIG_RESET_CONTROLLER
30 int reset_control_reset(struct reset_control *rstc);
31 int reset_control_rearm(struct reset_control *rstc);
32 int reset_control_assert(struct reset_control *rstc);
33 int reset_control_deassert(struct reset_control *rstc);
34 int reset_control_status(struct reset_control *rstc);
35 int reset_control_acquire(struct reset_control *rstc);
36 void reset_control_release(struct reset_control *rstc);
38 int reset_control_bulk_reset(int num_rstcs, struct reset_control_bulk_data *rstcs);
39 int reset_control_bulk_assert(int num_rstcs, struct reset_control_bulk_data *rstcs);
40 int reset_control_bulk_deassert(int num_rstcs, struct reset_control_bulk_data *rstcs);
41 int reset_control_bulk_acquire(int num_rstcs, struct reset_control_bulk_data *rstcs);
42 void reset_control_bulk_release(int num_rstcs, struct reset_control_bulk_data *rstcs);
44 struct reset_control *__of_reset_control_get(struct device_node *node,
45 const char *id, int index, bool shared,
46 bool optional, bool acquired);
47 struct reset_control *__reset_control_get(struct device *dev, const char *id,
48 int index, bool shared,
49 bool optional, bool acquired);
50 void reset_control_put(struct reset_control *rstc);
51 int __reset_control_bulk_get(struct device *dev, int num_rstcs,
52 struct reset_control_bulk_data *rstcs,
53 bool shared, bool optional, bool acquired);
54 void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs);
56 int __device_reset(struct device *dev, bool optional);
57 struct reset_control *__devm_reset_control_get(struct device *dev,
58 const char *id, int index, bool shared,
59 bool optional, bool acquired);
60 int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs,
61 struct reset_control_bulk_data *rstcs,
62 bool shared, bool optional, bool acquired);
64 struct reset_control *devm_reset_control_array_get(struct device *dev,
65 bool shared, bool optional);
66 struct reset_control *of_reset_control_array_get(struct device_node *np,
67 bool shared, bool optional,
70 int reset_control_get_count(struct device *dev);
74 static inline int reset_control_reset(struct reset_control *rstc)
79 static inline int reset_control_assert(struct reset_control *rstc)
84 static inline int reset_control_deassert(struct reset_control *rstc)
89 static inline int reset_control_status(struct reset_control *rstc)
94 static inline int reset_control_acquire(struct reset_control *rstc)
99 static inline void reset_control_release(struct reset_control *rstc)
103 static inline void reset_control_put(struct reset_control *rstc)
107 static inline int __device_reset(struct device *dev, bool optional)
109 return optional ? 0 : -ENOTSUPP;
112 static inline struct reset_control *__of_reset_control_get(
113 struct device_node *node,
114 const char *id, int index, bool shared,
115 bool optional, bool acquired)
117 return optional ? NULL : ERR_PTR(-ENOTSUPP);
120 static inline struct reset_control *__reset_control_get(
121 struct device *dev, const char *id,
122 int index, bool shared, bool optional,
125 return optional ? NULL : ERR_PTR(-ENOTSUPP);
129 reset_control_bulk_reset(int num_rstcs, struct reset_control_bulk_data *rstcs)
135 reset_control_bulk_assert(int num_rstcs, struct reset_control_bulk_data *rstcs)
141 reset_control_bulk_deassert(int num_rstcs, struct reset_control_bulk_data *rstcs)
147 reset_control_bulk_acquire(int num_rstcs, struct reset_control_bulk_data *rstcs)
153 reset_control_bulk_release(int num_rstcs, struct reset_control_bulk_data *rstcs)
158 __reset_control_bulk_get(struct device *dev, int num_rstcs,
159 struct reset_control_bulk_data *rstcs,
160 bool shared, bool optional, bool acquired)
162 return optional ? 0 : -EOPNOTSUPP;
166 reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs)
170 static inline struct reset_control *__devm_reset_control_get(
171 struct device *dev, const char *id,
172 int index, bool shared, bool optional,
175 return optional ? NULL : ERR_PTR(-ENOTSUPP);
179 __devm_reset_control_bulk_get(struct device *dev, int num_rstcs,
180 struct reset_control_bulk_data *rstcs,
181 bool shared, bool optional, bool acquired)
183 return optional ? 0 : -EOPNOTSUPP;
186 static inline struct reset_control *
187 devm_reset_control_array_get(struct device *dev, bool shared, bool optional)
189 return optional ? NULL : ERR_PTR(-ENOTSUPP);
192 static inline struct reset_control *
193 of_reset_control_array_get(struct device_node *np, bool shared, bool optional,
196 return optional ? NULL : ERR_PTR(-ENOTSUPP);
199 static inline int reset_control_get_count(struct device *dev)
204 #endif /* CONFIG_RESET_CONTROLLER */
206 static inline int __must_check device_reset(struct device *dev)
208 return __device_reset(dev, false);
211 static inline int device_reset_optional(struct device *dev)
213 return __device_reset(dev, true);
217 * reset_control_get_exclusive - Lookup and obtain an exclusive reference
218 * to a reset controller.
219 * @dev: device to be reset by the controller
220 * @id: reset line name
222 * Returns a struct reset_control or IS_ERR() condition containing errno.
223 * If this function is called more than once for the same reset_control it will
226 * See reset_control_get_shared() for details on shared references to
229 * Use of id names is optional.
231 static inline struct reset_control *
232 __must_check reset_control_get_exclusive(struct device *dev, const char *id)
234 return __reset_control_get(dev, id, 0, false, false, true);
238 * reset_control_bulk_get_exclusive - Lookup and obtain exclusive references to
239 * multiple reset controllers.
240 * @dev: device to be reset by the controller
241 * @num_rstcs: number of entries in rstcs array
242 * @rstcs: array of struct reset_control_bulk_data with reset line names set
244 * Fills the rstcs array with pointers to exclusive reset controls and
245 * returns 0, or an IS_ERR() condition containing errno.
247 static inline int __must_check
248 reset_control_bulk_get_exclusive(struct device *dev, int num_rstcs,
249 struct reset_control_bulk_data *rstcs)
251 return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, true);
255 * reset_control_get_exclusive_released - Lookup and obtain a temoprarily
256 * exclusive reference to a reset
258 * @dev: device to be reset by the controller
259 * @id: reset line name
261 * Returns a struct reset_control or IS_ERR() condition containing errno.
262 * reset-controls returned by this function must be acquired via
263 * reset_control_acquire() before they can be used and should be released
264 * via reset_control_release() afterwards.
266 * Use of id names is optional.
268 static inline struct reset_control *
269 __must_check reset_control_get_exclusive_released(struct device *dev,
272 return __reset_control_get(dev, id, 0, false, false, false);
276 * reset_control_bulk_get_exclusive_released - Lookup and obtain temporarily
277 * exclusive references to multiple reset
279 * @dev: device to be reset by the controller
280 * @num_rstcs: number of entries in rstcs array
281 * @rstcs: array of struct reset_control_bulk_data with reset line names set
283 * Fills the rstcs array with pointers to exclusive reset controls and
284 * returns 0, or an IS_ERR() condition containing errno.
285 * reset-controls returned by this function must be acquired via
286 * reset_control_bulk_acquire() before they can be used and should be released
287 * via reset_control_bulk_release() afterwards.
289 static inline int __must_check
290 reset_control_bulk_get_exclusive_released(struct device *dev, int num_rstcs,
291 struct reset_control_bulk_data *rstcs)
293 return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, false);
297 * reset_control_bulk_get_optional_exclusive_released - Lookup and obtain optional
298 * temporarily exclusive references to multiple
300 * @dev: device to be reset by the controller
301 * @num_rstcs: number of entries in rstcs array
302 * @rstcs: array of struct reset_control_bulk_data with reset line names set
304 * Optional variant of reset_control_bulk_get_exclusive_released(). If the
305 * requested reset is not specified in the device tree, this function returns 0
306 * instead of an error and missing rtsc is set to NULL.
308 * See reset_control_bulk_get_exclusive_released() for more information.
310 static inline int __must_check
311 reset_control_bulk_get_optional_exclusive_released(struct device *dev, int num_rstcs,
312 struct reset_control_bulk_data *rstcs)
314 return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, false);
318 * reset_control_get_shared - Lookup and obtain a shared reference to a
320 * @dev: device to be reset by the controller
321 * @id: reset line name
323 * Returns a struct reset_control or IS_ERR() condition containing errno.
324 * This function is intended for use with reset-controls which are shared
325 * between hardware blocks.
327 * When a reset-control is shared, the behavior of reset_control_assert /
328 * deassert is changed, the reset-core will keep track of a deassert_count
329 * and only (re-)assert the reset after reset_control_assert has been called
330 * as many times as reset_control_deassert was called. Also see the remark
331 * about shared reset-controls in the reset_control_assert docs.
333 * Calling reset_control_assert without first calling reset_control_deassert
334 * is not allowed on a shared reset control. Calling reset_control_reset is
335 * also not allowed on a shared reset control.
337 * Use of id names is optional.
339 static inline struct reset_control *reset_control_get_shared(
340 struct device *dev, const char *id)
342 return __reset_control_get(dev, id, 0, true, false, false);
346 * reset_control_bulk_get_shared - Lookup and obtain shared references to
347 * multiple reset controllers.
348 * @dev: device to be reset by the controller
349 * @num_rstcs: number of entries in rstcs array
350 * @rstcs: array of struct reset_control_bulk_data with reset line names set
352 * Fills the rstcs array with pointers to shared reset controls and
353 * returns 0, or an IS_ERR() condition containing errno.
355 static inline int __must_check
356 reset_control_bulk_get_shared(struct device *dev, int num_rstcs,
357 struct reset_control_bulk_data *rstcs)
359 return __reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, false);
363 * reset_control_get_optional_exclusive - optional reset_control_get_exclusive()
364 * @dev: device to be reset by the controller
365 * @id: reset line name
367 * Optional variant of reset_control_get_exclusive(). If the requested reset
368 * is not specified in the device tree, this function returns NULL instead of
371 * See reset_control_get_exclusive() for more information.
373 static inline struct reset_control *reset_control_get_optional_exclusive(
374 struct device *dev, const char *id)
376 return __reset_control_get(dev, id, 0, false, true, true);
380 * reset_control_bulk_get_optional_exclusive - optional
381 * reset_control_bulk_get_exclusive()
382 * @dev: device to be reset by the controller
383 * @num_rstcs: number of entries in rstcs array
384 * @rstcs: array of struct reset_control_bulk_data with reset line names set
386 * Optional variant of reset_control_bulk_get_exclusive(). If any of the
387 * requested resets are not specified in the device tree, this function sets
388 * them to NULL instead of returning an error.
390 * See reset_control_bulk_get_exclusive() for more information.
392 static inline int __must_check
393 reset_control_bulk_get_optional_exclusive(struct device *dev, int num_rstcs,
394 struct reset_control_bulk_data *rstcs)
396 return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, true);
400 * reset_control_get_optional_shared - optional reset_control_get_shared()
401 * @dev: device to be reset by the controller
402 * @id: reset line name
404 * Optional variant of reset_control_get_shared(). If the requested reset
405 * is not specified in the device tree, this function returns NULL instead of
408 * See reset_control_get_shared() for more information.
410 static inline struct reset_control *reset_control_get_optional_shared(
411 struct device *dev, const char *id)
413 return __reset_control_get(dev, id, 0, true, true, false);
417 * reset_control_bulk_get_optional_shared - optional
418 * reset_control_bulk_get_shared()
419 * @dev: device to be reset by the controller
420 * @num_rstcs: number of entries in rstcs array
421 * @rstcs: array of struct reset_control_bulk_data with reset line names set
423 * Optional variant of reset_control_bulk_get_shared(). If the requested resets
424 * are not specified in the device tree, this function sets them to NULL
425 * instead of returning an error.
427 * See reset_control_bulk_get_shared() for more information.
429 static inline int __must_check
430 reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs,
431 struct reset_control_bulk_data *rstcs)
433 return __reset_control_bulk_get(dev, num_rstcs, rstcs, true, true, false);
437 * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
438 * to a reset controller.
439 * @node: device to be reset by the controller
440 * @id: reset line name
442 * Returns a struct reset_control or IS_ERR() condition containing errno.
444 * Use of id names is optional.
446 static inline struct reset_control *of_reset_control_get_exclusive(
447 struct device_node *node, const char *id)
449 return __of_reset_control_get(node, id, 0, false, false, true);
453 * of_reset_control_get_shared - Lookup and obtain a shared reference
454 * to a reset controller.
455 * @node: device to be reset by the controller
456 * @id: reset line name
458 * When a reset-control is shared, the behavior of reset_control_assert /
459 * deassert is changed, the reset-core will keep track of a deassert_count
460 * and only (re-)assert the reset after reset_control_assert has been called
461 * as many times as reset_control_deassert was called. Also see the remark
462 * about shared reset-controls in the reset_control_assert docs.
464 * Calling reset_control_assert without first calling reset_control_deassert
465 * is not allowed on a shared reset control. Calling reset_control_reset is
466 * also not allowed on a shared reset control.
467 * Returns a struct reset_control or IS_ERR() condition containing errno.
469 * Use of id names is optional.
471 static inline struct reset_control *of_reset_control_get_shared(
472 struct device_node *node, const char *id)
474 return __of_reset_control_get(node, id, 0, true, false, false);
478 * of_reset_control_get_exclusive_by_index - Lookup and obtain an exclusive
479 * reference to a reset controller
481 * @node: device to be reset by the controller
482 * @index: index of the reset controller
484 * This is to be used to perform a list of resets for a device or power domain
485 * in whatever order. Returns a struct reset_control or IS_ERR() condition
488 static inline struct reset_control *of_reset_control_get_exclusive_by_index(
489 struct device_node *node, int index)
491 return __of_reset_control_get(node, NULL, index, false, false, true);
495 * of_reset_control_get_shared_by_index - Lookup and obtain a shared
496 * reference to a reset controller
498 * @node: device to be reset by the controller
499 * @index: index of the reset controller
501 * When a reset-control is shared, the behavior of reset_control_assert /
502 * deassert is changed, the reset-core will keep track of a deassert_count
503 * and only (re-)assert the reset after reset_control_assert has been called
504 * as many times as reset_control_deassert was called. Also see the remark
505 * about shared reset-controls in the reset_control_assert docs.
507 * Calling reset_control_assert without first calling reset_control_deassert
508 * is not allowed on a shared reset control. Calling reset_control_reset is
509 * also not allowed on a shared reset control.
510 * Returns a struct reset_control or IS_ERR() condition containing errno.
512 * This is to be used to perform a list of resets for a device or power domain
513 * in whatever order. Returns a struct reset_control or IS_ERR() condition
516 static inline struct reset_control *of_reset_control_get_shared_by_index(
517 struct device_node *node, int index)
519 return __of_reset_control_get(node, NULL, index, true, false, false);
523 * devm_reset_control_get_exclusive - resource managed
524 * reset_control_get_exclusive()
525 * @dev: device to be reset by the controller
526 * @id: reset line name
528 * Managed reset_control_get_exclusive(). For reset controllers returned
529 * from this function, reset_control_put() is called automatically on driver
532 * See reset_control_get_exclusive() for more information.
534 static inline struct reset_control *
535 __must_check devm_reset_control_get_exclusive(struct device *dev,
538 return __devm_reset_control_get(dev, id, 0, false, false, true);
542 * devm_reset_control_bulk_get_exclusive - resource managed
543 * reset_control_bulk_get_exclusive()
544 * @dev: device to be reset by the controller
545 * @num_rstcs: number of entries in rstcs array
546 * @rstcs: array of struct reset_control_bulk_data with reset line names set
548 * Managed reset_control_bulk_get_exclusive(). For reset controllers returned
549 * from this function, reset_control_put() is called automatically on driver
552 * See reset_control_bulk_get_exclusive() for more information.
554 static inline int __must_check
555 devm_reset_control_bulk_get_exclusive(struct device *dev, int num_rstcs,
556 struct reset_control_bulk_data *rstcs)
558 return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, true);
562 * devm_reset_control_get_exclusive_released - resource managed
563 * reset_control_get_exclusive_released()
564 * @dev: device to be reset by the controller
565 * @id: reset line name
567 * Managed reset_control_get_exclusive_released(). For reset controllers
568 * returned from this function, reset_control_put() is called automatically on
571 * See reset_control_get_exclusive_released() for more information.
573 static inline struct reset_control *
574 __must_check devm_reset_control_get_exclusive_released(struct device *dev,
577 return __devm_reset_control_get(dev, id, 0, false, false, false);
581 * devm_reset_control_bulk_get_exclusive_released - resource managed
582 * reset_control_bulk_get_exclusive_released()
583 * @dev: device to be reset by the controller
584 * @num_rstcs: number of entries in rstcs array
585 * @rstcs: array of struct reset_control_bulk_data with reset line names set
587 * Managed reset_control_bulk_get_exclusive_released(). For reset controllers
588 * returned from this function, reset_control_put() is called automatically on
591 * See reset_control_bulk_get_exclusive_released() for more information.
593 static inline int __must_check
594 devm_reset_control_bulk_get_exclusive_released(struct device *dev, int num_rstcs,
595 struct reset_control_bulk_data *rstcs)
597 return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, false);
601 * devm_reset_control_get_optional_exclusive_released - resource managed
602 * reset_control_get_optional_exclusive_released()
603 * @dev: device to be reset by the controller
604 * @id: reset line name
606 * Managed-and-optional variant of reset_control_get_exclusive_released(). For
607 * reset controllers returned from this function, reset_control_put() is called
608 * automatically on driver detach.
610 * See reset_control_get_exclusive_released() for more information.
612 static inline struct reset_control *
613 __must_check devm_reset_control_get_optional_exclusive_released(struct device *dev,
616 return __devm_reset_control_get(dev, id, 0, false, true, false);
620 * devm_reset_control_bulk_get_optional_exclusive_released - resource managed
621 * reset_control_bulk_optional_get_exclusive_released()
622 * @dev: device to be reset by the controller
623 * @num_rstcs: number of entries in rstcs array
624 * @rstcs: array of struct reset_control_bulk_data with reset line names set
626 * Managed reset_control_bulk_optional_get_exclusive_released(). For reset
627 * controllers returned from this function, reset_control_put() is called
628 * automatically on driver detach.
630 * See reset_control_bulk_optional_get_exclusive_released() for more information.
632 static inline int __must_check
633 devm_reset_control_bulk_get_optional_exclusive_released(struct device *dev, int num_rstcs,
634 struct reset_control_bulk_data *rstcs)
636 return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, false);
640 * devm_reset_control_get_shared - resource managed reset_control_get_shared()
641 * @dev: device to be reset by the controller
642 * @id: reset line name
644 * Managed reset_control_get_shared(). For reset controllers returned from
645 * this function, reset_control_put() is called automatically on driver detach.
646 * See reset_control_get_shared() for more information.
648 static inline struct reset_control *devm_reset_control_get_shared(
649 struct device *dev, const char *id)
651 return __devm_reset_control_get(dev, id, 0, true, false, false);
655 * devm_reset_control_bulk_get_shared - resource managed
656 * reset_control_bulk_get_shared()
657 * @dev: device to be reset by the controller
658 * @num_rstcs: number of entries in rstcs array
659 * @rstcs: array of struct reset_control_bulk_data with reset line names set
661 * Managed reset_control_bulk_get_shared(). For reset controllers returned
662 * from this function, reset_control_put() is called automatically on driver
665 * See reset_control_bulk_get_shared() for more information.
667 static inline int __must_check
668 devm_reset_control_bulk_get_shared(struct device *dev, int num_rstcs,
669 struct reset_control_bulk_data *rstcs)
671 return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, false);
675 * devm_reset_control_get_optional_exclusive - resource managed
676 * reset_control_get_optional_exclusive()
677 * @dev: device to be reset by the controller
678 * @id: reset line name
680 * Managed reset_control_get_optional_exclusive(). For reset controllers
681 * returned from this function, reset_control_put() is called automatically on
684 * See reset_control_get_optional_exclusive() for more information.
686 static inline struct reset_control *devm_reset_control_get_optional_exclusive(
687 struct device *dev, const char *id)
689 return __devm_reset_control_get(dev, id, 0, false, true, true);
693 * devm_reset_control_bulk_get_optional_exclusive - resource managed
694 * reset_control_bulk_get_optional_exclusive()
695 * @dev: device to be reset by the controller
696 * @num_rstcs: number of entries in rstcs array
697 * @rstcs: array of struct reset_control_bulk_data with reset line names set
699 * Managed reset_control_bulk_get_optional_exclusive(). For reset controllers
700 * returned from this function, reset_control_put() is called automatically on
703 * See reset_control_bulk_get_optional_exclusive() for more information.
705 static inline int __must_check
706 devm_reset_control_bulk_get_optional_exclusive(struct device *dev, int num_rstcs,
707 struct reset_control_bulk_data *rstcs)
709 return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, true);
713 * devm_reset_control_get_optional_shared - resource managed
714 * reset_control_get_optional_shared()
715 * @dev: device to be reset by the controller
716 * @id: reset line name
718 * Managed reset_control_get_optional_shared(). For reset controllers returned
719 * from this function, reset_control_put() is called automatically on driver
722 * See reset_control_get_optional_shared() for more information.
724 static inline struct reset_control *devm_reset_control_get_optional_shared(
725 struct device *dev, const char *id)
727 return __devm_reset_control_get(dev, id, 0, true, true, false);
731 * devm_reset_control_bulk_get_optional_shared - resource managed
732 * reset_control_bulk_get_optional_shared()
733 * @dev: device to be reset by the controller
734 * @num_rstcs: number of entries in rstcs array
735 * @rstcs: array of struct reset_control_bulk_data with reset line names set
737 * Managed reset_control_bulk_get_optional_shared(). For reset controllers
738 * returned from this function, reset_control_put() is called automatically on
741 * See reset_control_bulk_get_optional_shared() for more information.
743 static inline int __must_check
744 devm_reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs,
745 struct reset_control_bulk_data *rstcs)
747 return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, true, false);
751 * devm_reset_control_get_exclusive_by_index - resource managed
752 * reset_control_get_exclusive()
753 * @dev: device to be reset by the controller
754 * @index: index of the reset controller
756 * Managed reset_control_get_exclusive(). For reset controllers returned from
757 * this function, reset_control_put() is called automatically on driver
760 * See reset_control_get_exclusive() for more information.
762 static inline struct reset_control *
763 devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
765 return __devm_reset_control_get(dev, NULL, index, false, false, true);
769 * devm_reset_control_get_shared_by_index - resource managed
770 * reset_control_get_shared
771 * @dev: device to be reset by the controller
772 * @index: index of the reset controller
774 * Managed reset_control_get_shared(). For reset controllers returned from
775 * this function, reset_control_put() is called automatically on driver detach.
776 * See reset_control_get_shared() for more information.
778 static inline struct reset_control *
779 devm_reset_control_get_shared_by_index(struct device *dev, int index)
781 return __devm_reset_control_get(dev, NULL, index, true, false, false);
785 * TEMPORARY calls to use during transition:
787 * of_reset_control_get() => of_reset_control_get_exclusive()
789 * These inline function calls will be removed once all consumers
790 * have been moved over to the new explicit API.
792 static inline struct reset_control *of_reset_control_get(
793 struct device_node *node, const char *id)
795 return of_reset_control_get_exclusive(node, id);
798 static inline struct reset_control *of_reset_control_get_by_index(
799 struct device_node *node, int index)
801 return of_reset_control_get_exclusive_by_index(node, index);
804 static inline struct reset_control *devm_reset_control_get(
805 struct device *dev, const char *id)
807 return devm_reset_control_get_exclusive(dev, id);
810 static inline struct reset_control *devm_reset_control_get_optional(
811 struct device *dev, const char *id)
813 return devm_reset_control_get_optional_exclusive(dev, id);
817 static inline struct reset_control *devm_reset_control_get_by_index(
818 struct device *dev, int index)
820 return devm_reset_control_get_exclusive_by_index(dev, index);
824 * APIs to manage a list of reset controllers
826 static inline struct reset_control *
827 devm_reset_control_array_get_exclusive(struct device *dev)
829 return devm_reset_control_array_get(dev, false, false);
832 static inline struct reset_control *
833 devm_reset_control_array_get_shared(struct device *dev)
835 return devm_reset_control_array_get(dev, true, false);
838 static inline struct reset_control *
839 devm_reset_control_array_get_optional_exclusive(struct device *dev)
841 return devm_reset_control_array_get(dev, false, true);
844 static inline struct reset_control *
845 devm_reset_control_array_get_optional_shared(struct device *dev)
847 return devm_reset_control_array_get(dev, true, true);
850 static inline struct reset_control *
851 of_reset_control_array_get_exclusive(struct device_node *node)
853 return of_reset_control_array_get(node, false, false, true);
856 static inline struct reset_control *
857 of_reset_control_array_get_exclusive_released(struct device_node *node)
859 return of_reset_control_array_get(node, false, false, false);
862 static inline struct reset_control *
863 of_reset_control_array_get_shared(struct device_node *node)
865 return of_reset_control_array_get(node, true, false, true);
868 static inline struct reset_control *
869 of_reset_control_array_get_optional_exclusive(struct device_node *node)
871 return of_reset_control_array_get(node, false, true, true);
874 static inline struct reset_control *
875 of_reset_control_array_get_optional_shared(struct device_node *node)
877 return of_reset_control_array_get(node, true, true, true);