crypto: atmel-sha - remove unnecessary static in atmel_sha_remove()
[linux-stable.git] / include / drm / drm_of.h
blob104dd517fdbe032d4f0f5a87e96b64efbfe4b6b5
1 #ifndef __DRM_OF_H__
2 #define __DRM_OF_H__
4 #include <linux/of_graph.h>
6 struct component_master_ops;
7 struct component_match;
8 struct device;
9 struct drm_device;
10 struct drm_encoder;
11 struct drm_panel;
12 struct drm_bridge;
13 struct device_node;
15 #ifdef CONFIG_OF
16 uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
17 struct device_node *port);
18 void drm_of_component_match_add(struct device *master,
19 struct component_match **matchptr,
20 int (*compare)(struct device *, void *),
21 struct device_node *node);
22 int drm_of_component_probe(struct device *dev,
23 int (*compare_of)(struct device *, void *),
24 const struct component_master_ops *m_ops);
25 int drm_of_encoder_active_endpoint(struct device_node *node,
26 struct drm_encoder *encoder,
27 struct of_endpoint *endpoint);
28 int drm_of_find_panel_or_bridge(const struct device_node *np,
29 int port, int endpoint,
30 struct drm_panel **panel,
31 struct drm_bridge **bridge);
32 #else
33 static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
34 struct device_node *port)
36 return 0;
39 static inline void
40 drm_of_component_match_add(struct device *master,
41 struct component_match **matchptr,
42 int (*compare)(struct device *, void *),
43 struct device_node *node)
47 static inline int
48 drm_of_component_probe(struct device *dev,
49 int (*compare_of)(struct device *, void *),
50 const struct component_master_ops *m_ops)
52 return -EINVAL;
55 static inline int drm_of_encoder_active_endpoint(struct device_node *node,
56 struct drm_encoder *encoder,
57 struct of_endpoint *endpoint)
59 return -EINVAL;
61 static inline int drm_of_find_panel_or_bridge(const struct device_node *np,
62 int port, int endpoint,
63 struct drm_panel **panel,
64 struct drm_bridge **bridge)
66 return -EINVAL;
68 #endif
70 static inline int drm_of_encoder_active_endpoint_id(struct device_node *node,
71 struct drm_encoder *encoder)
73 struct of_endpoint endpoint;
74 int ret = drm_of_encoder_active_endpoint(node, encoder,
75 &endpoint);
77 return ret ?: endpoint.id;
80 static inline int drm_of_encoder_active_port_id(struct device_node *node,
81 struct drm_encoder *encoder)
83 struct of_endpoint endpoint;
84 int ret = drm_of_encoder_active_endpoint(node, encoder,
85 &endpoint);
87 return ret ?: endpoint.port;
90 #endif /* __DRM_OF_H__ */