Lines Matching refs:dev
20 static inline const struct device_node *dev_np(struct udevice *dev) in dev_np() argument
22 return ofnode_to_np(dev->node); in dev_np()
25 static inline const struct device_node *dev_np(struct udevice *dev) in dev_np() argument
37 static inline ofnode dev_ofnode(struct udevice *dev) in dev_ofnode() argument
39 return dev->node; in dev_ofnode()
42 static inline bool dev_of_valid(struct udevice *dev) in dev_of_valid() argument
44 return ofnode_valid(dev_ofnode(dev)); in dev_of_valid()
56 int dev_read_u32_default(struct udevice *dev, const char *propname, int def);
66 int dev_read_s32_default(struct udevice *dev, const char *propname, int def);
75 const char *dev_read_string(struct udevice *dev, const char *propname);
84 bool dev_read_bool(struct udevice *dev, const char *propname);
94 ofnode dev_read_subnode(struct udevice *dev, const char *subbnode_name);
103 int dev_read_size(struct udevice *dev, const char *propname);
114 fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);
123 fdt_addr_t dev_read_addr(struct udevice *dev);
133 void *dev_read_addr_ptr(struct udevice *dev);
146 fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *propname,
155 const char *dev_read_name(struct udevice *dev);
175 int dev_read_stringlist_search(struct udevice *dev, const char *property,
189 int dev_read_string_index(struct udevice *dev, const char *propname, int index,
200 int dev_read_string_count(struct udevice *dev, const char *propname);
239 int dev_read_phandle_with_args(struct udevice *dev, const char *list_name,
259 int dev_count_phandle_with_args(struct udevice *dev, const char *list_name,
271 int dev_read_addr_cells(struct udevice *dev);
283 void *dev_remap_addr_index(struct udevice *dev, int index);
294 int dev_read_size_cells(struct udevice *dev);
304 int dev_read_simple_addr_cells(struct udevice *dev);
314 int dev_read_simple_size_cells(struct udevice *dev);
322 int dev_read_phandle(struct udevice *dev);
332 const void *dev_read_prop(struct udevice *dev, const char *propname, int *lenp);
344 int dev_read_first_prop(struct udevice *dev, struct ofprop *prop);
381 int dev_read_alias_seq(struct udevice *dev, int *devnump);
399 int dev_read_u32_array(struct udevice *dev, const char *propname,
418 int dev_write_u32_array(struct udevice *dev, const char *propname,
428 ofnode dev_read_first_subnode(struct udevice *dev);
453 const uint8_t *dev_read_u8_array_ptr(struct udevice *dev, const char *propname,
467 int dev_read_enabled(struct udevice *dev);
477 int dev_read_resource(struct udevice *dev, uint index, struct resource *res);
487 int dev_read_resource_byname(struct udevice *dev, const char *name,
501 u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr);
504 static inline int dev_read_u32_default(struct udevice *dev, in dev_read_u32_default() argument
507 return ofnode_read_u32_default(dev_ofnode(dev), propname, def); in dev_read_u32_default()
510 static inline const char *dev_read_string(struct udevice *dev, in dev_read_string() argument
513 return ofnode_read_string(dev_ofnode(dev), propname); in dev_read_string()
516 static inline bool dev_read_bool(struct udevice *dev, const char *propname) in dev_read_bool() argument
518 return ofnode_read_bool(dev_ofnode(dev), propname); in dev_read_bool()
521 static inline ofnode dev_read_subnode(struct udevice *dev, in dev_read_subnode() argument
524 return ofnode_find_subnode(dev_ofnode(dev), subbnode_name); in dev_read_subnode()
527 static inline int dev_read_size(struct udevice *dev, const char *propname) in dev_read_size() argument
529 return ofnode_read_size(dev_ofnode(dev), propname); in dev_read_size()
532 static inline fdt_addr_t dev_read_addr_index(struct udevice *dev, int index) in dev_read_addr_index() argument
534 return devfdt_get_addr_index(dev, index); in dev_read_addr_index()
537 static inline fdt_addr_t dev_read_addr(struct udevice *dev) in dev_read_addr() argument
539 return devfdt_get_addr(dev); in dev_read_addr()
542 static inline void *dev_read_addr_ptr(struct udevice *dev) in dev_read_addr_ptr() argument
544 return devfdt_get_addr_ptr(dev); in dev_read_addr_ptr()
547 static inline fdt_addr_t dev_read_addr_size(struct udevice *dev, in dev_read_addr_size() argument
551 return ofnode_get_addr_size(dev_ofnode(dev), propname, sizep); in dev_read_addr_size()
554 static inline const char *dev_read_name(struct udevice *dev) in dev_read_name() argument
556 if (!dev_of_valid(dev)) in dev_read_name()
558 return ofnode_get_name(dev_ofnode(dev)); in dev_read_name()
561 static inline int dev_read_stringlist_search(struct udevice *dev, in dev_read_stringlist_search() argument
565 return ofnode_stringlist_search(dev_ofnode(dev), propname, string); in dev_read_stringlist_search()
568 static inline int dev_read_string_index(struct udevice *dev, in dev_read_string_index() argument
572 return ofnode_read_string_index(dev_ofnode(dev), propname, index, outp); in dev_read_string_index()
575 static inline int dev_read_string_count(struct udevice *dev, in dev_read_string_count() argument
578 return ofnode_read_string_count(dev_ofnode(dev), propname); in dev_read_string_count()
581 static inline int dev_read_phandle_with_args(struct udevice *dev, in dev_read_phandle_with_args() argument
585 return ofnode_parse_phandle_with_args(dev_ofnode(dev), list_name, in dev_read_phandle_with_args()
590 static inline int dev_count_phandle_with_args(struct udevice *dev, in dev_count_phandle_with_args() argument
593 return ofnode_count_phandle_with_args(dev_ofnode(dev), list_name, in dev_count_phandle_with_args()
597 static inline int dev_read_addr_cells(struct udevice *dev) in dev_read_addr_cells() argument
600 return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_addr_cells()
603 static inline void *dev_remap_addr_index(struct udevice *dev, int index) in dev_remap_addr_index() argument
605 return devfdt_remap_addr_index(dev, index); in dev_remap_addr_index()
608 static inline int dev_read_size_cells(struct udevice *dev) in dev_read_size_cells() argument
611 return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_size_cells()
614 static inline int dev_read_simple_addr_cells(struct udevice *dev) in dev_read_simple_addr_cells() argument
616 return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_simple_addr_cells()
619 static inline int dev_read_simple_size_cells(struct udevice *dev) in dev_read_simple_size_cells() argument
621 return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev)); in dev_read_simple_size_cells()
624 static inline int dev_read_phandle(struct udevice *dev) in dev_read_phandle() argument
626 return fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev)); in dev_read_phandle()
629 static inline const void *dev_read_prop(struct udevice *dev, in dev_read_prop() argument
632 return ofnode_get_property(dev_ofnode(dev), propname, lenp); in dev_read_prop()
635 static inline int dev_read_first_prop(struct udevice *dev, struct ofprop *prop) in dev_read_first_prop() argument
637 return ofnode_get_first_property(dev_ofnode(dev), prop); in dev_read_first_prop()
652 static inline int dev_read_alias_seq(struct udevice *dev, int *devnump) in dev_read_alias_seq() argument
654 return fdtdec_get_alias_seq(gd->fdt_blob, dev->uclass->uc_drv->name, in dev_read_alias_seq()
655 dev_of_offset(dev), devnump); in dev_read_alias_seq()
658 static inline int dev_read_u32_array(struct udevice *dev, const char *propname, in dev_read_u32_array() argument
661 if (!dev_of_valid(dev)) in dev_read_u32_array()
663 return ofnode_read_u32_array(dev_ofnode(dev), propname, out_values, sz); in dev_read_u32_array()
666 static inline ofnode dev_read_first_subnode(struct udevice *dev) in dev_read_first_subnode() argument
668 return ofnode_first_subnode(dev_ofnode(dev)); in dev_read_first_subnode()
676 static inline const uint8_t *dev_read_u8_array_ptr(struct udevice *dev, in dev_read_u8_array_ptr() argument
679 return ofnode_read_u8_array_ptr(dev_ofnode(dev), propname, sz); in dev_read_u8_array_ptr()
682 static inline int dev_read_enabled(struct udevice *dev) in dev_read_enabled() argument
684 return fdtdec_get_is_enabled(gd->fdt_blob, dev_of_offset(dev)); in dev_read_enabled()
687 static inline int dev_read_resource(struct udevice *dev, uint index, in dev_read_resource() argument
690 return ofnode_read_resource(dev_ofnode(dev), index, res); in dev_read_resource()
693 static inline int dev_read_resource_byname(struct udevice *dev, in dev_read_resource_byname() argument
697 return ofnode_read_resource_byname(dev_ofnode(dev), name, res); in dev_read_resource_byname()
700 static inline u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr) in dev_translate_address() argument
702 return ofnode_translate_address(dev_ofnode(dev), in_addr); in dev_translate_address()
716 #define dev_for_each_subnode(subnode, dev) \ argument
717 for (subnode = dev_read_first_subnode(dev); \
730 #define dev_for_each_property(prop, dev) \ argument
731 for (int ret_prop = dev_read_first_prop(dev, &prop); \