aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx/parallel-display.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-03-29 14:55:46 -0400
committerSean Paul <seanpaul@chromium.org>2017-04-06 17:00:27 -0400
commitebc9446135671b89c2397f438af45d9cef0d1368 (patch)
treefa1bf0c176711e21ccec628699736eab39d4c552 /drivers/gpu/drm/imx/parallel-display.c
parent86418f90a4c1a0073db65d8a1e2bf94421117a60 (diff)
drm: convert drivers to use drm_of_find_panel_or_bridge
Similar to the previous commit, convert drivers open coding OF graph parsing to use drm_of_find_panel_or_bridge instead. This changes some error messages to debug messages (in the graph core). Graph connections are often "no connects" depending on the particular board, so we want to avoid spurious messages. Plus the kernel is not a DT validator. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Archit Taneja <architt@codeaurora.org> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> [seanpaul dropped rockchip changes since they're now obsolete] Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/imx/parallel-display.c')
-rw-r--r--drivers/gpu/drm/imx/parallel-display.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index d5c06fd89f90..636031a30e17 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -19,10 +19,10 @@
19#include <drm/drm_atomic_helper.h> 19#include <drm/drm_atomic_helper.h>
20#include <drm/drm_fb_helper.h> 20#include <drm/drm_fb_helper.h>
21#include <drm/drm_crtc_helper.h> 21#include <drm/drm_crtc_helper.h>
22#include <drm/drm_of.h>
22#include <drm/drm_panel.h> 23#include <drm/drm_panel.h>
23#include <linux/videodev2.h> 24#include <linux/videodev2.h>
24#include <video/of_display_timing.h> 25#include <video/of_display_timing.h>
25#include <linux/of_graph.h>
26 26
27#include "imx-drm.h" 27#include "imx-drm.h"
28 28
@@ -208,7 +208,6 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
208{ 208{
209 struct drm_device *drm = data; 209 struct drm_device *drm = data;
210 struct device_node *np = dev->of_node; 210 struct device_node *np = dev->of_node;
211 struct device_node *ep;
212 const u8 *edidp; 211 const u8 *edidp;
213 struct imx_parallel_display *imxpd; 212 struct imx_parallel_display *imxpd;
214 int ret; 213 int ret;
@@ -237,36 +236,9 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
237 imxpd->bus_format = bus_format; 236 imxpd->bus_format = bus_format;
238 237
239 /* port@1 is the output port */ 238 /* port@1 is the output port */
240 ep = of_graph_get_endpoint_by_regs(np, 1, -1); 239 ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel, &imxpd->bridge);
241 if (ep) { 240 if (ret)
242 struct device_node *remote; 241 return ret;
243
244 remote = of_graph_get_remote_port_parent(ep);
245 if (!remote) {
246 dev_warn(dev, "endpoint %s not connected\n",
247 ep->full_name);
248 of_node_put(ep);
249 return -ENODEV;
250 }
251 of_node_put(ep);
252
253 imxpd->panel = of_drm_find_panel(remote);
254 if (imxpd->panel) {
255 dev_dbg(dev, "found panel %s\n", remote->full_name);
256 } else {
257 imxpd->bridge = of_drm_find_bridge(remote);
258 if (imxpd->bridge)
259 dev_dbg(dev, "found bridge %s\n",
260 remote->full_name);
261 }
262 if (!imxpd->panel && !imxpd->bridge) {
263 dev_dbg(dev, "waiting for panel or bridge %s\n",
264 remote->full_name);
265 of_node_put(remote);
266 return -EPROBE_DEFER;
267 }
268 of_node_put(remote);
269 }
270 242
271 imxpd->dev = dev; 243 imxpd->dev = dev;
272 244