diff options
author | Tom Rini <trini@konsulko.com> | 2020-12-14 18:57:57 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-12-14 18:57:57 -0500 |
commit | 8351a29d2df18c92d8e365cfa848218c3859f3d2 (patch) | |
tree | 5d29001be9accfb8029df9d9ed78fba196ee07b9 /include/dm/ofnode.h | |
parent | ddaa94978583d07ec515e7226e397221d8cc44c8 (diff) | |
parent | b7bbd553de0d9752f919dfc616f560f6f2504c14 (diff) | |
download | u-boot-WIP/14Dec2020-next.tar.gz |
Merge tag 'dm-pull-14dec20' of git://git.denx.de/u-boot-dm into nextWIP/14Dec2020-next
Driver model tidy-up for livetree
Driver model big rename for consistency
Python 3 clean-ups for patman
Update sandbox serial driver to use membuff
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r-- | include/dm/ofnode.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index ced7f6ffb2..53f04ac91d 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -218,6 +218,18 @@ static inline ofnode ofnode_null(void) return node; } +static inline ofnode ofnode_root(void) +{ + ofnode node; + + if (of_live_active()) + node.np = gd_of_root(); + else + node.of_offset = 0; + + return node; +} + /** * ofnode_read_u32() - Read a 32-bit integer from a property * @@ -345,6 +357,17 @@ const char *ofnode_read_string(ofnode node, const char *propname); */ int ofnode_read_u32_array(ofnode node, const char *propname, u32 *out_values, size_t sz); +/** + * ofnode_is_enabled() - Checks whether a node is enabled. + * This looks for a 'status' property. If this exists, then returns true if + * the status is 'okay' and false otherwise. If there is no status property, + * it returns true on the assumption that anything mentioned should be enabled + * by default. + * + * @node: node to examine + * @return false (not enabled) or true (enabled) + */ +bool ofnode_is_enabled(ofnode node); /** * ofnode_read_bool() - read a boolean value from a property |