Philipp Zabel | fd9fdb7 | 2014-02-10 22:01:48 +0100 | [diff] [blame] | 1 | /* |
| 2 | * OF graph binding parsing helpers |
| 3 | * |
| 4 | * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd. |
| 5 | * Author: Sylwester Nawrocki <s.nawrocki@samsung.com> |
| 6 | * |
| 7 | * Copyright (C) 2012 Renesas Electronics Corp. |
| 8 | * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of version 2 of the GNU General Public License as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | #ifndef __LINUX_OF_GRAPH_H |
| 15 | #define __LINUX_OF_GRAPH_H |
| 16 | |
Philipp Zabel | f2a575f | 2014-02-14 11:53:56 +0100 | [diff] [blame] | 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 | |
Philipp Zabel | fd9fdb7 | 2014-02-10 22:01:48 +0100 | [diff] [blame] | 29 | #ifdef CONFIG_OF |
Philipp Zabel | f2a575f | 2014-02-14 11:53:56 +0100 | [diff] [blame] | 30 | int of_graph_parse_endpoint(const struct device_node *node, |
| 31 | struct of_endpoint *endpoint); |
Philipp Zabel | fd9fdb7 | 2014-02-10 22:01:48 +0100 | [diff] [blame] | 32 | struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, |
| 33 | struct device_node *previous); |
| 34 | struct device_node *of_graph_get_remote_port_parent( |
| 35 | const struct device_node *node); |
| 36 | struct device_node *of_graph_get_remote_port(const struct device_node *node); |
| 37 | #else |
| 38 | |
Philipp Zabel | f2a575f | 2014-02-14 11:53:56 +0100 | [diff] [blame] | 39 | static inline int of_graph_parse_endpoint(const struct device_node *node, |
Philipp Zabel | 00fd961 | 2014-03-07 15:49:54 +0100 | [diff] [blame] | 40 | struct of_endpoint *endpoint) |
Philipp Zabel | f2a575f | 2014-02-14 11:53:56 +0100 | [diff] [blame] | 41 | { |
| 42 | return -ENOSYS; |
| 43 | } |
| 44 | |
Philipp Zabel | fd9fdb7 | 2014-02-10 22:01:48 +0100 | [diff] [blame] | 45 | static inline struct device_node *of_graph_get_next_endpoint( |
| 46 | const struct device_node *parent, |
| 47 | struct device_node *previous) |
| 48 | { |
| 49 | return NULL; |
| 50 | } |
| 51 | |
| 52 | static inline struct device_node *of_graph_get_remote_port_parent( |
| 53 | const struct device_node *node) |
| 54 | { |
| 55 | return NULL; |
| 56 | } |
| 57 | |
| 58 | static inline struct device_node *of_graph_get_remote_port( |
| 59 | const struct device_node *node) |
| 60 | { |
| 61 | return NULL; |
| 62 | } |
| 63 | |
| 64 | #endif /* CONFIG_OF */ |
| 65 | |
| 66 | #endif /* __LINUX_OF_GRAPH_H */ |