Lines Matching refs:np

61 	struct device_node *np;  member
66 int of_n_addr_cells(const struct device_node *np) in of_n_addr_cells() argument
71 if (np->parent) in of_n_addr_cells()
72 np = np->parent; in of_n_addr_cells()
73 ip = of_get_property(np, "#address-cells", NULL); in of_n_addr_cells()
76 } while (np->parent); in of_n_addr_cells()
82 int of_n_size_cells(const struct device_node *np) in of_n_size_cells() argument
87 if (np->parent) in of_n_size_cells()
88 np = np->parent; in of_n_size_cells()
89 ip = of_get_property(np, "#size-cells", NULL); in of_n_size_cells()
92 } while (np->parent); in of_n_size_cells()
98 int of_simple_addr_cells(const struct device_node *np) in of_simple_addr_cells() argument
102 ip = of_get_property(np, "#address-cells", NULL); in of_simple_addr_cells()
110 int of_simple_size_cells(const struct device_node *np) in of_simple_size_cells() argument
114 ip = of_get_property(np, "#size-cells", NULL); in of_simple_size_cells()
122 struct property *of_find_property(const struct device_node *np, in of_find_property() argument
127 if (!np) in of_find_property()
130 for (pp = np->properties; pp; pp = pp->next) { in of_find_property()
145 struct device_node *np; in of_find_all_nodes() local
148 np = gd->of_root; in of_find_all_nodes()
150 np = prev->child; in of_find_all_nodes()
156 np = prev; in of_find_all_nodes()
157 while (np->parent && !np->sibling) in of_find_all_nodes()
158 np = np->parent; in of_find_all_nodes()
159 np = np->sibling; /* Might be null at the end of the tree */ in of_find_all_nodes()
162 return np; in of_find_all_nodes()
165 const void *of_get_property(const struct device_node *np, const char *name, in of_get_property() argument
168 struct property *pp = of_find_property(np, name, lenp); in of_get_property()
251 const struct device_node *np; in of_get_parent() local
256 np = of_node_get(node->parent); in of_get_parent()
258 return (struct device_node *)np; in of_get_parent()
313 struct device_node *np = NULL; in of_find_node_opts_by_path() local
339 np = of_find_node_by_path(pp->value); in of_find_node_opts_by_path()
343 if (!np) in of_find_node_opts_by_path()
349 if (!np) in of_find_node_opts_by_path()
350 np = of_node_get(gd->of_root); in of_find_node_opts_by_path()
351 while (np && *path == '/') { in of_find_node_opts_by_path()
352 struct device_node *tmp = np; in of_find_node_opts_by_path()
355 np = __of_find_node_by_path(np, path); in of_find_node_opts_by_path()
362 return np; in of_find_node_opts_by_path()
368 struct device_node *np; in of_find_compatible_node() local
370 for_each_of_allnodes_from(from, np) in of_find_compatible_node()
371 if (of_device_is_compatible(np, compatible, type, NULL) && in of_find_compatible_node()
372 of_node_get(np)) in of_find_compatible_node()
376 return np; in of_find_compatible_node()
394 struct device_node *np; in of_find_node_by_prop_value() local
396 for_each_of_allnodes_from(from, np) { in of_find_node_by_prop_value()
397 if (of_device_has_prop_value(np, propname, propval, proplen) && in of_find_node_by_prop_value()
398 of_node_get(np)) in of_find_node_by_prop_value()
403 return np; in of_find_node_by_prop_value()
408 struct device_node *np; in of_find_node_by_phandle() local
413 for_each_of_allnodes(np) in of_find_node_by_phandle()
414 if (np->phandle == handle) in of_find_node_by_phandle()
416 (void)of_node_get(np); in of_find_node_by_phandle()
418 return np; in of_find_node_by_phandle()
434 static void *of_find_property_value_of_size(const struct device_node *np, in of_find_property_value_of_size() argument
437 struct property *prop = of_find_property(np, propname, NULL); in of_find_property_value_of_size()
449 int of_read_u32(const struct device_node *np, const char *propname, u32 *outp) in of_read_u32() argument
454 if (!np) in of_read_u32()
456 val = of_find_property_value_of_size(np, propname, sizeof(*outp)); in of_read_u32()
468 int of_read_u32_array(const struct device_node *np, const char *propname, in of_read_u32_array() argument
474 val = of_find_property_value_of_size(np, propname, in of_read_u32_array()
487 int of_read_u64(const struct device_node *np, const char *propname, u64 *outp) in of_read_u64() argument
492 if (!np) in of_read_u64()
494 val = of_find_property_value_of_size(np, propname, sizeof(*outp)); in of_read_u64()
507 int of_property_match_string(const struct device_node *np, const char *propname, in of_property_match_string() argument
510 const struct property *prop = of_find_property(np, propname, NULL); in of_property_match_string()
545 int of_property_read_string_helper(const struct device_node *np, in of_property_read_string_helper() argument
549 const struct property *prop = of_find_property(np, propname, NULL); in of_property_read_string_helper()
571 static int __of_parse_phandle_with_args(const struct device_node *np, in __of_parse_phandle_with_args() argument
585 list = of_get_property(np, list_name, &size); in __of_parse_phandle_with_args()
614 np->full_name); in __of_parse_phandle_with_args()
622 np->full_name, cells_name, in __of_parse_phandle_with_args()
636 np->full_name); in __of_parse_phandle_with_args()
656 out_args->np = node; in __of_parse_phandle_with_args()
688 struct device_node *of_parse_phandle(const struct device_node *np, in of_parse_phandle() argument
696 if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0, index, in of_parse_phandle()
700 return args.np; in of_parse_phandle()
703 int of_parse_phandle_with_args(const struct device_node *np, in of_parse_phandle_with_args() argument
710 return __of_parse_phandle_with_args(np, list_name, cells_name, 0, in of_parse_phandle_with_args()
714 int of_count_phandle_with_args(const struct device_node *np, in of_count_phandle_with_args() argument
717 return __of_parse_phandle_with_args(np, list_name, cells_name, 0, in of_count_phandle_with_args()
721 static void of_alias_add(struct alias_prop *ap, struct device_node *np, in of_alias_add() argument
724 ap->np = np; in of_alias_add()
730 ap->alias, ap->stem, ap->id, of_node_full_name(np)); in of_alias_add()
757 struct device_node *np; in of_alias_scan() local
768 np = of_find_node_by_path(pp->value); in of_alias_scan()
769 if (!np) in of_alias_scan()
789 of_alias_add(ap, np, id, start, len); in of_alias_scan()
795 int of_alias_get_id(const struct device_node *np, const char *stem) in of_alias_get_id() argument
805 if (np == app->np) { in of_alias_get_id()