drm/imx: imx-ldb: add drm_panel support
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 6 Mar 2014 13:54:39 +0000 (14:54 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 31 Mar 2015 10:44:49 +0000 (12:44 +0200)
commit751e2676ee9272a0fbde6566afde33c1106d7da1
treedb63630644c046470a78af04a0ee81d5a46d5512
parent2872c8072aae65fa55cafea50e73d69d423df168
drm/imx: imx-ldb: add drm_panel support

This patch allows to optionally attach the lvds-channel to a panel
supported by a drm_panel driver using of-graph bindings, instead of
supplying the modes via display-timings in the device tree.

This depends on of_graph_get_port_by_id and uses the OF graph to
link the optional DRM panel to the LDB lvds-channel. The output
port number is 1 on devices without the 4-port input multiplexer
(i.MX5) and 4 on devices with the mux (i.MX6).

Before:

ldb {
...

lvds-channel@0 {
...

display-timings {
native-timing = <&timing1>;
timing1: etm0700g0dh6 {
hactive = <800>;
vactive = <480>;
clock-frequency = <33260000>;
hsync-len = <128>;
hback-porch = <88>;
hfront-porch = <40>;
vsync-len = <2>;
vback-porch = <33>;
vfront-porch = <10>;
hsync-active = <0>;
vsync-active = <0>;
...
};
};
...
};
};

After:
ldb {
...

lvds-channel@0 {
...

port@4 {
reg = <4>;

lvds_out: endpoint {
remote_endpoint = <&panel_in>;
};
};
};
};

panel {
compatible = "edt,etm0700g0dh6", "simple-panel";
...

port {
panel_in: endpoint {
remote-endpoint = <&lvds_out>;
};
};
};

[Fixed build error due to missing select on DRM_PANEL --rmk]
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Documentation/devicetree/bindings/drm/imx/ldb.txt
drivers/gpu/drm/imx/Kconfig
drivers/gpu/drm/imx/imx-ldb.c