From e2d5997ffdf5cbf4f7d53584dab2ffc673f50987 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Fri, 23 Feb 2018 17:38:49 +0100 Subject: core: ofnode: add ofnode_get_parent function The Rockchip video drivers need to walk the ofnode-parrents to find an enclosing device that has a UCLASS_DISPLAY driver bound. This adds a ofnode_get_parent()-function that returns the parent-node. Signed-off-by: Philipp Tomsich Tested-by: Klaus Goger Reviewed-by: Anatolij Gustschin --- include/dm/ofnode.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index c359a60f95..6938e62993 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -301,6 +301,14 @@ ofnode ofnode_first_subnode(ofnode node); */ ofnode ofnode_next_subnode(ofnode node); +/** + * ofnode_get_parent() - get the ofnode's parent (enclosing ofnode) + * + * @node: valid node to look up + * @return ofnode reference of the parent node + */ +ofnode ofnode_get_parent(ofnode node); + /** * ofnode_get_name() - get the name of a node * -- cgit From b4f20767b12a5718ed8549aece73d405c6cac800 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Fri, 23 Feb 2018 17:38:50 +0100 Subject: core: add ofnode_get_by_phandle() api We need to get ofnode from a phandle, add interface to support both live dt and fdt. Signed-off-by: Kever Yang Reviewed-by: Simon Glass Reviewed-by: Philipp Tomsich Tested-by: Klaus Goger Signed-off-by: Philipp Tomsich --- include/dm/ofnode.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 6938e62993..0d008404f9 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -317,6 +317,14 @@ ofnode ofnode_get_parent(ofnode node); */ const char *ofnode_get_name(ofnode node); +/** + * ofnode_get_by_phandle() - get ofnode from phandle + * + * @phandle: phandle to look up + * @return ofnode reference to the phandle + */ +ofnode ofnode_get_by_phandle(uint phandle); + /** * ofnode_read_size() - read the size of a property * -- cgit