Re: [PATCH 2/2] imx-drm: imx-ldb: Use OF graph to find connected panel

2014-03-07 Thread Russell King - ARM Linux
On Thu, Mar 06, 2014 at 02:54:40PM +0100, Philipp Zabel wrote:
 @@ -566,9 +566,18 @@ static int imx_ldb_bind(struct device *dev, struct 
 device *master, void *data)
   return -EINVAL;
   }
  
 - panel_node = of_parse_phandle(child, fsl,panel, 0);
 - if (panel_node)
 - channel-panel = of_drm_find_panel(panel_node);
 + /* The output port is port@4 with mux or port@1 without mux */
 + port = of_graph_get_port_by_id(child, imx_ldb-lvds_mux ? 4 : 
 1);

I guess we're holding off on these two patches while the last bits of
the of-graph get sorted - the above function doesn't currently exist
so causes a build failure.

Thanks.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] imx-drm: imx-ldb: Use OF graph to find connected panel

2014-03-06 Thread Philipp Zabel
This patch depends on the OF graph parsing helper and imx-drm-dt series.
It allows to connect the panel to the output port (port@1 on i.MX53, port@4
on i.MX6) via the OF graph bindings.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/staging/imx-drm/imx-ldb.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index 38a0795..4d1446a 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -27,8 +27,8 @@
 #include drm/drm_panel.h
 #include linux/mfd/syscon.h
 #include linux/mfd/syscon/imx6q-iomuxc-gpr.h
-#include linux/of_address.h
 #include linux/of_device.h
+#include linux/of_graph.h
 #include video/of_videomode.h
 #include linux/regmap.h
 #include linux/videodev2.h
@@ -506,7 +506,7 @@ static int imx_ldb_bind(struct device *dev, struct device 
*master, void *data)
 
for_each_child_of_node(np, child) {
struct imx_ldb_channel *channel;
-   struct device_node *panel_node;
+   struct device_node *port;
 
ret = of_property_read_u32(child, reg, i);
if (ret || i  0 || i  1)
@@ -566,9 +566,18 @@ static int imx_ldb_bind(struct device *dev, struct device 
*master, void *data)
return -EINVAL;
}
 
-   panel_node = of_parse_phandle(child, fsl,panel, 0);
-   if (panel_node)
-   channel-panel = of_drm_find_panel(panel_node);
+   /* The output port is port@4 with mux or port@1 without mux */
+   port = of_graph_get_port_by_id(child, imx_ldb-lvds_mux ? 4 : 
1);
+   if (port) {
+   struct device_node *endpoint, *remote;
+
+   endpoint = of_get_child_by_name(port, endpoint);
+   if (endpoint) {
+   remote = 
of_graph_get_remote_port_parent(endpoint);
+   if (remote)
+   channel-panel = 
of_drm_find_panel(remote);
+   }
+   }
 
ret = imx_ldb_register(drm, channel);
if (ret)
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] imx-drm: imx-ldb: Use OF graph to find connected panel

2014-03-06 Thread Philipp Zabel
Am Donnerstag, den 06.03.2014, 14:54 +0100 schrieb Philipp Zabel:
 This patch depends on the OF graph parsing helper and imx-drm-dt series.
 It allows to connect the panel to the output port (port@1 on i.MX53, port@4
 on i.MX6) via the OF graph bindings.

If we postpone this until the imx-drm-dt binding series gets accepted, I
can just squash the two patches together.

regards
Philipp

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel