drm/exynos: dp: add of_graph dt binding support for panel
Subsystems (5)
Inki Dae
maintainerPATCH v2 1/2 drm/exynos: dp: add of_graph dt binding support for panel
This patch adds of_graph dt binding support for panel device and also keeps the backward compatibility.
i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.
Changelog v2:
- return -EINVAL if getting a port node failed.
--- drivers/gpu/drm/exynos/exynos_dp_core.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +19 -2
@@ -1392,7 +1392,7 @@ static const struct component_ops exynos_dp_ops = {static int exynos_dp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct device_node *panel_node, *bridge_node, *endpoint; +struct device_node *panel_node =NULL , *bridge_node, *endpoint =NULL ;struct exynos_dp_device *dp;int ret;
@@ -1403,15 +1403,32 @@ static int exynos_dp_probe(struct platform_device *pdev)platform_set_drvdata (pdev, dp); +/* This is for the backward compatibility. */ panel_node =of_parse_phandle (dev->of_node,"panel" ,0 );if (panel_node) { dp->panel =of_drm_find_panel (panel_node);of_node_put (panel_node);if (!dp->panel)return -EPROBE_DEFER ; + }else { + endpoint =of_graph_get_next_endpoint (dev->of_node,NULL ); +if (endpoint) { + panel_node =of_graph_get_remote_port_parent (endpoint); +if (panel_node) { + dp->panel =of_drm_find_panel (panel_node); +of_node_put (panel_node); +if (!dp->panel) +return -EPROBE_DEFER ; + }else { +DRM_ERROR ("no port node for panel device.\n" ); +return -EINVAL ; + } + } } - endpoint =of_graph_get_next_endpoint (dev->of_node,NULL ); + panel_node = !endpoint ?NULL : panel_node; + + endpoint =of_graph_get_next_endpoint (dev->of_node, panel_node);if (endpoint) { bridge_node =of_graph_get_remote_port_parent (endpoint);if (bridge_node) {
Signature · 1 line
1.9.1
Inki Dae
maintainerPATCH v2 2/2 drm/exynos: dp: fix wrong return type
This patch fixes wrong return type when dt binding of bridge device failed.
If a board has a bridge device then of_graph_get_remote_port_parent function shouldn't be NULL. So this patch will return a proper error type so that the deferred probe isn't triggered.
Changelog v2:
- return -EINVAL if getting a port node failed.
--- drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +4 -2
@@ -1436,8 +1436,10 @@ static int exynos_dp_probe(struct platform_device *pdev)of_node_put (bridge_node);if (!dp->ptn_bridge)return -EPROBE_DEFER ; - }else -return -EPROBE_DEFER ; + }else { +DRM_ERROR ("no port node for bridge device.\n" ); +return -EINVAL ; + } }pm_runtime_enable (dev);
Signature · 1 line
1.9.1
Re: [PATCH v2 2/2] drm/exynos: dp: fix wrong return type
Hello Inki,
Quoted 7 lines · Inki Dae
This patch fixes wrong return type when dt binding of bridge device failed.
If a board has a bridge device then
of_graph_get_remote_port_parentfunction shouldn't be NULL. So this patch will return a proper error type so that the deferred probe isn't triggered.
Quoted 5 lines
Changelog v2:
- return-EINVALif getting a port node failed.Signed-off-by Inki Dae <[email protected]>---
Best regards
Signature · 3 lines
Javier Martinez Canillas Open Source Group Samsung Research America
Hello Inki,
Quoted 3 lines · Inki Dae
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.
You have to also update the DT binding doc which seems to be outdated already:
Documentation/devicetree/bindings/display/exynos/exynos_dp.txt
Quoted 4 lines
i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.
How did you test this patch?
Best regards,
Signature · 7 lines
Javier Martinez Canillas Open Source Group Samsung Research America _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerHi Javier,
2015년 12월 03일 00:04에 Javier Martinez Canillas 이(가) 쓴 글:
Quoted 11 lines
Hello Inki,
Quoted 3 lines · Inki Dae
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.You have to also update the DT binding doc which seems to be outdated already:
Documentation/devicetree/bindings/display/exynos/exynos_dp.txt
Right. It should be updated.
Quoted 7 lines
Quoted 5 lines
i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.How did you test this patch?
I thought you will test it and give me tested-by because you commented like below, " Assuming you can make a distinction if the endpoint is a panel or a bridge, then yes, I agree with the idea of the patch. Please feel free to cc me if you post such a patch and I'll gladly test it on my Exynos5800 Peach Pi."
That is why I cced you. I really have no any Exynos5800 Peach Pi board.
Thanks,
Inki Dae
Quoted 3 lines
Best regards,
Hello Inki,
Quoted 10 lines · Inki Dae
Hi Javier,
2015년 12월 03일 00:04에 Javier Martinez Canillas 이(가) 쓴 글:
Quoted 7 lines
Hello Inki,
Quoted 3 lines · Inki Dae
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.
Quoted 7 lines
Quoted 4 lines
You have to also update the DT binding doc which seems to be outdated already:
Documentation/devicetree/bindings/display/exynos/exynos_dp.txtRight. It should be updated.
Great, I see you already posted that.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.
Quoted 9 lines
Quoted 1 line
How did you test this patch?
I thought you will test it and give me tested-by because you commented like below, " Assuming you can make a distinction if the endpoint is a panel or a bridge, then yes, I agree with the idea of the patch. Please feel free to cc me if you post such a patch and I'll gladly test it on my Exynos5800 Peach Pi."
That is why I cced you. I really have no any Exynos5800 Peach Pi board.
Yes, but if you didn't test a patch, then it should be marked with a RFT prefix in the subject line or at least mention that needs testing since you lack the HW to test. I've no way to know if you have another board with a similar design :)
But what I meant is how the patch is supposed to be tested since there ins't a change in the Exynos5800 Peach Pi DTS? We can of course test that doesn't break backward compatibility but we don't have a way to test the actual change.
So I tested with the patch following patch [0] and things are working correctly. Please include that patch in your series.
I've some comments on your patch though but I'll comment on your lastest version.
Quoted 6 lines
Thanks,
Inki DaeQuoted 3 lines
Best regards,
Best regards,
Signature · 25 lines
Javier Martinez Canillas Open Source Group Samsung Research America [0]: From 644bab7949ac17a8d42ca0cf36cd55d61bc88928 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas <[email protected]> Date: Thu, 3 Dec 2015 09:32:17 -0300 Subject: [PATCH 1/1] ARM: dts: Use OF graph for DP to panel connection in exynos5800-peach-pi The DT binding for the Exynos DRM Display Port (DP) driver isn't consistent since it uses a phandle to describe the connection between the DP port and the display panel but uses the OF graph ports and endpoints to describe the connection betwen the DP port, a bridge chip and the panel. The Exynos DP driver and the DT binding have been changed to allow also to describe the DP port to panel connection using ports / endpoints (OF graph) so this patch changes the Exynos5800 Peach Pi DT to make it consistent with the Exynos5420 Peach Pit that has a eDP to LVDS chip and uses OF graph too. Signed-off-by: Javier Martinez Canillas <[email protected]> --- arch/arm/boot/dts/exynos5800-peach-pi.dts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
arch/arm/boot/dts/exynos5800-peach-pi.dts +14 -1
@@ -122,6 +122,12 @@ compatible = "auo,b133htn01"; power-supply = <&tps65090_fet6>; backlight = <&backlight>; + + port { + panel_in: endpoint { + remote-endpoint = <&dp_out>; + }; + }; }; mmc1_pwrseq: mmc1_pwrseq {
@@ -148,7 +154,14 @@ samsung,link-rate = <0x0a>; samsung,lane-count = <2>; samsung,hpd-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>; - panel = <&panel>; + + ports { + port@0 { + dp_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; }; &fimd {
Signature · 1 line
2.4.3
Hi Javier,
2015-12-03 22:05 GMT+09:00 Javier Martinez Canillas <[email protected]>:
Quoted 45 lines
Hello Inki,
Quoted 10 lines · Inki Dae
Hi Javier,
2015년 12월 03일 00:04에 Javier Martinez Canillas 이(가) 쓴 글:
Quoted 7 lines
Hello Inki,
Quoted 3 lines · Inki Dae
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.Quoted 7 lines
Quoted 4 lines
You have to also update the DT binding doc which seems to be outdated already:
Documentation/devicetree/bindings/display/exynos/exynos_dp.txtRight. It should be updated.
Great, I see you already posted that.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.Quoted 9 lines
Quoted 1 line
How did you test this patch?
I thought you will test it and give me tested-by because you commented like below, " Assuming you can make a distinction if the endpoint is a panel or a bridge, then yes, I agree with the idea of the patch. Please feel free to cc me if you post such a patch and I'll gladly test it on my Exynos5800 Peach Pi."
That is why I cced you. I really have no any Exynos5800 Peach Pi board.
Yes, but if you didn't test a patch, then it should be marked with a RFT prefix in the subject line or at least mention that needs testing since you lack the HW to test. I've no way to know if you have another board with a similar design :)
Quoted 7 lines
But what I meant is how the patch is supposed to be tested since there ins't a change in the Exynos5800 Peach Pi DTS? We can of course test that doesn't break backward compatibility but we don't have a way to test the actual change.
So I tested with the patch following patch [0] and things are working correctly. Please include that patch in your series.
Will pick it up. And I commented on below your patch.
Quoted 57 lines
I've some comments on your patch though but I'll comment on your lastest version.
Quoted 6 lines
Thanks,
Inki DaeQuoted 3 lines
Best regards,
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America[0]:
From644bab7949ac17a8d42ca0cf36cd55d61bc88928Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Thu, 3 Dec 2015 09:32:17 -0300
Subject: [PATCH 1/1] ARM: dts: Use OF graph for DP to panel connection in
exynos5800-peach-piThe DT binding for the Exynos DRM Display Port (DP) driver isn't consistent since it uses a phandle to describe the connection between the DP port and the display panel but uses the OF graph ports and endpoints to describe the connection betwen the DP port, a bridge chip and the panel.
The Exynos DP driver and the DT binding have been changed to allow also to describe the DP port to panel connection using ports / endpoints (OF graph) so this patch changes the Exynos5800 Peach Pi DT to make it consistent with the Exynos5420 Peach Pit that has a eDP to LVDS chip and uses OF graph too.
Signed-off-by Javier Martinez Canillas <[email protected]>--- arch/arm/boot/dts/exynos5800-peach-pi.dts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)arch/arm/boot/dts/exynos5800-peach-pi.dts +6
-0@@ -122,6 +122,12 @@ compatible = "auo,b133htn01"; power-supply = <&tps65090_fet6>; backlight = <&backlight>; + + port { + panel_in: endpoint { + remote-endpoint = <&dp_out>; + }; + }; }; mmc1_pwrseq: mmc1_pwrseq {
arch/arm/boot/dts/exynos5800-peach-pi.dts line 159
Quoted 7 lines
arch/arm/boot/dts/exynos5800-peach-pi.dts +3
-1@@ -148,7 +154,14 @@ samsung,link-rate = <0x0a>; samsung,lane-count = <2>; samsung,hpd-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>; - panel = <&panel>; + + ports { + port@0 {
As Rob commented before, I will pick it up removing @0 if you are ok.
Thanks,
Inki Dae
Quoted 15 lines
arch/arm/boot/dts/exynos5800-peach-pi.dts +5
-1+ dp_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; }; &fimd { --2.4.3
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[adding Krzysztof and Kukjin to cc list]
Hello Inki,
Quoted 53 lines · Inki Dae
Hi Javier,
2015-12-03 22:05 GMT+09:00 Javier Martinez Canillas <[email protected]>:
Quoted 50 lines
Hello Inki,
Quoted 10 lines · Inki Dae
Hi Javier,
2015년 12월 03일 00:04에 Javier Martinez Canillas 이(가) 쓴 글:
Quoted 7 lines
Hello Inki,
Quoted 3 lines · Inki Dae
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.Quoted 7 lines
Quoted 4 lines
You have to also update the DT binding doc which seems to be outdated already:
Documentation/devicetree/bindings/display/exynos/exynos_dp.txtRight. It should be updated.
Great, I see you already posted that.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.Quoted 9 lines
Quoted 1 line
How did you test this patch?
I thought you will test it and give me tested-by because you commented like below, " Assuming you can make a distinction if the endpoint is a panel or a bridge, then yes, I agree with the idea of the patch. Please feel free to cc me if you post such a patch and I'll gladly test it on my Exynos5800 Peach Pi."
That is why I cced you. I really have no any Exynos5800 Peach Pi board.
Yes, but if you didn't test a patch, then it should be marked with a RFT prefix in the subject line or at least mention that needs testing since you lack the HW to test. I've no way to know if you have another board with a similar design :)
But what I meant is how the patch is supposed to be tested since there ins't a change in the Exynos5800 Peach Pi DTS? We can of course test that doesn't break backward compatibility but we don't have a way to test the actual change.
Quoted 5 lines
Quoted 2 lines
So I tested with the patch following patch [0] and things are working correctly. Please include that patch in your series.
Will pick it up. And I commented on below your patch.
Ok, you need an ack from Krzysztof / Kukjin before picking the patch though and cc them if you are planning to repost the whole series.
Another option is to wait until your Exynos DRM patches hit mainline and then the DTS change can be posted separately.
Quoted 55 lines
Quoted 55 lines
I've some comments on your patch though but I'll comment on your lastest version.
Quoted 6 lines
Thanks,
Inki DaeQuoted 3 lines
Best regards,
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America[0]:
From644bab7949ac17a8d42ca0cf36cd55d61bc88928Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Thu, 3 Dec 2015 09:32:17 -0300
Subject: [PATCH 1/1] ARM: dts: Use OF graph for DP to panel connection in
exynos5800-peach-piThe DT binding for the Exynos DRM Display Port (DP) driver isn't consistent since it uses a phandle to describe the connection between the DP port and the display panel but uses the OF graph ports and endpoints to describe the connection betwen the DP port, a bridge chip and the panel.
The Exynos DP driver and the DT binding have been changed to allow also to describe the DP port to panel connection using ports / endpoints (OF graph) so this patch changes the Exynos5800 Peach Pi DT to make it consistent with the Exynos5420 Peach Pit that has a eDP to LVDS chip and uses OF graph too.
Signed-off-by Javier Martinez Canillas <[email protected]>--- arch/arm/boot/dts/exynos5800-peach-pi.dts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)arch/arm/boot/dts/exynos5800-peach-pi.dts +6
-0@@ -122,6 +122,12 @@ compatible = "auo,b133htn01"; power-supply = <&tps65090_fet6>; backlight = <&backlight>; + + port { + panel_in: endpoint { + remote-endpoint = <&dp_out>; + }; + }; };
Quoted 12 lines
arch/arm/boot/dts/exynos5800-peach-pi.dts line 159
Quoted 9 lines
arch/arm/boot/dts/exynos5800-peach-pi.dts +3
-1mmc1_pwrseq: mmc1_pwrseq {@@ -148,7 +154,14 @@ samsung,link-rate = <0x0a>; samsung,lane-count = <2>; samsung,hpd-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>; - panel = <&panel>; + + ports { + port@0 {As Rob commented before, I will pick it up removing @0 if you are ok.
Ok, it is true that there isn't an #address-cells, #size-cells and reg properties since there is a single port so I guess the @0 is arbitrary here so it doesn't represent a proper unit-address and can be removed.
Quoted 14 lines
Thanks,
Inki DaeQuoted 11 lines
arch/arm/boot/dts/exynos5800-peach-pi.dts +5
-1+ dp_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; }; &fimd { --2.4.3
Best regards,
Signature · 3 lines
Javier Martinez Canillas Open Source Group Samsung Research America
Inki Dae
maintainerIt seems that below patch should be modifed for only one of two outbound nodes - panel and bridge - to be bound because in case of using bridge device, the bridge driver will bind the panel. I will fix and post it again.
Thanks,
Inki Dae
2015년 12월 02일 20:57에 Inki Dae 이(가) 쓴 글:
Quoted 63 lines
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.Changelog v2:
- return-EINVALif getting a port node failed.Signed-off-by Inki Dae <[email protected]>--- drivers/gpu/drm/exynos/exynos_dp_core.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_dp_core.c +19
-2@@ -1392,7 +1392,7 @@ static const struct component_ops exynos_dp_ops = {static int exynos_dp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct device_node *panel_node, *bridge_node, *endpoint; +struct device_node *panel_node =NULL , *bridge_node, *endpoint =NULL ;struct exynos_dp_device *dp;int ret;@@ -1403,15 +1403,32 @@ static int exynos_dp_probe(struct platform_device *pdev)platform_set_drvdata (pdev, dp); +/* This is for the backward compatibility. */ panel_node =of_parse_phandle (dev->of_node,"panel" ,0 );if (panel_node) { dp->panel =of_drm_find_panel (panel_node);of_node_put (panel_node);if (!dp->panel)return -EPROBE_DEFER ; + }else { + endpoint =of_graph_get_next_endpoint (dev->of_node,NULL ); +if (endpoint) { + panel_node =of_graph_get_remote_port_parent (endpoint); +if (panel_node) { + dp->panel =of_drm_find_panel (panel_node); +of_node_put (panel_node); +if (!dp->panel) +return -EPROBE_DEFER ; + }else { +DRM_ERROR ("no port node for panel device.\n" ); +return -EINVAL ; + } + } } - endpoint =of_graph_get_next_endpoint (dev->of_node,NULL ); + panel_node = !endpoint ?NULL : panel_node; + + endpoint =of_graph_get_next_endpoint (dev->of_node, panel_node);if (endpoint) { bridge_node =of_graph_get_remote_port_parent (endpoint);if (bridge_node) {
Rob Herring
maintainerQuoted 43 lines · Inki Dae
This patch adds
of_graphdt binding support for panel device and also keeps the backward compatibility.i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.Changelog v2:
- return-EINVALif getting a port node failed.Signed-off-by Inki Dae <[email protected]>--- drivers/gpu/drm/exynos/exynos_dp_core.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_dp_core.c +6
-1@@ -1392,7 +1392,7 @@ static const struct component_ops exynos_dp_ops = {static int exynos_dp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct device_node *panel_node, *bridge_node, *endpoint; +struct device_node *panel_node =NULL , *bridge_node, *endpoint =NULL ;struct exynos_dp_device *dp;int ret;@@ -1403,15 +1403,32 @@ static int exynos_dp_probe(struct platform_device *pdev)platform_set_drvdata (pdev, dp); +/* This is for the backward compatibility. */ panel_node =of_parse_phandle (dev->of_node,"panel" ,0 );if (panel_node) { dp->panel =of_drm_find_panel (panel_node);of_node_put (panel_node);if (!dp->panel)return -EPROBE_DEFER ; + }else { + endpoint =of_graph_get_next_endpoint (dev->of_node,NULL ); +if (endpoint) { + panel_node =of_graph_get_remote_port_parent (endpoint);
drivers/gpu/drm/exynos/exynos_dp_core.c static int exynos_dp_probe(struct platform_device *pdev) · line 1426
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_dp_core.c +10
-0+if (panel_node) { + dp->panel =of_drm_find_panel (panel_node); +of_node_put (panel_node); +if (!dp->panel) +return -EPROBE_DEFER ; + }else { +DRM_ERROR ("no port node for panel device.\n" ); +return -EINVAL ; + } + }
This should be a fairly common sequence, so please make it one. Only which port is the panel should vary.
Rob