linux下devicetree中常用的of函数
int of_property_read_u8_array(const struct device_node *np, const char *propname,u8 *out_values, size_t sz);
int of_property_read_u16_array(const struct device_node *np, const char *propname,u16 *out_values, size_t sz);
int of_property_read_u32_array(const struct device_node *np, const char *propname,u32 *out_values, size_t sz);
static inline int of_property_read_u8(const struct device_node *np,const char *propname,u8 *out_value)
static inline int of_property_read_u16(const struct device_node *np,const char *propname,u8 *out_value)
static inline int of_property_read_u32(const struct device_node *np,const char *propname,u8 *out_value)
int of_property_read_u32_index(const struct device_node *np,const char*propname,u32 index, u32 *out_value)
int of_property_read_u64(conststruct device_node *np, const char *propname,u64 *out_value)
int of_property_read_string(struct device_node *np, const char *propname,const char**out_string)
int of_property_read_string_index(struct device_node *np, const char *propname,intindex, const char **output)
int of_property_count_strings(struct device_node *np, const char *propname)
unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
int of_irq_count(struct device_node *dev)
static inline bool of_property_read_bool(const struct device_node *np,const char *propname);
struct property* of_find_property(const struct device_node *np,const char *name,int *lenp)
const void * of_get_property(const struct device_node *np, const char *name,int *lenp)
struct device_node* of_get_parent(const struct device_node *node)
int of_device_is_compatible(const struct device_node *device,const char *compat);
struct device_node* of_find_node_by_path(const char *path)
struct device_node* of_find_node_by_name(struct device_node *from,const char *name)
struct device_node* of_find_node_by_type(struct device_node *from,const char *type)
struct device_node * of_find_compatible_node(struct device_node *from, const char*type, const char,*compatible);
struct device_node* of_find_node_with_property(struct device_node *from,const char *prop_name)
struct device_node* of_find_node_by_phandle(phandle handle)
void __iomem* of_iomap(struct device_node *node, int index);
unsigned long __init of_get_flat_dt_root(void)
int of_alias_get_id(struct device_node *np, const char *stem)
struct device_node* of_node_get(struct device_node *node)
void of_node_put(struct device_node *node)
const struct of_device_id* of_match_node(const struct of_device_id *matches,const struct device_node*node)
platform_device和resource相关:
int of_address_to_resource(struct device_node *dev, int index,struct resource *r)
struct platform_device* of_device_alloc(struct device_node *np,const char *bus_id,struct device *parent)
int of_platform_bus_probe(struct device_node *root,const struct of_device_id *matches,struct device *parent)
int of_platform_populate(struct device_node *root,const struct of_device_id *matches,const struct of_dev_auxdata *lookup,struct device *parent)
struct platform_device* of_find_device_by_node(struct device_node *np)
本文转自:http://www.myexception.cn/linux-unix/1910031.html