diff options
author | Tom Rini <trini@konsulko.com> | 2018-09-30 18:16:51 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-09-30 18:16:51 -0400 |
commit | d24c1d0f4da3b081a4fedf7ae2a08790871f08d0 (patch) | |
tree | 30051c24000bbb640b6296c8a71a8e05f0cc06e4 /include/dm/ofnode.h | |
parent | 2c1e16b9d2e3a6138acf4ffd9866e47ddbe6d453 (diff) | |
parent | 31b8217e83a63d1c8c70edcdcdf5aff3b1791640 (diff) | |
download | u-boot-d24c1d0f4da3b081a4fedf7ae2a08790871f08d0.tar.gz |
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r-- | include/dm/ofnode.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index c06d77849c..2fc9fa39a3 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -764,4 +764,50 @@ u64 ofnode_translate_address(ofnode node, const fdt32_t *in_addr); * @return true if OK, false if the compatible is not found */ int ofnode_device_is_compatible(ofnode node, const char *compat); + +/** + * ofnode_write_prop() - Set a property of a ofnode + * + * Note that the value passed to the function is *not* allocated by the + * function itself, but must be allocated by the caller if necessary. + * + * @node: The node for whose property should be set + * @propname: The name of the property to set + * @len: The length of the new value of the property + * @value: The new value of the property (must be valid prior to calling + * the function) + * @return 0 if successful, -ve on error + */ +int ofnode_write_prop(ofnode node, const char *propname, int len, + const void *value); + +/** + * ofnode_write_string() - Set a string property of a ofnode + * + * Note that the value passed to the function is *not* allocated by the + * function itself, but must be allocated by the caller if necessary. + * + * @node: The node for whose string property should be set + * @propname: The name of the string property to set + * @value: The new value of the string property (must be valid prior to + * calling the function) + * @return 0 if successful, -ve on error + */ +int ofnode_write_string(ofnode node, const char *propname, const char *value); + +/** + * ofnode_set_enabled() - Enable or disable a device tree node given by its + * ofnode + * + * This function effectively sets the node's "status" property to either "okay" + * or "disable", hence making it available for driver model initialization or + * not. + * + * @node: The node to enable + * @value: Flag that tells the function to either disable or enable the + * node + * @return 0 if successful, -ve on error + */ +int ofnode_set_enabled(ofnode node, bool value); + #endif |