diff options
Diffstat (limited to 'include/dm/of_access.h')
-rw-r--r-- | include/dm/of_access.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/dm/of_access.h b/include/dm/of_access.h index 5b7821d0a1..83f34f0d2a 100644 --- a/include/dm/of_access.h +++ b/include/dm/of_access.h @@ -265,6 +265,38 @@ struct device_node *of_find_node_by_prop_value(struct device_node *from, struct device_node *of_find_node_by_phandle(phandle handle); /** + * of_read_u8() - Find and read a 8-bit integer from a property + * + * Search for a property in a device node and read a 8-bit value from + * it. + * + * @np: device node from which the property value is to be read. + * @propname: name of the property to be searched. + * @outp: pointer to return value, modified only if return value is 0. + * + * Return: 0 on success, -EINVAL if the property does not exist, + * -ENODATA if property does not have a value, and -EOVERFLOW if the + * property data isn't large enough. + */ +int of_read_u8(const struct device_node *np, const char *propname, u8 *outp); + +/** + * of_read_u16() - Find and read a 16-bit integer from a property + * + * Search for a property in a device node and read a 16-bit value from + * it. + * + * @np: device node from which the property value is to be read. + * @propname: name of the property to be searched. + * @outp: pointer to return value, modified only if return value is 0. + * + * Return: 0 on success, -EINVAL if the property does not exist, + * -ENODATA if property does not have a value, and -EOVERFLOW if the + * property data isn't large enough. + */ +int of_read_u16(const struct device_node *np, const char *propname, u16 *outp); + +/** * of_read_u32() - Find and read a 32-bit integer from a property * * Search for a property in a device node and read a 32-bit value from |