aboutsummaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-28 17:50:02 -0700
committerSimon Glass <sjg@chromium.org>2020-12-13 07:58:18 -0700
commit0de1b07406d709c3951dbb1a69ca196d80bd516d (patch)
treea741e4a124438112f6ef63c0fce2473da2870227 /include/dm/ofnode.h
parent734206dda14b328bfb946eea1e343f06a5fcceea (diff)
dm: core: Add a livetree function to check node status
Add a way to find out if a node is enabled or not, based on its 'status' property. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index ced7f6ffb2..ee8c44a71e 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -345,6 +345,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