summaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-11-10 12:50:22 +0100
committerTom Rini <trini@konsulko.com>2024-12-06 13:00:40 -0600
commit2d31a2797a359e8eda95ca9e742982e67ce57ba7 (patch)
tree74c270a82008bc179ed73f9bf7c91f261bafd0f9 /include/dm/ofnode.h
parent8f9cc56a5b0e6c2959508a9f8916bd7e5f32cf5f (diff)
dm: core: implement ofnode/tree_parse_phandle() helper
Implement ofnode/tree_parse_phandle() helper as an equivalent of of_parse_phandle to handle simple single value phandle. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 7ece68874ae..eea6b13217c 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -848,6 +848,18 @@ int ofnode_read_string_list(ofnode node, const char *property,
const char ***listp);
/**
+ * ofnode_parse_phandle() - Resolve a phandle property to an ofnode
+ *
+ * @node: node to check
+ * @phandle_name: Name of property holding a phandle value
+ * @index: For properties holding a table of phandles, this is the index into
+ * the table
+ * Return: ofnode that the phandle points to or ofnode_null() on error.
+ */
+ofnode ofnode_parse_phandle(ofnode node, const char *phandle_name,
+ int index);
+
+/**
* ofnode_parse_phandle_with_args() - Find a node pointed by phandle in a list
*
* This function is useful to parse lists of phandles and their arguments.
@@ -910,6 +922,20 @@ int ofnode_count_phandle_with_args(ofnode node, const char *list_name,
const char *cells_name, int cell_count);
/**
+ * oftree_parse_phandle() - Resolve a phandle property to an ofnode
+ * from a root node
+ *
+ * @tree: device tree to use
+ * @node: node to check
+ * @phandle_name: Name of property holding a phandle value
+ * @index: For properties holding a table of phandles, this is the index into
+ * the table
+ * Return: ofnode that the phandle points to or ofnode_null() on error.
+ */
+ofnode oftree_parse_phandle(oftree tree, ofnode node, const char *phandle_name,
+ int index);
+
+/**
* oftree_parse_phandle_with_args() - Find a node pointed by phandle in a list
* from a root node
*