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

TOMOYO Linux Cross Reference
Linux/include/drm/drm_of.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 #ifndef __DRM_OF_H__
  3 #define __DRM_OF_H__
  4 
  5 #include <linux/err.h>
  6 #include <linux/of_graph.h>
  7 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
  8 #include <drm/drm_bridge.h>
  9 #endif
 10 
 11 struct component_master_ops;
 12 struct component_match;
 13 struct device;
 14 struct drm_device;
 15 struct drm_encoder;
 16 struct drm_panel;
 17 struct drm_bridge;
 18 struct device_node;
 19 struct mipi_dsi_device_info;
 20 struct mipi_dsi_host;
 21 
 22 /**
 23  * enum drm_lvds_dual_link_pixels - Pixel order of an LVDS dual-link connection
 24  * @DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS: Even pixels are expected to be generated
 25  *    from the first port, odd pixels from the second port
 26  * @DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS: Odd pixels are expected to be generated
 27  *    from the first port, even pixels from the second port
 28  */
 29 enum drm_lvds_dual_link_pixels {
 30         DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS = 0,
 31         DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS = 1,
 32 };
 33 
 34 #ifdef CONFIG_OF
 35 uint32_t drm_of_crtc_port_mask(struct drm_device *dev,
 36                             struct device_node *port);
 37 uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 38                                     struct device_node *port);
 39 void drm_of_component_match_add(struct device *master,
 40                                 struct component_match **matchptr,
 41                                 int (*compare)(struct device *, void *),
 42                                 struct device_node *node);
 43 int drm_of_component_probe(struct device *dev,
 44                            int (*compare_of)(struct device *, void *),
 45                            const struct component_master_ops *m_ops);
 46 int drm_of_encoder_active_endpoint(struct device_node *node,
 47                                    struct drm_encoder *encoder,
 48                                    struct of_endpoint *endpoint);
 49 int drm_of_find_panel_or_bridge(const struct device_node *np,
 50                                 int port, int endpoint,
 51                                 struct drm_panel **panel,
 52                                 struct drm_bridge **bridge);
 53 int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1,
 54                                           const struct device_node *port2);
 55 int drm_of_lvds_get_data_mapping(const struct device_node *port);
 56 int drm_of_get_data_lanes_count(const struct device_node *endpoint,
 57                                 const unsigned int min, const unsigned int max);
 58 int drm_of_get_data_lanes_count_ep(const struct device_node *port,
 59                                    int port_reg, int reg,
 60                                    const unsigned int min,
 61                                    const unsigned int max);
 62 #else
 63 static inline uint32_t drm_of_crtc_port_mask(struct drm_device *dev,
 64                                           struct device_node *port)
 65 {
 66         return 0;
 67 }
 68 
 69 static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 70                                                   struct device_node *port)
 71 {
 72         return 0;
 73 }
 74 
 75 static inline void
 76 drm_of_component_match_add(struct device *master,
 77                            struct component_match **matchptr,
 78                            int (*compare)(struct device *, void *),
 79                            struct device_node *node)
 80 {
 81 }
 82 
 83 static inline int
 84 drm_of_component_probe(struct device *dev,
 85                        int (*compare_of)(struct device *, void *),
 86                        const struct component_master_ops *m_ops)
 87 {
 88         return -EINVAL;
 89 }
 90 
 91 static inline int drm_of_encoder_active_endpoint(struct device_node *node,
 92                                                  struct drm_encoder *encoder,
 93                                                  struct of_endpoint *endpoint)
 94 {
 95         return -EINVAL;
 96 }
 97 static inline int drm_of_find_panel_or_bridge(const struct device_node *np,
 98                                               int port, int endpoint,
 99                                               struct drm_panel **panel,
100                                               struct drm_bridge **bridge)
101 {
102         return -EINVAL;
103 }
104 
105 static inline int
106 drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1,
107                                       const struct device_node *port2)
108 {
109         return -EINVAL;
110 }
111 
112 static inline int
113 drm_of_lvds_get_data_mapping(const struct device_node *port)
114 {
115         return -EINVAL;
116 }
117 
118 static inline int
119 drm_of_get_data_lanes_count(const struct device_node *endpoint,
120                             const unsigned int min, const unsigned int max)
121 {
122         return -EINVAL;
123 }
124 
125 static inline int
126 drm_of_get_data_lanes_count_ep(const struct device_node *port,
127                                int port_reg, int reg,
128                                const unsigned int min,
129                                const unsigned int max)
130 {
131         return -EINVAL;
132 }
133 #endif
134 
135 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_MIPI_DSI)
136 struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev);
137 #else
138 static inline struct
139 mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev)
140 {
141         return ERR_PTR(-EINVAL);
142 }
143 #endif /* CONFIG_OF && CONFIG_DRM_MIPI_DSI */
144 
145 /*
146  * drm_of_panel_bridge_remove - remove panel bridge
147  * @np: device tree node containing panel bridge output ports
148  *
149  * Remove the panel bridge of a given DT node's port and endpoint number
150  *
151  * Returns zero if successful, or one of the standard error codes if it fails.
152  */
153 static inline int drm_of_panel_bridge_remove(const struct device_node *np,
154                                              int port, int endpoint)
155 {
156 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
157         struct drm_bridge *bridge;
158         struct device_node *remote;
159 
160         remote = of_graph_get_remote_node(np, port, endpoint);
161         if (!remote)
162                 return -ENODEV;
163 
164         bridge = of_drm_find_bridge(remote);
165         drm_panel_bridge_remove(bridge);
166 
167         return 0;
168 #else
169         return -EINVAL;
170 #endif
171 }
172 
173 static inline int drm_of_encoder_active_endpoint_id(struct device_node *node,
174                                                     struct drm_encoder *encoder)
175 {
176         struct of_endpoint endpoint;
177         int ret = drm_of_encoder_active_endpoint(node, encoder,
178                                                  &endpoint);
179 
180         return ret ?: endpoint.id;
181 }
182 
183 static inline int drm_of_encoder_active_port_id(struct device_node *node,
184                                                 struct drm_encoder *encoder)
185 {
186         struct of_endpoint endpoint;
187         int ret = drm_of_encoder_active_endpoint(node, encoder,
188                                                  &endpoint);
189 
190         return ret ?: endpoint.port;
191 }
192 
193 #endif /* __DRM_OF_H__ */
194 

~ [ 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