aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTony Prisk <linux@prisktech.co.nz>2013-03-23 00:02:15 -0400
committerTony Prisk <linux@prisktech.co.nz>2013-04-04 00:58:59 -0400
commit3daf37260e965aa4bb060db99c2ed10b28109e04 (patch)
treeea9a0908cf24622b29d21d16e30f995afe17a58a /include
parent8bb9660418e05bb1845ac1a2428444d78e322cc7 (diff)
of: Add support for reading a u32 from a multi-value property.
This patch adds an of_property_read_u32_index() function to allow reading a single indexed u32 value from a property containing multiple u32 values. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Reviewed-by: Stephen Warren <swarren@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Rob Herring <robherring2@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/of.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index a0f129284948..c0747a44eaff 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -235,6 +235,9 @@ extern struct device_node *of_find_node_with_property(
235extern struct property *of_find_property(const struct device_node *np, 235extern struct property *of_find_property(const struct device_node *np,
236 const char *name, 236 const char *name,
237 int *lenp); 237 int *lenp);
238extern int of_property_read_u32_index(const struct device_node *np,
239 const char *propname,
240 u32 index, u32 *out_value);
238extern int of_property_read_u8_array(const struct device_node *np, 241extern int of_property_read_u8_array(const struct device_node *np,
239 const char *propname, u8 *out_values, size_t sz); 242 const char *propname, u8 *out_values, size_t sz);
240extern int of_property_read_u16_array(const struct device_node *np, 243extern int of_property_read_u16_array(const struct device_node *np,
@@ -394,6 +397,12 @@ static inline struct device_node *of_find_compatible_node(
394 return NULL; 397 return NULL;
395} 398}
396 399
400static inline int of_property_read_u32_index(const struct device_node *np,
401 const char *propname, u32 index, u32 *out_value)
402{
403 return -ENOSYS;
404}
405
397static inline int of_property_read_u8_array(const struct device_node *np, 406static inline int of_property_read_u8_array(const struct device_node *np,
398 const char *propname, u8 *out_values, size_t sz) 407 const char *propname, u8 *out_values, size_t sz)
399{ 408{