Lines Matching full:macro

394     for macro, val in idx_vals:
395 out_dt_define(macro, val)
430 for macro, val in idx_vals:
431 out_dt_define(macro, val)
432 for macro, val in name_vals:
433 out_dt_define(macro, val)
440 # macro magic in devicetree.h?
497 for macro, val in idx_vals:
498 out_dt_define(macro, val)
499 for macro, val in name_vals:
500 out_dt_define(macro, val)
504 # Writes a macro for each of the node's compatibles. We don't care
609 macro = f"{node.z_path_id}_GPIO_HOGS"
612 macro2val.update(controller_and_data_macros(entry, i, macro))
616 out_dt_define(f"{macro}_EXISTS", 1)
617 out_dt_define(f"{macro}_NUM", len(node.gpio_hogs))
618 for macro, val in macro2val.items():
619 out_dt_define(macro, val)
635 macro = f"{node.z_path_id}_P_{prop_id}"
639 macro2val[macro] = val
643 macro2val[macro + "_STRING_UNQUOTED"] = prop.val
645 macro2val[macro + "_STRING_TOKEN"] = prop.val_as_token
647 macro2val[macro + "_STRING_UPPER_TOKEN"] = prop.val_as_token.upper()
652 macro2val[macro + "_IDX_0"] = quote_str(prop.val)
653 macro2val[macro + "_IDX_0_EXISTS"] = 1
657 macro2val[macro + "_ENUM_IDX"] = prop.enum_index
664 macro2val[macro + f"_ENUM_VAL_{as_token}_EXISTS"] = 1
666 macro2val[macro + "_ENUM_TOKEN"] = as_token
670 macro2val[macro + "_ENUM_UPPER_TOKEN"] = as_token.upper()
673 macro2val[macro + f"_ENUM_VAL_{prop.val}_EXISTS"] = 1
676 macro2val.update(phandle_macros(prop, macro))
683 macro2val[macro + f"_IDX_{i}"] = quote_str(subval)
686 macro2val[macro + f"_IDX_{i}_STRING_UNQUOTED"] = subval
688 macro2val[macro + f"_IDX_{i}_STRING_TOKEN"] = subval_as_token
690 macro2val[macro + f"_IDX_{i}_STRING_UPPER_TOKEN"] = subval_as_token.upper()
692 macro2val[macro + f"_IDX_{i}"] = subval
693 macro2val[macro + f"_IDX_{i}_EXISTS"] = 1
698 macro2val[f"{macro}_FOREACH_PROP_ELEM(fn)"] = \
704 macro2val[f"{macro}_FOREACH_PROP_ELEM_SEP(fn, sep)"] = \
710 macro2val[f"{macro}_FOREACH_PROP_ELEM_VARGS(fn, ...)"] = \
716 macro2val[f"{macro}_FOREACH_PROP_ELEM_SEP_VARGS(fn, sep, ...)"] = \
722 macro2val[macro + "_LEN"] = plen
725 macro2val[f"{macro}_EXISTS"] = 1
729 for macro, val in macro2val.items():
730 out_dt_define(macro, val)
762 # Gets the macro value for property 'prop', if there is
787 # a _LEN macro for the property. Otherwise, returns None.
791 # make sure to update the doxygen string for that macro, and make
820 def phandle_macros(prop, macro): argument
823 # The 'macro' argument is the N_<node-id>_P_<prop-id> bit.
837 ret[f"{macro}"] = f"DT_{prop.val.z_path_id}"
838 ret[f"{macro}_IDX_0"] = f"DT_{prop.val.z_path_id}"
839 ret[f"{macro}_IDX_0_PH"] = f"DT_{prop.val.z_path_id}"
840 ret[f"{macro}_IDX_0_EXISTS"] = 1
843 ret[f"{macro}_IDX_{i}"] = f"DT_{node.z_path_id}"
844 ret[f"{macro}_IDX_{i}_PH"] = f"DT_{node.z_path_id}"
845 ret[f"{macro}_IDX_{i}_EXISTS"] = 1
852 ret[f"{macro}_IDX_{i}_EXISTS"] = 0
855 ret.update(controller_and_data_macros(entry, i, macro))
860 def controller_and_data_macros(entry, i, macro): argument
871 ret[f"{macro}_IDX_{i}_EXISTS"] = 1
873 ret[f"{macro}_IDX_{i}_PH"] = f"DT_{entry.controller.z_path_id}"
876 ret[f"{macro}_IDX_{i}_VAL_{str2ident(cell)}"] = val
877 ret[f"{macro}_IDX_{i}_VAL_{str2ident(cell)}_EXISTS"] = 1
884 ret[f"{macro}_IDX_{i}_EXISTS"] = 1
886 ret[f"{macro}_IDX_{i}_NAME"] = quote_str(entry.name)
888 ret[f"{macro}_NAME_{name}_PH"] = f"DT_{entry.controller.z_path_id}"
890 ret[f"{macro}_NAME_{name}_EXISTS"] = 1
894 ret[f"{macro}_NAME_{name}_VAL_{cell_ident}"] = \
895 f"DT_{macro}_IDX_{i}_VAL_{cell_ident}"
896 ret[f"{macro}_NAME_{name}_VAL_{cell_ident}_EXISTS"] = 1
910 for macro, value in chosen.items():
911 out_define(macro, value, width=max_len)
956 # conversion in the preprocessor helps to keep the macro
971 macro = f"COMPAT_{str2ident(compat)}_LABEL_{str2ident(label)}"
974 out_dt_define(macro, val)
975 out_dt_define(macro + "_EXISTS", 1)
983 for macro, value in n_okay_macros.items():
984 out_define(macro, value)
985 for macro, value in for_each_macros.items():
986 out_define(macro, value)
1006 def out_dt_define(macro, val, width=None, deprecation_msg=None): argument
1007 # Writes "#define DT_<macro> <val>" to the header file
1009 # The macro will be left-justified to 'width' characters if that
1012 # whitespace between 'macro' and 'val'.
1017 # Returns the full generated macro for 'macro', with leading "DT_".
1018 ret = "DT_" + macro
1023 def out_define(macro, val, width=None, deprecation_msg=None): argument
1024 # Helper for out_dt_define(). Outputs "#define <macro> <val>",
1031 s = f"#define {macro.ljust(width)}{warn} {val}"
1033 s = f"#define {macro}{warn} {val}"