aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx/parallel-display.c
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2015-05-19 10:28:12 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2015-07-10 05:02:31 -0400
commit553a59fc8f5d51c3824c0b7d4ca61e780157defa (patch)
treeb5b80b474ee5dfc990c129665aaa74be2f9a874e /drivers/gpu/drm/imx/parallel-display.c
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff)
drm/imx: parallel-display: fix drm_panel support
The parallel-display driver used an undocumented, non-standard property "fsl,panel" to optionally associate with a drm_panel device. This patch fixes the driver to use the same OF graph bindings as the LDB driver instead: parallel-display { compatible = "fsl,imx-parallel-display"; ... port@1 { reg = <1>; parallel_out: endpoint { remote_endpoint = <&panel_in>; }; }; }; panel { ... port { panel_in: endpoint { remote-endpoint = <&parallel_out>; }; }; }; Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Gary Bisson <gary.bisson@boundarydevices.com>
Diffstat (limited to 'drivers/gpu/drm/imx/parallel-display.c')
-rw-r--r--drivers/gpu/drm/imx/parallel-display.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index 74a9ce40ddc4..b4deb9cf9d71 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -21,6 +21,7 @@
21#include <drm/drm_panel.h> 21#include <drm/drm_panel.h>
22#include <linux/videodev2.h> 22#include <linux/videodev2.h>
23#include <video/of_display_timing.h> 23#include <video/of_display_timing.h>
24#include <linux/of_graph.h>
24 25
25#include "imx-drm.h" 26#include "imx-drm.h"
26 27
@@ -208,7 +209,7 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
208{ 209{
209 struct drm_device *drm = data; 210 struct drm_device *drm = data;
210 struct device_node *np = dev->of_node; 211 struct device_node *np = dev->of_node;
211 struct device_node *panel_node; 212 struct device_node *port;
212 const u8 *edidp; 213 const u8 *edidp;
213 struct imx_parallel_display *imxpd; 214 struct imx_parallel_display *imxpd;
214 int ret; 215 int ret;
@@ -234,11 +235,19 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
234 imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; 235 imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
235 } 236 }
236 237
237 panel_node = of_parse_phandle(np, "fsl,panel", 0); 238 /* port@1 is the output port */
238 if (panel_node) { 239 port = of_graph_get_port_by_id(np, 1);
239 imxpd->panel = of_drm_find_panel(panel_node); 240 if (port) {
240 if (!imxpd->panel) 241 struct device_node *endpoint, *remote;
241 return -EPROBE_DEFER; 242
243 endpoint = of_get_child_by_name(port, "endpoint");
244 if (endpoint) {
245 remote = of_graph_get_remote_port_parent(endpoint);
246 if (remote)
247 imxpd->panel = of_drm_find_panel(remote);
248 if (!imxpd->panel)
249 return -EPROBE_DEFER;
250 }
242 } 251 }
243 252
244 imxpd->dev = dev; 253 imxpd->dev = dev;