@@ -28,28 +28,43 @@ struct reset_control_bulk_data {
2828#define RESET_CONTROL_FLAGS_BIT_SHARED BIT(0) /* not exclusive */
2929#define RESET_CONTROL_FLAGS_BIT_OPTIONAL BIT(1)
3030#define RESET_CONTROL_FLAGS_BIT_ACQUIRED BIT(2) /* iff exclusive, not released */
31+ #define RESET_CONTROL_FLAGS_BIT_DEASSERTED BIT(3)
3132
3233/**
3334 * enum reset_control_flags - Flags that can be passed to the reset_control_get functions
3435 * to determine the type of reset control.
3536 * These values cannot be OR'd.
3637 *
3738 * @RESET_CONTROL_EXCLUSIVE: exclusive, acquired,
39+ * @RESET_CONTROL_EXCLUSIVE_DEASSERTED: exclusive, acquired, deasserted
3840 * @RESET_CONTROL_EXCLUSIVE_RELEASED: exclusive, released,
3941 * @RESET_CONTROL_SHARED: shared
42+ * @RESET_CONTROL_SHARED_DEASSERTED: shared, deasserted
4043 * @RESET_CONTROL_OPTIONAL_EXCLUSIVE: optional, exclusive, acquired
44+ * @RESET_CONTROL_OPTIONAL_EXCLUSIVE_DEASSERTED: optional, exclusive, acquired, deasserted
4145 * @RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED: optional, exclusive, released
4246 * @RESET_CONTROL_OPTIONAL_SHARED: optional, shared
47+ * @RESET_CONTROL_OPTIONAL_SHARED_DEASSERTED: optional, shared, deasserted
4348 */
4449enum reset_control_flags {
4550 RESET_CONTROL_EXCLUSIVE = RESET_CONTROL_FLAGS_BIT_ACQUIRED ,
51+ RESET_CONTROL_EXCLUSIVE_DEASSERTED = RESET_CONTROL_FLAGS_BIT_ACQUIRED |
52+ RESET_CONTROL_FLAGS_BIT_DEASSERTED ,
4653 RESET_CONTROL_EXCLUSIVE_RELEASED = 0 ,
4754 RESET_CONTROL_SHARED = RESET_CONTROL_FLAGS_BIT_SHARED ,
55+ RESET_CONTROL_SHARED_DEASSERTED = RESET_CONTROL_FLAGS_BIT_SHARED |
56+ RESET_CONTROL_FLAGS_BIT_DEASSERTED ,
4857 RESET_CONTROL_OPTIONAL_EXCLUSIVE = RESET_CONTROL_FLAGS_BIT_OPTIONAL |
4958 RESET_CONTROL_FLAGS_BIT_ACQUIRED ,
59+ RESET_CONTROL_OPTIONAL_EXCLUSIVE_DEASSERTED = RESET_CONTROL_FLAGS_BIT_OPTIONAL |
60+ RESET_CONTROL_FLAGS_BIT_ACQUIRED |
61+ RESET_CONTROL_FLAGS_BIT_DEASSERTED ,
5062 RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED = RESET_CONTROL_FLAGS_BIT_OPTIONAL ,
5163 RESET_CONTROL_OPTIONAL_SHARED = RESET_CONTROL_FLAGS_BIT_OPTIONAL |
5264 RESET_CONTROL_FLAGS_BIT_SHARED ,
65+ RESET_CONTROL_OPTIONAL_SHARED_DEASSERTED = RESET_CONTROL_FLAGS_BIT_OPTIONAL |
66+ RESET_CONTROL_FLAGS_BIT_SHARED |
67+ RESET_CONTROL_FLAGS_BIT_DEASSERTED ,
5368};
5469
5570#ifdef CONFIG_RESET_CONTROLLER
@@ -596,6 +611,25 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
596611 return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_EXCLUSIVE );
597612}
598613
614+ /**
615+ * devm_reset_control_get_exclusive_deasserted - resource managed
616+ * reset_control_get_exclusive() +
617+ * reset_control_deassert()
618+ * @dev: device to be reset by the controller
619+ * @id: reset line name
620+ *
621+ * Managed reset_control_get_exclusive() + reset_control_deassert(). For reset
622+ * controllers returned from this function, reset_control_assert() +
623+ * reset_control_put() is called automatically on driver detach.
624+ *
625+ * See reset_control_get_exclusive() for more information.
626+ */
627+ static inline struct reset_control * __must_check
628+ devm_reset_control_get_exclusive_deasserted (struct device * dev , const char * id )
629+ {
630+ return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_EXCLUSIVE_DEASSERTED );
631+ }
632+
599633/**
600634 * devm_reset_control_bulk_get_exclusive - resource managed
601635 * reset_control_bulk_get_exclusive()
@@ -712,6 +746,25 @@ static inline struct reset_control *devm_reset_control_get_shared(
712746 return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_SHARED );
713747}
714748
749+ /**
750+ * devm_reset_control_get_shared_deasserted - resource managed
751+ * reset_control_get_shared() +
752+ * reset_control_deassert()
753+ * @dev: device to be reset by the controller
754+ * @id: reset line name
755+ *
756+ * Managed reset_control_get_shared() + reset_control_deassert(). For reset
757+ * controllers returned from this function, reset_control_assert() +
758+ * reset_control_put() is called automatically on driver detach.
759+ *
760+ * See devm_reset_control_get_shared() for more information.
761+ */
762+ static inline struct reset_control * __must_check
763+ devm_reset_control_get_shared_deasserted (struct device * dev , const char * id )
764+ {
765+ return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_SHARED_DEASSERTED );
766+ }
767+
715768/**
716769 * devm_reset_control_bulk_get_shared - resource managed
717770 * reset_control_bulk_get_shared()
@@ -732,6 +785,28 @@ devm_reset_control_bulk_get_shared(struct device *dev, int num_rstcs,
732785 return __devm_reset_control_bulk_get (dev , num_rstcs , rstcs , RESET_CONTROL_SHARED );
733786}
734787
788+ /**
789+ * devm_reset_control_bulk_get_shared_deasserted - resource managed
790+ * reset_control_bulk_get_shared() +
791+ * reset_control_bulk_deassert()
792+ * @dev: device to be reset by the controller
793+ * @num_rstcs: number of entries in rstcs array
794+ * @rstcs: array of struct reset_control_bulk_data with reset line names set
795+ *
796+ * Managed reset_control_bulk_get_shared() + reset_control_bulk_deassert(). For
797+ * reset controllers returned from this function, reset_control_bulk_assert() +
798+ * reset_control_bulk_put() are called automatically on driver detach.
799+ *
800+ * See devm_reset_control_bulk_get_shared() for more information.
801+ */
802+ static inline int __must_check
803+ devm_reset_control_bulk_get_shared_deasserted (struct device * dev , int num_rstcs ,
804+ struct reset_control_bulk_data * rstcs )
805+ {
806+ return __devm_reset_control_bulk_get (dev , num_rstcs , rstcs ,
807+ RESET_CONTROL_SHARED_DEASSERTED );
808+ }
809+
735810/**
736811 * devm_reset_control_get_optional_exclusive - resource managed
737812 * reset_control_get_optional_exclusive()
@@ -750,6 +825,25 @@ static inline struct reset_control *devm_reset_control_get_optional_exclusive(
750825 return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_OPTIONAL_EXCLUSIVE );
751826}
752827
828+ /**
829+ * devm_reset_control_get_optional_exclusive_deasserted - resource managed
830+ * reset_control_get_optional_exclusive() +
831+ * reset_control_deassert()
832+ * @dev: device to be reset by the controller
833+ * @id: reset line name
834+ *
835+ * Managed reset_control_get_optional_exclusive() + reset_control_deassert().
836+ * For reset controllers returned from this function, reset_control_assert() +
837+ * reset_control_put() is called automatically on driver detach.
838+ *
839+ * See devm_reset_control_get_optional_exclusive() for more information.
840+ */
841+ static inline struct reset_control *
842+ devm_reset_control_get_optional_exclusive_deasserted (struct device * dev , const char * id )
843+ {
844+ return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_OPTIONAL_EXCLUSIVE_DEASSERTED );
845+ }
846+
753847/**
754848 * devm_reset_control_bulk_get_optional_exclusive - resource managed
755849 * reset_control_bulk_get_optional_exclusive()
@@ -789,6 +883,25 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
789883 return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_OPTIONAL_SHARED );
790884}
791885
886+ /**
887+ * devm_reset_control_get_optional_shared_deasserted - resource managed
888+ * reset_control_get_optional_shared() +
889+ * reset_control_deassert()
890+ * @dev: device to be reset by the controller
891+ * @id: reset line name
892+ *
893+ * Managed reset_control_get_optional_shared() + reset_control_deassert(). For
894+ * reset controllers returned from this function, reset_control_assert() +
895+ * reset_control_put() is called automatically on driver detach.
896+ *
897+ * See devm_reset_control_get_optional_shared() for more information.
898+ */
899+ static inline struct reset_control *
900+ devm_reset_control_get_optional_shared_deasserted (struct device * dev , const char * id )
901+ {
902+ return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_OPTIONAL_SHARED_DEASSERTED );
903+ }
904+
792905/**
793906 * devm_reset_control_bulk_get_optional_shared - resource managed
794907 * reset_control_bulk_get_optional_shared()
0 commit comments