diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-07-23 12:13:12 -0400 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-07-23 12:13:12 -0400 |
commit | c74a7469f97c0f40b46e82ee979f9fb1bb6e847c (patch) | |
tree | f2690a1a916b73ef94657fbf0e0141ae57701825 /drivers/gpu/drm/drm_of.c | |
parent | 6f15a7de86c8cf2dc09fc9e6d07047efa40ef809 (diff) | |
parent | 500775074f88d9cf5416bed2ca19592812d62c41 (diff) |
Merge drm/drm-next into drm-intel-next-queued
We need a backmerge to get DP_DPCD_REV_14 before we push other
i915 changes to dinq that could break compilation.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_of.c')
-rw-r--r-- | drivers/gpu/drm/drm_of.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 1fe122461298..2763a5ec845b 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c | |||
@@ -9,21 +9,28 @@ | |||
9 | #include <drm/drm_panel.h> | 9 | #include <drm/drm_panel.h> |
10 | #include <drm/drm_of.h> | 10 | #include <drm/drm_of.h> |
11 | 11 | ||
12 | /** | ||
13 | * DOC: overview | ||
14 | * | ||
15 | * A set of helper functions to aid DRM drivers in parsing standard DT | ||
16 | * properties. | ||
17 | */ | ||
18 | |||
12 | static void drm_release_of(struct device *dev, void *data) | 19 | static void drm_release_of(struct device *dev, void *data) |
13 | { | 20 | { |
14 | of_node_put(data); | 21 | of_node_put(data); |
15 | } | 22 | } |
16 | 23 | ||
17 | /** | 24 | /** |
18 | * drm_crtc_port_mask - find the mask of a registered CRTC by port OF node | 25 | * drm_of_crtc_port_mask - find the mask of a registered CRTC by port OF node |
19 | * @dev: DRM device | 26 | * @dev: DRM device |
20 | * @port: port OF node | 27 | * @port: port OF node |
21 | * | 28 | * |
22 | * Given a port OF node, return the possible mask of the corresponding | 29 | * Given a port OF node, return the possible mask of the corresponding |
23 | * CRTC within a device's list of CRTCs. Returns zero if not found. | 30 | * CRTC within a device's list of CRTCs. Returns zero if not found. |
24 | */ | 31 | */ |
25 | static uint32_t drm_crtc_port_mask(struct drm_device *dev, | 32 | uint32_t drm_of_crtc_port_mask(struct drm_device *dev, |
26 | struct device_node *port) | 33 | struct device_node *port) |
27 | { | 34 | { |
28 | unsigned int index = 0; | 35 | unsigned int index = 0; |
29 | struct drm_crtc *tmp; | 36 | struct drm_crtc *tmp; |
@@ -37,6 +44,7 @@ static uint32_t drm_crtc_port_mask(struct drm_device *dev, | |||
37 | 44 | ||
38 | return 0; | 45 | return 0; |
39 | } | 46 | } |
47 | EXPORT_SYMBOL(drm_of_crtc_port_mask); | ||
40 | 48 | ||
41 | /** | 49 | /** |
42 | * drm_of_find_possible_crtcs - find the possible CRTCs for an encoder port | 50 | * drm_of_find_possible_crtcs - find the possible CRTCs for an encoder port |
@@ -62,7 +70,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, | |||
62 | return 0; | 70 | return 0; |
63 | } | 71 | } |
64 | 72 | ||
65 | possible_crtcs |= drm_crtc_port_mask(dev, remote_port); | 73 | possible_crtcs |= drm_of_crtc_port_mask(dev, remote_port); |
66 | 74 | ||
67 | of_node_put(remote_port); | 75 | of_node_put(remote_port); |
68 | } | 76 | } |
@@ -93,7 +101,7 @@ EXPORT_SYMBOL_GPL(drm_of_component_match_add); | |||
93 | * drm_of_component_probe - Generic probe function for a component based master | 101 | * drm_of_component_probe - Generic probe function for a component based master |
94 | * @dev: master device containing the OF node | 102 | * @dev: master device containing the OF node |
95 | * @compare_of: compare function used for matching components | 103 | * @compare_of: compare function used for matching components |
96 | * @master_ops: component master ops to be used | 104 | * @m_ops: component master ops to be used |
97 | * | 105 | * |
98 | * Parse the platform device OF node and bind all the components associated | 106 | * Parse the platform device OF node and bind all the components associated |
99 | * with the master. Interface ports are added before the encoders in order to | 107 | * with the master. Interface ports are added before the encoders in order to |
@@ -238,10 +246,17 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, | |||
238 | if (!remote) | 246 | if (!remote) |
239 | return -ENODEV; | 247 | return -ENODEV; |
240 | 248 | ||
249 | if (!of_device_is_available(remote)) { | ||
250 | of_node_put(remote); | ||
251 | return -ENODEV; | ||
252 | } | ||
253 | |||
241 | if (panel) { | 254 | if (panel) { |
242 | *panel = of_drm_find_panel(remote); | 255 | *panel = of_drm_find_panel(remote); |
243 | if (*panel) | 256 | if (!IS_ERR(*panel)) |
244 | ret = 0; | 257 | ret = 0; |
258 | else | ||
259 | *panel = NULL; | ||
245 | } | 260 | } |
246 | 261 | ||
247 | /* No panel found yet, check for a bridge next. */ | 262 | /* No panel found yet, check for a bridge next. */ |