@@ -738,7 +738,7 @@ def dt_compat_enabled(kconf, _, compat):
738
738
739
739
def dt_compat_on_bus (kconf , _ , compat , bus ):
740
740
"""
741
- This function takes a 'compat' and returns "y" if we find an " enabled"
741
+ This function takes a 'compat' and returns "y" if we find an enabled
742
742
compatible node in the EDT which is on bus 'bus'. It returns "n" otherwise.
743
743
"""
744
744
if doc_mode or edt is None :
@@ -751,10 +751,13 @@ def dt_compat_on_bus(kconf, _, compat, bus):
751
751
752
752
return "n"
753
753
754
- def dt_compat_any_has_prop (kconf , _ , compat , prop ):
754
+ def dt_compat_any_has_prop (kconf , _ , compat , prop , value = None ):
755
755
"""
756
- This function takes a 'compat' and a 'prop' and returns "y" if any
757
- node with compatible 'compat' also has a valid property 'prop'.
756
+ This function takes a 'compat', a 'prop', and a 'value'.
757
+ If value=None, the function returns "y" if any
758
+ enabled node with compatible 'compat' also has a valid property 'prop'.
759
+ If value is given, the function returns "y" if any enabled node with compatible 'compat'
760
+ also has a valid property 'prop' with value 'value'.
758
761
It returns "n" otherwise.
759
762
"""
760
763
if doc_mode or edt is None :
@@ -763,8 +766,10 @@ def dt_compat_any_has_prop(kconf, _, compat, prop):
763
766
if compat in edt .compat2okay :
764
767
for node in edt .compat2okay [compat ]:
765
768
if prop in node .props :
766
- return "y"
767
-
769
+ if value is None :
770
+ return "y"
771
+ elif str (node .props [prop ].val ) == value :
772
+ return "y"
768
773
return "n"
769
774
770
775
def dt_nodelabel_has_compat (kconf , _ , label , compat ):
@@ -805,7 +810,7 @@ def dt_node_has_compat(kconf, _, path, compat):
805
810
806
811
def dt_nodelabel_enabled_with_compat (kconf , _ , label , compat ):
807
812
"""
808
- This function takes a 'label' and returns "y" if an " enabled" node with
813
+ This function takes a 'label' and returns "y" if an enabled node with
809
814
such label can be found in the EDT and that node is compatible with the
810
815
provided 'compat', otherwise it returns "n".
811
816
"""
@@ -1000,7 +1005,7 @@ def inc_dec(kconf, name, *args):
1000
1005
"dt_has_compat" : (dt_has_compat , 1 , 1 ),
1001
1006
"dt_compat_enabled" : (dt_compat_enabled , 1 , 1 ),
1002
1007
"dt_compat_on_bus" : (dt_compat_on_bus , 2 , 2 ),
1003
- "dt_compat_any_has_prop" : (dt_compat_any_has_prop , 2 , 2 ),
1008
+ "dt_compat_any_has_prop" : (dt_compat_any_has_prop , 2 , 3 ),
1004
1009
"dt_chosen_label" : (dt_chosen_label , 1 , 1 ),
1005
1010
"dt_chosen_enabled" : (dt_chosen_enabled , 1 , 1 ),
1006
1011
"dt_chosen_path" : (dt_chosen_path , 1 , 1 ),
0 commit comments