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

TOMOYO Linux Cross Reference
Linux/include/drm/drm_of.h

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __DRM_OF_H__
  3 #define __DRM_OF_H__
  4 
  5 #include <linux/of_graph.h>
  6 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
  7 #include <drm/drm_bridge.h>
  8 #endif
  9 
 10 struct component_master_ops;
 11 struct component_match;
 12 struct device;
 13 struct drm_device;
 14 struct drm_encoder;
 15 struct drm_panel;
 16 struct drm_bridge;
 17 struct device_node;
 18 
 19 #ifdef CONFIG_OF
 20 uint32_t drm_of_crtc_port_mask(struct drm_device *dev,
 21                             struct device_node *port);
 22 uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 23                                     struct device_node *port);
 24 void drm_of_component_match_add(struct device *master,
 25                                 struct component_match **matchptr,
 26                                 int (*compare)(struct device *, void *),
 27                                 struct device_node *node);
 28 int drm_of_component_probe(struct device *dev,
 29                            int (*compare_of)(struct device *, void *),
 30                            const struct component_master_ops *m_ops);
 31 int drm_of_encoder_active_endpoint(struct device_node *node,
 32                                    struct drm_encoder *encoder,
 33                                    struct of_endpoint *endpoint);
 34 int drm_of_find_panel_or_bridge(const struct device_node *np,
 35                                 int port, int endpoint,
 36                                 struct drm_panel **panel,
 37                                 struct drm_bridge **bridge);
 38 #else
 39 static inline uint32_t drm_of_crtc_port_mask(struct drm_device *dev,
 40                                           struct device_node *port)
 41 {
 42         return 0;
 43 }
 44 
 45 static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 46                                                   struct device_node *port)
 47 {
 48         return 0;
 49 }
 50 
 51 static inline void
 52 drm_of_component_match_add(struct device *master,
 53                            struct component_match **matchptr,
 54                            int (*compare)(struct device *, void *),
 55                            struct device_node *node)
 56 {
 57 }
 58 
 59 static inline int
 60 drm_of_component_probe(struct device *dev,
 61                        int (*compare_of)(struct device *, void *),
 62                        const struct component_master_ops *m_ops)
 63 {
 64         return -EINVAL;
 65 }
 66 
 67 static inline int drm_of_encoder_active_endpoint(struct device_node *node,
 68                                                  struct drm_encoder *encoder,
 69                                                  struct of_endpoint *endpoint)
 70 {
 71         return -EINVAL;
 72 }
 73 static inline int drm_of_find_panel_or_bridge(const struct device_node *np,
 74                                               int port, int endpoint,
 75                                               struct drm_panel **panel,
 76                                               struct drm_bridge **bridge)
 77 {
 78         return -EINVAL;
 79 }
 80 #endif
 81 
 82 /*
 83  * drm_of_panel_bridge_remove - remove panel bridge
 84  * @np: device tree node containing panel bridge output ports
 85  *
 86  * Remove the panel bridge of a given DT node's port and endpoint number
 87  *
 88  * Returns zero if successful, or one of the standard error codes if it fails.
 89  */
 90 static inline int drm_of_panel_bridge_remove(const struct device_node *np,
 91                                              int port, int endpoint)
 92 {
 93 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
 94         struct drm_bridge *bridge;
 95         struct device_node *remote;
 96 
 97         remote = of_graph_get_remote_node(np, port, endpoint);
 98         if (!remote)
 99                 return -ENODEV;
100 
101         bridge = of_drm_find_bridge(remote);
102         drm_panel_bridge_remove(bridge);
103 
104         return 0;
105 #else
106         return -EINVAL;
107 #endif
108 }
109 
110 static inline int drm_of_encoder_active_endpoint_id(struct device_node *node,
111                                                     struct drm_encoder *encoder)
112 {
113         struct of_endpoint endpoint;
114         int ret = drm_of_encoder_active_endpoint(node, encoder,
115                                                  &endpoint);
116 
117         return ret ?: endpoint.id;
118 }
119 
120 static inline int drm_of_encoder_active_port_id(struct device_node *node,
121                                                 struct drm_encoder *encoder)
122 {
123         struct of_endpoint endpoint;
124         int ret = drm_of_encoder_active_endpoint(node, encoder,
125                                                  &endpoint);
126 
127         return ret ?: endpoint.port;
128 }
129 
130 #endif /* __DRM_OF_H__ */
131 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp