diff options
Diffstat (limited to 'include/linux/of.h')
| -rw-r--r-- | include/linux/of.h | 42 | 
1 files changed, 40 insertions, 2 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 5ebcc5c8e42..1fd08ca2310 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -92,7 +92,7 @@ static inline void of_node_put(struct device_node *node) { }  extern struct device_node *of_allnodes;  extern struct device_node *of_chosen;  extern struct device_node *of_aliases; -extern rwlock_t devtree_lock; +extern raw_spinlock_t devtree_lock;  static inline bool of_have_populated_dt(void)  { @@ -160,7 +160,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)  #define OF_BAD_ADDR	((u64)-1) -static inline const char* of_node_full_name(struct device_node *np) +static inline const char *of_node_full_name(const struct device_node *np)  {  	return np ? np->full_name : "<no-node>";  } @@ -235,6 +235,9 @@ extern struct device_node *of_find_node_with_property(  extern struct property *of_find_property(const struct device_node *np,  					 const char *name,  					 int *lenp); +extern int of_property_read_u32_index(const struct device_node *np, +				       const char *propname, +				       u32 index, u32 *out_value);  extern int of_property_read_u8_array(const struct device_node *np,  			const char *propname, u8 *out_values, size_t sz);  extern int of_property_read_u16_array(const struct device_node *np, @@ -277,6 +280,8 @@ extern struct device_node *of_parse_phandle(const struct device_node *np,  extern int of_parse_phandle_with_args(const struct device_node *np,  	const char *list_name, const char *cells_name, int index,  	struct of_phandle_args *out_args); +extern int of_count_phandle_with_args(const struct device_node *np, +	const char *list_name, const char *cells_name);  extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));  extern int of_alias_get_id(struct device_node *np, const char *stem); @@ -351,6 +356,11 @@ static inline struct device_node *of_find_node_by_name(struct device_node *from,  	return NULL;  } +static inline struct device_node *of_get_parent(const struct device_node *node) +{ +	return NULL; +} +  static inline bool of_have_populated_dt(void)  {  	return false; @@ -377,6 +387,11 @@ static inline int of_device_is_compatible(const struct device_node *device,  	return 0;  } +static inline int of_device_is_available(const struct device_node *device) +{ +	return 0; +} +  static inline struct property *of_find_property(const struct device_node *np,  						const char *name,  						int *lenp) @@ -392,6 +407,12 @@ static inline struct device_node *of_find_compatible_node(  	return NULL;  } +static inline int of_property_read_u32_index(const struct device_node *np, +			const char *propname, u32 index, u32 *out_value) +{ +	return -ENOSYS; +} +  static inline int of_property_read_u8_array(const struct device_node *np,  			const char *propname, u8 *out_values, size_t sz)  { @@ -467,6 +488,13 @@ static inline int of_parse_phandle_with_args(struct device_node *np,  	return -ENOSYS;  } +static inline int of_count_phandle_with_args(struct device_node *np, +					     const char *list_name, +					     const char *cells_name) +{ +	return -ENOSYS; +} +  static inline int of_alias_get_id(struct device_node *np, const char *stem)  {  	return -ENOSYS; @@ -531,4 +559,14 @@ static inline int of_property_read_u32(const struct device_node *np,  	return of_property_read_u32_array(np, propname, out_value, 1);  } +#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE) +extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); +extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, +					 struct property *prop); +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, +					 struct property *newprop, +					 struct property *oldprop); +#endif +  #endif /* _LINUX_OF_H */  |