* [PATCH] drm/imx: parallel-display: fix drm_panel support
@ 2015-05-19 14:28 Philipp Zabel
[not found] ` <1432045692-2458-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Philipp Zabel @ 2015-05-19 14:28 UTC (permalink / raw)
To: dri-devel
Cc: Mark Rutland, devicetree, Pawel Moll, Ian Campbell, Rob Herring,
kernel, Kumar Gala
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 = <¶llel_out>;
};
};
};
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
.../devicetree/bindings/drm/imx/fsl-imx-drm.txt | 26 ++++++++++++++++++++--
drivers/gpu/drm/imx/parallel-display.c | 21 ++++++++++++-----
2 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/drm/imx/fsl-imx-drm.txt b/Documentation/devicetree/bindings/drm/imx/fsl-imx-drm.txt
index f349703..29c0467 100644
--- a/Documentation/devicetree/bindings/drm/imx/fsl-imx-drm.txt
+++ b/Documentation/devicetree/bindings/drm/imx/fsl-imx-drm.txt
@@ -65,8 +65,10 @@ Optional properties:
- edid: verbatim EDID data block describing attached display.
- ddc: phandle describing the i2c bus handling the display data
channel
-- port: A port node with endpoint definitions as defined in
+- port@[0-1]: Port nodes with endpoint definitions as defined in
Documentation/devicetree/bindings/media/video-interfaces.txt.
+ Port 0 is the input port connected to the IPU display interface,
+ port 1 is the output port connected to a panel.
example:
@@ -75,9 +77,29 @@ display@di0 {
edid = [edid-data];
interface-pix-fmt = "rgb24";
- port {
+ port@0 {
+ reg = <0>;
+
display_in: endpoint {
remote-endpoint = <&ipu_di0_disp0>;
};
};
+
+ port@1 {
+ reg = <1>;
+
+ display_out: endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+};
+
+panel {
+ ...
+
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&display_out>;
+ };
+ };
};
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index 78db5d4..c663099 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -21,6 +21,7 @@
#include <drm/drm_panel.h>
#include <linux/videodev2.h>
#include <video/of_display_timing.h>
+#include <linux/of_graph.h>
#include "imx-drm.h"
@@ -216,7 +217,7 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
{
struct drm_device *drm = data;
struct device_node *np = dev->of_node;
- struct device_node *panel_node;
+ struct device_node *port;
const u8 *edidp;
struct imx_parallel_display *imxpd;
int ret;
@@ -245,11 +246,19 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
imxpd->interface_pix_fmt = V4L2_PIX_FMT_BGR24;
}
- panel_node = of_parse_phandle(np, "fsl,panel", 0);
- if (panel_node) {
- imxpd->panel = of_drm_find_panel(panel_node);
- if (!imxpd->panel)
- return -EPROBE_DEFER;
+ /* port@1 is the output port */
+ port = of_graph_get_port_by_id(np, 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)
+ imxpd->panel = of_drm_find_panel(remote);
+ if (!imxpd->panel)
+ return -EPROBE_DEFER;
+ }
}
imxpd->dev = dev;
--
2.1.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: drm/imx: parallel-display: fix drm_panel support
[not found] ` <1432045692-2458-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2015-07-09 18:22 ` Gary Bisson
2015-07-14 9:53 ` Philipp Zabel
0 siblings, 1 reply; 3+ messages in thread
From: Gary Bisson @ 2015-07-09 18:22 UTC (permalink / raw)
To: Philipp Zabel
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Mark Rutland,
devicetree-u79uwXL29TY76Z2rM5mHXA, Pawel Moll, Ian Campbell,
Rob Herring, kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Kumar Gala
Hi Philipp
On Tue, May 19, 2015 at 04:28:12PM +0200, Philipp Zabel wrote:
> 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 = <¶llel_out>;
> };
> };
> };
>
> Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>
> ---
Tested on Nitrogen6x and Sabrelite using a Okaya RS800480T-7X0GP
display. Below are the different patches submitted that make use of this
change:
https://patchwork.kernel.org/patch/6585541/
https://patchwork.kernel.org/patch/6585551/
https://patchwork.kernel.org/patch/6504711/
https://patchwork.kernel.org/patch/6504731/
Tested-by: Gary Bisson <gary.bisson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
Regards,
Gary
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: drm/imx: parallel-display: fix drm_panel support
2015-07-09 18:22 ` Gary Bisson
@ 2015-07-14 9:53 ` Philipp Zabel
0 siblings, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2015-07-14 9:53 UTC (permalink / raw)
To: Gary Bisson
Cc: Mark Rutland, devicetree, Pawel Moll, Ian Campbell, dri-devel,
Rob Herring, kernel, Kumar Gala
Hi Gary,
Am Donnerstag, den 09.07.2015, 20:22 +0200 schrieb Gary Bisson:
[...]
> Tested on Nitrogen6x and Sabrelite using a Okaya RS800480T-7X0GP
> display. Below are the different patches submitted that make use of this
> change:
> https://patchwork.kernel.org/patch/6585541/
> https://patchwork.kernel.org/patch/6585551/
> https://patchwork.kernel.org/patch/6504711/
> https://patchwork.kernel.org/patch/6504731/
>
> Tested-by: Gary Bisson <gary.bisson@boundarydevices.com>
Thank you for testing, I have sent a pull request that includes this
patch.
regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-14 9:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 14:28 [PATCH] drm/imx: parallel-display: fix drm_panel support Philipp Zabel
[not found] ` <1432045692-2458-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-07-09 18:22 ` Gary Bisson
2015-07-14 9:53 ` Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).