@@ -28,28 +28,43 @@ struct reset_control_bulk_data {
28
28
#define RESET_CONTROL_FLAGS_BIT_SHARED BIT(0) /* not exclusive */
29
29
#define RESET_CONTROL_FLAGS_BIT_OPTIONAL BIT(1)
30
30
#define RESET_CONTROL_FLAGS_BIT_ACQUIRED BIT(2) /* iff exclusive, not released */
31
+ #define RESET_CONTROL_FLAGS_BIT_DEASSERTED BIT(3)
31
32
32
33
/**
33
34
* enum reset_control_flags - Flags that can be passed to the reset_control_get functions
34
35
* to determine the type of reset control.
35
36
* These values cannot be OR'd.
36
37
*
37
38
* @RESET_CONTROL_EXCLUSIVE: exclusive, acquired,
39
+ * @RESET_CONTROL_EXCLUSIVE_DEASSERTED: exclusive, acquired, deasserted
38
40
* @RESET_CONTROL_EXCLUSIVE_RELEASED: exclusive, released,
39
41
* @RESET_CONTROL_SHARED: shared
42
+ * @RESET_CONTROL_SHARED_DEASSERTED: shared, deasserted
40
43
* @RESET_CONTROL_OPTIONAL_EXCLUSIVE: optional, exclusive, acquired
44
+ * @RESET_CONTROL_OPTIONAL_EXCLUSIVE_DEASSERTED: optional, exclusive, acquired, deasserted
41
45
* @RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED: optional, exclusive, released
42
46
* @RESET_CONTROL_OPTIONAL_SHARED: optional, shared
47
+ * @RESET_CONTROL_OPTIONAL_SHARED_DEASSERTED: optional, shared, deasserted
43
48
*/
44
49
enum reset_control_flags {
45
50
RESET_CONTROL_EXCLUSIVE = RESET_CONTROL_FLAGS_BIT_ACQUIRED ,
51
+ RESET_CONTROL_EXCLUSIVE_DEASSERTED = RESET_CONTROL_FLAGS_BIT_ACQUIRED |
52
+ RESET_CONTROL_FLAGS_BIT_DEASSERTED ,
46
53
RESET_CONTROL_EXCLUSIVE_RELEASED = 0 ,
47
54
RESET_CONTROL_SHARED = RESET_CONTROL_FLAGS_BIT_SHARED ,
55
+ RESET_CONTROL_SHARED_DEASSERTED = RESET_CONTROL_FLAGS_BIT_SHARED |
56
+ RESET_CONTROL_FLAGS_BIT_DEASSERTED ,
48
57
RESET_CONTROL_OPTIONAL_EXCLUSIVE = RESET_CONTROL_FLAGS_BIT_OPTIONAL |
49
58
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 ,
50
62
RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED = RESET_CONTROL_FLAGS_BIT_OPTIONAL ,
51
63
RESET_CONTROL_OPTIONAL_SHARED = RESET_CONTROL_FLAGS_BIT_OPTIONAL |
52
64
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 ,
53
68
};
54
69
55
70
#ifdef CONFIG_RESET_CONTROLLER
@@ -596,6 +611,25 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
596
611
return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_EXCLUSIVE );
597
612
}
598
613
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
+
599
633
/**
600
634
* devm_reset_control_bulk_get_exclusive - resource managed
601
635
* reset_control_bulk_get_exclusive()
@@ -712,6 +746,25 @@ static inline struct reset_control *devm_reset_control_get_shared(
712
746
return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_SHARED );
713
747
}
714
748
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
+
715
768
/**
716
769
* devm_reset_control_bulk_get_shared - resource managed
717
770
* reset_control_bulk_get_shared()
@@ -732,6 +785,28 @@ devm_reset_control_bulk_get_shared(struct device *dev, int num_rstcs,
732
785
return __devm_reset_control_bulk_get (dev , num_rstcs , rstcs , RESET_CONTROL_SHARED );
733
786
}
734
787
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
+
735
810
/**
736
811
* devm_reset_control_get_optional_exclusive - resource managed
737
812
* reset_control_get_optional_exclusive()
@@ -750,6 +825,25 @@ static inline struct reset_control *devm_reset_control_get_optional_exclusive(
750
825
return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_OPTIONAL_EXCLUSIVE );
751
826
}
752
827
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
+
753
847
/**
754
848
* devm_reset_control_bulk_get_optional_exclusive - resource managed
755
849
* reset_control_bulk_get_optional_exclusive()
@@ -789,6 +883,25 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
789
883
return __devm_reset_control_get (dev , id , 0 , RESET_CONTROL_OPTIONAL_SHARED );
790
884
}
791
885
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
+
792
905
/**
793
906
* devm_reset_control_bulk_get_optional_shared - resource managed
794
907
* reset_control_bulk_get_optional_shared()
0 commit comments