Lines Matching refs:dev
19 static inline const struct device_node *dev_np(struct udevice *dev) in dev_np() argument
21 return ofnode_to_np(dev->node); in dev_np()
24 static inline const struct device_node *dev_np(struct udevice *dev) in dev_np() argument
36 static inline ofnode dev_ofnode(struct udevice *dev) in dev_ofnode() argument
38 return dev->node; in dev_ofnode()
41 static inline bool dev_of_valid(struct udevice *dev) in dev_of_valid() argument
43 return ofnode_valid(dev_ofnode(dev)); in dev_of_valid()
55 int dev_read_u32(struct udevice *dev, const char *propname, u32 *outp);
65 int dev_read_u32_default(struct udevice *dev, const char *propname, int def);
74 const char *dev_read_string(struct udevice *dev, const char *propname);
83 bool dev_read_bool(struct udevice *dev, const char *propname);
93 ofnode dev_read_subnode(struct udevice *dev, const char *subbnode_name);
102 int dev_read_size(struct udevice *dev, const char *propname);
113 fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);
125 void *dev_remap_addr_index(struct udevice *dev, int index);
134 fdt_addr_t dev_read_addr(struct udevice *dev);
144 void *dev_read_addr_ptr(struct udevice *dev);
154 void *dev_remap_addr(struct udevice *dev);
167 fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *propname,
176 const char *dev_read_name(struct udevice *dev);
196 int dev_read_stringlist_search(struct udevice *dev, const char *property,
210 int dev_read_string_index(struct udevice *dev, const char *propname, int index,
221 int dev_read_string_count(struct udevice *dev, const char *propname);
260 int dev_read_phandle_with_args(struct udevice *dev, const char *list_name,
280 int dev_count_phandle_with_args(struct udevice *dev, const char *list_name,
292 int dev_read_addr_cells(struct udevice *dev);
303 int dev_read_size_cells(struct udevice *dev);
313 int dev_read_simple_addr_cells(struct udevice *dev);
323 int dev_read_simple_size_cells(struct udevice *dev);
331 int dev_read_phandle(struct udevice *dev);
341 const void *dev_read_prop(struct udevice *dev, const char *propname, int *lenp);
354 int dev_read_alias_seq(struct udevice *dev, int *devnump);
372 int dev_read_u32_array(struct udevice *dev, const char *propname,
382 ofnode dev_read_first_subnode(struct udevice *dev);
407 const uint8_t *dev_read_u8_array_ptr(struct udevice *dev, const char *propname,
421 int dev_read_enabled(struct udevice *dev);
431 int dev_read_resource(struct udevice *dev, uint index, struct resource *res);
441 int dev_read_resource_byname(struct udevice *dev, const char *name,
455 u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr);
458 static inline int dev_read_u32(struct udevice *dev, in dev_read_u32() argument
461 return ofnode_read_u32(dev_ofnode(dev), propname, outp); in dev_read_u32()
464 static inline int dev_read_u32_default(struct udevice *dev, in dev_read_u32_default() argument
467 return ofnode_read_u32_default(dev_ofnode(dev), propname, def); in dev_read_u32_default()
470 static inline const char *dev_read_string(struct udevice *dev, in dev_read_string() argument
473 return ofnode_read_string(dev_ofnode(dev), propname); in dev_read_string()
476 static inline bool dev_read_bool(struct udevice *dev, const char *propname) in dev_read_bool() argument
478 return ofnode_read_bool(dev_ofnode(dev), propname); in dev_read_bool()
481 static inline ofnode dev_read_subnode(struct udevice *dev, in dev_read_subnode() argument
484 return ofnode_find_subnode(dev_ofnode(dev), subbnode_name); in dev_read_subnode()
487 static inline int dev_read_size(struct udevice *dev, const char *propname) in dev_read_size() argument
489 return ofnode_read_size(dev_ofnode(dev), propname); in dev_read_size()
492 static inline fdt_addr_t dev_read_addr_index(struct udevice *dev, int index) in dev_read_addr_index() argument
494 return devfdt_get_addr_index(dev, index); in dev_read_addr_index()
497 static inline fdt_addr_t dev_read_addr(struct udevice *dev) in dev_read_addr() argument
499 return devfdt_get_addr(dev); in dev_read_addr()
502 static inline void *dev_read_addr_ptr(struct udevice *dev) in dev_read_addr_ptr() argument
504 return devfdt_get_addr_ptr(dev); in dev_read_addr_ptr()
507 static inline void *dev_remap_addr(struct udevice *dev) in dev_remap_addr() argument
509 return devfdt_remap_addr(dev); in dev_remap_addr()
512 static inline void *dev_remap_addr_index(struct udevice *dev, int index) in dev_remap_addr_index() argument
514 return devfdt_remap_addr_index(dev, index); in dev_remap_addr_index()
517 static inline fdt_addr_t dev_read_addr_size(struct udevice *dev, in dev_read_addr_size() argument
521 return ofnode_get_addr_size(dev_ofnode(dev), propname, sizep); in dev_read_addr_size()
524 static inline const char *dev_read_name(struct udevice *dev) in dev_read_name() argument
526 return ofnode_get_name(dev_ofnode(dev)); in dev_read_name()
529 static inline int dev_read_stringlist_search(struct udevice *dev, in dev_read_stringlist_search() argument
533 return ofnode_stringlist_search(dev_ofnode(dev), propname, string); in dev_read_stringlist_search()
536 static inline int dev_read_string_index(struct udevice *dev, in dev_read_string_index() argument
540 return ofnode_read_string_index(dev_ofnode(dev), propname, index, outp); in dev_read_string_index()
543 static inline int dev_read_string_count(struct udevice *dev, in dev_read_string_count() argument
546 return ofnode_read_string_count(dev_ofnode(dev), propname); in dev_read_string_count()
549 static inline int dev_read_phandle_with_args(struct udevice *dev, in dev_read_phandle_with_args() argument
553 return ofnode_parse_phandle_with_args(dev_ofnode(dev), list_name, in dev_read_phandle_with_args()
558 static inline int dev_count_phandle_with_args(struct udevice *dev, in dev_count_phandle_with_args() argument
561 return ofnode_count_phandle_with_args(dev_ofnode(dev), list_name, in dev_count_phandle_with_args()
565 static inline int dev_read_addr_cells(struct udevice *dev) in dev_read_addr_cells() argument
568 return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_addr_cells()
571 static inline int dev_read_size_cells(struct udevice *dev) in dev_read_size_cells() argument
574 return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_size_cells()
577 static inline int dev_read_simple_addr_cells(struct udevice *dev) in dev_read_simple_addr_cells() argument
579 return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_simple_addr_cells()
582 static inline int dev_read_simple_size_cells(struct udevice *dev) in dev_read_simple_size_cells() argument
584 return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_simple_size_cells()
587 static inline int dev_read_phandle(struct udevice *dev) in dev_read_phandle() argument
589 return fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev)); in dev_read_phandle()
592 static inline const void *dev_read_prop(struct udevice *dev, in dev_read_prop() argument
595 return ofnode_get_property(dev_ofnode(dev), propname, lenp); in dev_read_prop()
598 static inline int dev_read_alias_seq(struct udevice *dev, int *devnump) in dev_read_alias_seq() argument
600 return fdtdec_get_alias_seq(gd->fdt_blob, dev->uclass->uc_drv->name, in dev_read_alias_seq()
601 dev_of_offset(dev), devnump); in dev_read_alias_seq()
604 static inline int dev_read_u32_array(struct udevice *dev, const char *propname, in dev_read_u32_array() argument
607 return ofnode_read_u32_array(dev_ofnode(dev), propname, out_values, sz); in dev_read_u32_array()
610 static inline ofnode dev_read_first_subnode(struct udevice *dev) in dev_read_first_subnode() argument
612 return ofnode_first_subnode(dev_ofnode(dev)); in dev_read_first_subnode()
620 static inline const uint8_t *dev_read_u8_array_ptr(struct udevice *dev, in dev_read_u8_array_ptr() argument
623 return ofnode_read_u8_array_ptr(dev_ofnode(dev), propname, sz); in dev_read_u8_array_ptr()
626 static inline int dev_read_enabled(struct udevice *dev) in dev_read_enabled() argument
628 return fdtdec_get_is_enabled(gd->fdt_blob, dev_of_offset(dev)); in dev_read_enabled()
631 static inline int dev_read_resource(struct udevice *dev, uint index, in dev_read_resource() argument
634 return ofnode_read_resource(dev_ofnode(dev), index, res); in dev_read_resource()
637 static inline int dev_read_resource_byname(struct udevice *dev, in dev_read_resource_byname() argument
641 return ofnode_read_resource_byname(dev_ofnode(dev), name, res); in dev_read_resource_byname()
644 static inline u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr) in dev_translate_address() argument
646 return ofnode_translate_address(dev_ofnode(dev), in_addr); in dev_translate_address()
660 #define dev_for_each_subnode(subnode, dev) \ argument
661 for (subnode = dev_read_first_subnode(dev); \