@@ -48,6 +48,30 @@ bool lkfdt_node_is_available(const void *fdt, int node) __PURE;
48
48
*/
49
49
int lkfdt_get_reg (const void * fdt , int parent , int node , uint32_t * addr , uint32_t * size ) __PURE ;
50
50
51
+ /**
52
+ * lkfdt_read_phandle() - Read phandle from property.
53
+ * @fdt: Device tree blob
54
+ * @node: Device tree node offset
55
+ * @prop: Name of property that contains the phandle
56
+ * @phandle: Ouput variable that is filled with the phandle value
57
+ *
58
+ * Return: 0 if successful, <0 libfdt error
59
+ */
60
+ int lkfdt_read_phandle (const void * fdt , int node , const char * prop , uint32_t * phandle ) __PURE ;
61
+
62
+ /**
63
+ * lkfdt_phandlelist_get() - Read one specific phandle from a list.
64
+ * @fdt: Device tree blob
65
+ * @node: Device tree node offset
66
+ * @prop: Name of property that contains the phandle list
67
+ * @idx: Index of phandle to return from the list
68
+ * @phandle: Output variable that is filled with the phandle value
69
+ *
70
+ * Return: 0 if successful, <0 libfdt errror (e.g. -FDT_ERR_NOTFOUND)
71
+ */
72
+ int lkfdt_phandlelist_get (const void * fdt , int node , const char * prop ,
73
+ int idx , uint32_t * phandle ) __PURE ;
74
+
51
75
/**
52
76
* lkfdt_lookup_phandle() - Read phandle from property and search for the node.
53
77
* @fdt: Device tree blob
@@ -60,6 +84,21 @@ int lkfdt_get_reg(const void *fdt, int parent, int node, uint32_t *addr, uint32_
60
84
*/
61
85
int lkfdt_lookup_phandle (const void * fdt , int node , const char * prop ) __PURE ;
62
86
87
+ /**
88
+ * lkfdt_subnode_offset_by_phandle() - Return subnode that matches a phandle.
89
+ * @fdt: Device tree blob
90
+ * @parent: Device tree node offset of parent
91
+ * @phandle: The phandle to search for
92
+ *
93
+ * Iterate over all subnodes of the "parent" and look for the node that has
94
+ * the specified "phandle".
95
+ *
96
+ * Return:
97
+ * * >= 0 - The offset of the subnode that matches the phandle, if successful
98
+ * * < 0 - libfdt error (<0), otherwise
99
+ */
100
+ int lkfdt_subnode_offset_by_phandle (const void * fdt , int parent , uint32_t phandle ) __PURE ;
101
+
63
102
/**
64
103
* lkfdt_stringlist_get_all() - Obtain array of strings for a given prop
65
104
* @fdt: Device tree blob
0 commit comments