@@ -738,7 +738,7 @@ def dt_compat_enabled(kconf, _, compat):
738738
739739def dt_compat_on_bus (kconf , _ , compat , bus ):
740740 """
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
742742 compatible node in the EDT which is on bus 'bus'. It returns "n" otherwise.
743743 """
744744 if doc_mode or edt is None :
@@ -751,10 +751,13 @@ def dt_compat_on_bus(kconf, _, compat, bus):
751751
752752 return "n"
753753
754- def dt_compat_any_has_prop (kconf , _ , compat , prop ):
754+ def dt_compat_any_has_prop (kconf , _ , compat , prop , value = None ):
755755 """
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'.
758761 It returns "n" otherwise.
759762 """
760763 if doc_mode or edt is None :
@@ -763,8 +766,10 @@ def dt_compat_any_has_prop(kconf, _, compat, prop):
763766 if compat in edt .compat2okay :
764767 for node in edt .compat2okay [compat ]:
765768 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"
768773 return "n"
769774
770775def dt_nodelabel_has_compat (kconf , _ , label , compat ):
@@ -805,7 +810,7 @@ def dt_node_has_compat(kconf, _, path, compat):
805810
806811def dt_nodelabel_enabled_with_compat (kconf , _ , label , compat ):
807812 """
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
809814 such label can be found in the EDT and that node is compatible with the
810815 provided 'compat', otherwise it returns "n".
811816 """
@@ -1000,7 +1005,7 @@ def inc_dec(kconf, name, *args):
10001005 "dt_has_compat" : (dt_has_compat , 1 , 1 ),
10011006 "dt_compat_enabled" : (dt_compat_enabled , 1 , 1 ),
10021007 "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 ),
10041009 "dt_chosen_label" : (dt_chosen_label , 1 , 1 ),
10051010 "dt_chosen_enabled" : (dt_chosen_enabled , 1 , 1 ),
10061011 "dt_chosen_path" : (dt_chosen_path , 1 , 1 ),
0 commit comments