diff options
author | Simon Glass <sjg@chromium.org> | 2018-06-11 13:07:10 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-07-09 09:11:00 -0600 |
commit | 7e5196c409f17091f2aeca144c6d76750df81cc4 (patch) | |
tree | 427b03797b692f0752fecd92dccc397027df98da /include/dm/of_access.h | |
parent | 90c08fa038451d6d7b7d8711bfd829b61d64c490 (diff) | |
download | u-boot-7e5196c409f17091f2aeca144c6d76750df81cc4.tar.gz |
dm: core: Add ofnode function to read a 64-bit int
We have a 32-bit version of this function. Add a 64-bit version as well so
we can easily read 64-bit ints from the device tree.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/of_access.h')
-rw-r--r-- | include/dm/of_access.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/of_access.h b/include/dm/of_access.h index 74f0606e072..dd1abb8e97b 100644 --- a/include/dm/of_access.h +++ b/include/dm/of_access.h @@ -219,6 +219,22 @@ struct device_node *of_find_node_by_phandle(phandle handle); int of_read_u32(const struct device_node *np, const char *propname, u32 *outp); /** + * of_read_u64() - Find and read a 64-bit integer from a property + * + * Search for a property in a device node and read a 64-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_u64(const struct device_node *np, const char *propname, u64 *outp); + +/** * of_read_u32_array() - Find and read an array of 32 bit integers * * Search for a property in a device node and read 32-bit value(s) from |