This source file includes following definitions.
- of_graph_parse_endpoint
- of_graph_get_endpoint_count
- of_graph_get_port_by_id
- of_graph_get_next_endpoint
- of_graph_get_endpoint_by_regs
- of_graph_get_remote_endpoint
- of_graph_get_port_parent
- of_graph_get_remote_port_parent
- of_graph_get_remote_port
- of_graph_get_remote_node
1
2
3
4
5
6
7
8
9
10
11 #ifndef __LINUX_OF_GRAPH_H
12 #define __LINUX_OF_GRAPH_H
13
14 #include <linux/types.h>
15 #include <linux/errno.h>
16
17
18
19
20
21
22
23 struct of_endpoint {
24 unsigned int port;
25 unsigned int id;
26 const struct device_node *local_node;
27 };
28
29
30
31
32
33
34
35
36 #define for_each_endpoint_of_node(parent, child) \
37 for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \
38 child = of_graph_get_next_endpoint(parent, child))
39
40 #ifdef CONFIG_OF
41 int of_graph_parse_endpoint(const struct device_node *node,
42 struct of_endpoint *endpoint);
43 int of_graph_get_endpoint_count(const struct device_node *np);
44 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
45 struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
46 struct device_node *previous);
47 struct device_node *of_graph_get_endpoint_by_regs(
48 const struct device_node *parent, int port_reg, int reg);
49 struct device_node *of_graph_get_remote_endpoint(
50 const struct device_node *node);
51 struct device_node *of_graph_get_port_parent(struct device_node *node);
52 struct device_node *of_graph_get_remote_port_parent(
53 const struct device_node *node);
54 struct device_node *of_graph_get_remote_port(const struct device_node *node);
55 struct device_node *of_graph_get_remote_node(const struct device_node *node,
56 u32 port, u32 endpoint);
57 #else
58
59 static inline int of_graph_parse_endpoint(const struct device_node *node,
60 struct of_endpoint *endpoint)
61 {
62 return -ENOSYS;
63 }
64
65 static inline int of_graph_get_endpoint_count(const struct device_node *np)
66 {
67 return 0;
68 }
69
70 static inline struct device_node *of_graph_get_port_by_id(
71 struct device_node *node, u32 id)
72 {
73 return NULL;
74 }
75
76 static inline struct device_node *of_graph_get_next_endpoint(
77 const struct device_node *parent,
78 struct device_node *previous)
79 {
80 return NULL;
81 }
82
83 static inline struct device_node *of_graph_get_endpoint_by_regs(
84 const struct device_node *parent, int port_reg, int reg)
85 {
86 return NULL;
87 }
88
89 static inline struct device_node *of_graph_get_remote_endpoint(
90 const struct device_node *node)
91 {
92 return NULL;
93 }
94
95 static inline struct device_node *of_graph_get_port_parent(
96 struct device_node *node)
97 {
98 return NULL;
99 }
100
101 static inline struct device_node *of_graph_get_remote_port_parent(
102 const struct device_node *node)
103 {
104 return NULL;
105 }
106
107 static inline struct device_node *of_graph_get_remote_port(
108 const struct device_node *node)
109 {
110 return NULL;
111 }
112 static inline struct device_node *of_graph_get_remote_node(
113 const struct device_node *node,
114 u32 port, u32 endpoint)
115 {
116 return NULL;
117 }
118
119 #endif
120
121 #endif