summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/fsl-dcu
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-03-29 21:55:46 +0300
committerSean Paul <seanpaul@chromium.org>2017-04-07 00:00:27 +0300
commitebc9446135671b89c2397f438af45d9cef0d1368 (patch)
treefa1bf0c176711e21ccec628699736eab39d4c552 /drivers/gpu/drm/fsl-dcu
parent86418f90a4c1a0073db65d8a1e2bf94421117a60 (diff)
downloadlinux-ebc9446135671b89c2397f438af45d9cef0d1368.tar.xz
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/fsl-dcu')
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
index c3651456c963..dcbf3c06e1d8 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
@@ -15,6 +15,7 @@
#include <drm/drmP.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include "fsl_dcu_drm_drv.h"
@@ -141,32 +142,11 @@ err_cleanup:
return ret;
}
-static int fsl_dcu_attach_endpoint(struct fsl_dcu_drm_device *fsl_dev,
- const struct of_endpoint *ep)
-{
- struct drm_bridge *bridge;
- struct device_node *np;
-
- np = of_graph_get_remote_port_parent(ep->local_node);
-
- fsl_dev->connector.panel = of_drm_find_panel(np);
- if (fsl_dev->connector.panel) {
- of_node_put(np);
- return fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel);
- }
-
- bridge = of_drm_find_bridge(np);
- of_node_put(np);
- if (!bridge)
- return -ENODEV;
-
- return drm_bridge_attach(&fsl_dev->encoder, bridge, NULL);
-}
-
int fsl_dcu_create_outputs(struct fsl_dcu_drm_device *fsl_dev)
{
- struct of_endpoint ep;
- struct device_node *ep_node, *panel_node;
+ struct device_node *panel_node;
+ struct drm_panel *panel;
+ struct drm_bridge *bridge;
int ret;
/* This is for backward compatibility */
@@ -179,14 +159,14 @@ int fsl_dcu_create_outputs(struct fsl_dcu_drm_device *fsl_dev)
return fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel);
}
- ep_node = of_graph_get_next_endpoint(fsl_dev->np, NULL);
- if (!ep_node)
- return -ENODEV;
-
- ret = of_graph_parse_endpoint(ep_node, &ep);
- of_node_put(ep_node);
+ ret = drm_of_find_panel_or_bridge(fsl_dev->np, 0, 0, &panel, &bridge);
if (ret)
- return -ENODEV;
+ return ret;
+
+ if (panel) {
+ fsl_dev->connector.panel = panel;
+ return fsl_dcu_attach_panel(fsl_dev, panel);
+ }
- return fsl_dcu_attach_endpoint(fsl_dev, &ep);
+ return drm_bridge_attach(&fsl_dev->encoder, bridge, NULL);
}