Lines Matching refs:np

62 	struct device_node *np;  member
67 int of_n_addr_cells(const struct device_node *np) in of_n_addr_cells() argument
72 if (np->parent) in of_n_addr_cells()
73 np = np->parent; in of_n_addr_cells()
74 ip = of_get_property(np, "#address-cells", NULL); in of_n_addr_cells()
77 } while (np->parent); in of_n_addr_cells()
83 int of_n_size_cells(const struct device_node *np) in of_n_size_cells() argument
88 if (np->parent) in of_n_size_cells()
89 np = np->parent; in of_n_size_cells()
90 ip = of_get_property(np, "#size-cells", NULL); in of_n_size_cells()
93 } while (np->parent); in of_n_size_cells()
99 int of_simple_addr_cells(const struct device_node *np) in of_simple_addr_cells() argument
103 ip = of_get_property(np, "#address-cells", NULL); in of_simple_addr_cells()
111 int of_simple_size_cells(const struct device_node *np) in of_simple_size_cells() argument
115 ip = of_get_property(np, "#size-cells", NULL); in of_simple_size_cells()
123 struct property *of_find_property(const struct device_node *np, in of_find_property() argument
128 if (!np) in of_find_property()
131 for (pp = np->properties; pp; pp = pp->next) { in of_find_property()
146 struct device_node *np; in of_find_all_nodes() local
149 np = gd->of_root; in of_find_all_nodes()
151 np = prev->child; in of_find_all_nodes()
157 np = prev; in of_find_all_nodes()
158 while (np->parent && !np->sibling) in of_find_all_nodes()
159 np = np->parent; in of_find_all_nodes()
160 np = np->sibling; /* Might be null at the end of the tree */ in of_find_all_nodes()
163 return np; in of_find_all_nodes()
166 const void *of_get_property(const struct device_node *np, const char *name, in of_get_property() argument
169 struct property *pp = of_find_property(np, name, lenp); in of_get_property()
174 const struct property *of_get_first_property(const struct device_node *np) in of_get_first_property() argument
176 if (!np) in of_get_first_property()
179 return np->properties; in of_get_first_property()
182 const struct property *of_get_next_property(const struct device_node *np, in of_get_next_property() argument
185 if (!np) in of_get_next_property()
191 const void *of_get_property_by_prop(const struct device_node *np, in of_get_property_by_prop() argument
196 if (!np || !property) in of_get_property_by_prop()
284 const struct device_node *np; in of_get_parent() local
289 np = of_node_get(node->parent); in of_get_parent()
291 return (struct device_node *)np; in of_get_parent()
346 struct device_node *np = NULL; in of_find_node_opts_by_path() local
372 np = of_find_node_by_path(pp->value); in of_find_node_opts_by_path()
376 if (!np) in of_find_node_opts_by_path()
382 if (!np) in of_find_node_opts_by_path()
383 np = of_node_get(gd->of_root); in of_find_node_opts_by_path()
384 while (np && *path == '/') { in of_find_node_opts_by_path()
385 struct device_node *tmp = np; in of_find_node_opts_by_path()
388 np = __of_find_node_by_path(np, path); in of_find_node_opts_by_path()
395 return np; in of_find_node_opts_by_path()
401 struct device_node *np; in of_find_compatible_node() local
403 for_each_of_allnodes_from(from, np) in of_find_compatible_node()
404 if (of_device_is_compatible(np, compatible, type, NULL) && in of_find_compatible_node()
405 of_node_get(np)) in of_find_compatible_node()
409 return np; in of_find_compatible_node()
414 struct device_node *np; in of_find_node_by_phandle() local
419 for_each_of_allnodes(np) in of_find_node_by_phandle()
420 if (np->phandle == handle) in of_find_node_by_phandle()
425 if (!np) { in of_find_node_by_phandle()
426 for (np = gd->of_root_f; np; np = of_find_all_nodes(np)) { in of_find_node_by_phandle()
427 if (np->phandle == handle) in of_find_node_by_phandle()
432 (void)of_node_get(np); in of_find_node_by_phandle()
434 return np; in of_find_node_by_phandle()
450 static void *of_find_property_value_of_size(const struct device_node *np, in of_find_property_value_of_size() argument
453 struct property *prop = of_find_property(np, propname, NULL); in of_find_property_value_of_size()
465 int of_read_u32(const struct device_node *np, const char *propname, u32 *outp) in of_read_u32() argument
470 if (!np) in of_read_u32()
472 val = of_find_property_value_of_size(np, propname, sizeof(*outp)); in of_read_u32()
497 int of_property_read_u64(const struct device_node *np, const char *propname, in of_property_read_u64() argument
500 const __be32 *val = of_find_property_value_of_size(np, propname, in of_property_read_u64()
511 int of_read_u32_array(const struct device_node *np, const char *propname, in of_read_u32_array() argument
517 val = of_find_property_value_of_size(np, propname, in of_read_u32_array()
530 int of_write_u32_array(const struct device_node *np, const char *propname, in of_write_u32_array() argument
536 val = of_find_property_value_of_size(np, propname, in of_write_u32_array()
549 int of_property_match_string(const struct device_node *np, const char *propname, in of_property_match_string() argument
552 const struct property *prop = of_find_property(np, propname, NULL); in of_property_match_string()
587 int of_property_read_string_helper(const struct device_node *np, in of_property_read_string_helper() argument
591 const struct property *prop = of_find_property(np, propname, NULL); in of_property_read_string_helper()
613 static int __of_parse_phandle_with_args(const struct device_node *np, in __of_parse_phandle_with_args() argument
627 list = of_get_property(np, list_name, &size); in __of_parse_phandle_with_args()
656 np->full_name); in __of_parse_phandle_with_args()
664 np->full_name, cells_name, in __of_parse_phandle_with_args()
678 np->full_name); in __of_parse_phandle_with_args()
698 out_args->np = node; in __of_parse_phandle_with_args()
730 struct device_node *of_parse_phandle(const struct device_node *np, in of_parse_phandle() argument
738 if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0, index, in of_parse_phandle()
742 return args.np; in of_parse_phandle()
745 int of_parse_phandle_with_args(const struct device_node *np, in of_parse_phandle_with_args() argument
752 return __of_parse_phandle_with_args(np, list_name, cells_name, 0, in of_parse_phandle_with_args()
756 int of_count_phandle_with_args(const struct device_node *np, in of_count_phandle_with_args() argument
759 return __of_parse_phandle_with_args(np, list_name, cells_name, 0, in of_count_phandle_with_args()
763 static void of_alias_add(struct alias_prop *ap, struct device_node *np, in of_alias_add() argument
767 ap->np = np; in of_alias_add()
788 ap->alias, ap->stem, ap->id, of_node_full_name(np)); in of_alias_add()
815 struct device_node *np; in of_alias_scan() local
826 np = of_find_node_by_path(pp->value); in of_alias_scan()
827 if (!np) in of_alias_scan()
847 of_alias_add(ap, np, id, start, len); in of_alias_scan()
853 int of_alias_get_id(const struct device_node *np, const char *stem) in of_alias_get_id() argument
863 if (np == app->np) { in of_alias_get_id()
876 struct device_node *np = NULL; in of_alias_get_dev() local
884 np = app->np; in of_alias_get_dev()
890 return np; in of_alias_get_dev()
896 struct device_node *np = NULL; in of_alias_dump() local
902 app->np->full_name, app->np->phandle, in of_alias_dump()
903 of_get_property(app->np, "u-boot,dm-pre-reloc", NULL) || in of_alias_dump()
904 of_get_property(app->np, "u-boot,dm-spl", NULL) ? "*" : ""); in of_alias_dump()
908 return np; in of_alias_dump()