diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2014-10-20 19:26:42 +0800 |
---|---|---|
committer | Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> | 2015-03-13 17:11:05 -0400 |
commit | 35f5139250c3c135aa656370c32efeb70fdc88c9 (patch) | |
tree | 56487c203ac4489d93f6d0fd42b76b874809ff62 /drivers/of | |
parent | b0da832d7da82702dc3e24a77b24b25f06c9495a (diff) |
base: of: add parsing api for g3d
This api is added by hisilicon.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 3823edf2d012..a877fc737f93 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1222,6 +1222,23 @@ int of_property_read_u32_array(const struct device_node *np, } EXPORT_SYMBOL_GPL(of_property_read_u32_array); +int of_property_read_u32_planar_array(const struct device_node *np, + const char *propname, + u32 *out_value, size_t sz, + u32 index) +{ + const __be32 *val_data = NULL; + const __be32 *val = of_find_property_value_of_size(np, propname, + ((index + 1) * sz * sizeof(*out_value))); + if (IS_ERR(val)) + return PTR_ERR(val); + val_data = val + index * sz; + while (sz--) + *out_value++ = be32_to_cpup(val_data++); + return 0; +} +EXPORT_SYMBOL_GPL(of_property_read_u32_planar_array); + /** * of_property_read_u64 - Find and read a 64 bit integer from a property * @np: device node from which the property value is to be read. |