~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/of_graph.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * OF graph binding parsing helpers
  4  *
  5  * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd.
  6  * Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
  7  *
  8  * Copyright (C) 2012 Renesas Electronics Corp.
  9  * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
 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  * struct of_endpoint - the OF graph endpoint data structure
 19  * @port: identifier (value of reg property) of a port this endpoint belongs to
 20  * @id: identifier (value of reg property) of this endpoint
 21  * @local_node: pointer to device_node of this endpoint
 22  */
 23 struct of_endpoint {
 24         unsigned int port;
 25         unsigned int id;
 26         const struct device_node *local_node;
 27 };
 28 
 29 /**
 30  * for_each_endpoint_of_node - iterate over every endpoint in a device node
 31  * @parent: parent device node containing ports and endpoints
 32  * @child: loop variable pointing to the current endpoint node
 33  *
 34  * When breaking out of the loop, of_node_put(child) has to be called manually.
 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 bool of_graph_is_present(const struct device_node *node);
 42 int of_graph_parse_endpoint(const struct device_node *node,
 43                                 struct of_endpoint *endpoint);
 44 unsigned int of_graph_get_endpoint_count(const struct device_node *np);
 45 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 46 struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 47                                         struct device_node *previous);
 48 struct device_node *of_graph_get_endpoint_by_regs(
 49                 const struct device_node *parent, int port_reg, int reg);
 50 struct device_node *of_graph_get_remote_endpoint(
 51                                         const struct device_node *node);
 52 struct device_node *of_graph_get_port_parent(struct device_node *node);
 53 struct device_node *of_graph_get_remote_port_parent(
 54                                         const struct device_node *node);
 55 struct device_node *of_graph_get_remote_port(const struct device_node *node);
 56 struct device_node *of_graph_get_remote_node(const struct device_node *node,
 57                                              u32 port, u32 endpoint);
 58 #else
 59 
 60 static inline bool of_graph_is_present(const struct device_node *node)
 61 {
 62         return false;
 63 }
 64 
 65 static inline int of_graph_parse_endpoint(const struct device_node *node,
 66                                         struct of_endpoint *endpoint)
 67 {
 68         return -ENOSYS;
 69 }
 70 
 71 static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 72 {
 73         return 0;
 74 }
 75 
 76 static inline struct device_node *of_graph_get_port_by_id(
 77                                         struct device_node *node, u32 id)
 78 {
 79         return NULL;
 80 }
 81 
 82 static inline struct device_node *of_graph_get_next_endpoint(
 83                                         const struct device_node *parent,
 84                                         struct device_node *previous)
 85 {
 86         return NULL;
 87 }
 88 
 89 static inline struct device_node *of_graph_get_endpoint_by_regs(
 90                 const struct device_node *parent, int port_reg, int reg)
 91 {
 92         return NULL;
 93 }
 94 
 95 static inline struct device_node *of_graph_get_remote_endpoint(
 96                                         const struct device_node *node)
 97 {
 98         return NULL;
 99 }
100 
101 static inline struct device_node *of_graph_get_port_parent(
102         struct device_node *node)
103 {
104         return NULL;
105 }
106 
107 static inline struct device_node *of_graph_get_remote_port_parent(
108                                         const struct device_node *node)
109 {
110         return NULL;
111 }
112 
113 static inline struct device_node *of_graph_get_remote_port(
114                                         const struct device_node *node)
115 {
116         return NULL;
117 }
118 static inline struct device_node *of_graph_get_remote_node(
119                                         const struct device_node *node,
120                                         u32 port, u32 endpoint)
121 {
122         return NULL;
123 }
124 
125 #endif /* CONFIG_OF */
126 
127 #endif /* __LINUX_OF_GRAPH_H */
128 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php