devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874
@ 2019-08-02  7:33 Fabrizio Castro
  2019-08-02  7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
                   ` (6 more replies)
  0 siblings, 7 replies; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:33 UTC (permalink / raw)
  To: Geert Uytterhoeven, Laurent Pinchart, Kieran Bingham,
	Jacopo Mondi, David Airlie, Daniel Vetter, Rob Herring,
	Mark Rutland, Thierry Reding
  Cc: Fabrizio Castro, Sam Ravnborg, Simon Horman, Magnus Damm,
	dri-devel, linux-renesas-soc, devicetree, Chris Paterson,
	Biju Das, linux-kernel, ebiharaml

Dear All,

this series adds support for dual-LVDS panel IDK-2121WR
from Advantech:
https://buy.advantech.eu/Displays/Embedded-LCD-Kits-High-Brightness/model-IDK-2121WR-K2FHA2E.htm
Dual link support is very recent for R-Car Gen3, and I couldn't
find much on dual link panels in the kernel either, therefore
comments are very welcome to get this right.

The panel doesn't come with the EK874 kit, but it's advertised as
supported, therefore this series adds a new dts file to support
the configuration of the EK874 + IDK-2121WR.

Finally, this series depends on a fix that's still pending:
https://patchwork.kernel.org/patch/11054755/

Thanks,
Fab

Fabrizio Castro (12):
  dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion
    too
  dt-bindings: display: renesas: lvds: Document renesas,swap-data
  dt-bindings: panel: lvds: Add dual-link LVDS display support
  dt-bindings: display: Add bindings for Advantech IDK-2121WR
  drm: rcar-du: lvds: Add data swap support
  drm: rcar-du: lvds: Do not look at ports for identifying bridges
  drm: rcar-du: lvds: Add support for dual link panels
  drm: rcar-du: lvds: Fix bridge_to_rcar_lvds
  drm: rcar-du: lvds: Fix companion's mode
  arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1
  arm64: dts: renesas: cat874: Add definition for 12V regulator
  arm64: dts: renesas: Add EK874 board with idk-2121wr display support

 .../bindings/display/bridge/renesas,lvds.txt       |  11 +-
 .../display/panel/advantech,idk-2121wr.txt         |  62 ++++++++++++
 .../bindings/display/panel/panel-lvds.txt          |  91 ++++++++++++-----
 arch/arm64/boot/dts/renesas/Makefile               |   3 +-
 arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts    |   9 ++
 .../boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts | 112 +++++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi          |   2 +
 drivers/gpu/drm/rcar-du/rcar_lvds.c                |  65 ++++++------
 8 files changed, 291 insertions(+), 64 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
 create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts

-- 
2.7.4

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
@ 2019-08-02  7:33 ` Fabrizio Castro
  2019-08-02  7:48   ` Laurent Pinchart
  2019-08-02  7:33 ` [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data Fabrizio Castro
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:33 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, David Airlie,
	Daniel Vetter, Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, dri-devel, linux-renesas-soc, devicetree,
	linux-kernel, Simon Horman, Geert Uytterhoeven, Chris Paterson,
	Biju Das

Document RZ/G2E support for property renesas,companion.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
index c6a196d..dece79e 100644
--- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
+++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
@@ -49,9 +49,9 @@ Each port shall have a single endpoint.
 Optional properties:
 
 - renesas,companion : phandle to the companion LVDS encoder. This property is
-  mandatory for the first LVDS encoder on D3 and E3 SoCs, and shall point to
-  the second encoder to be used as a companion in dual-link mode. It shall not
-  be set for any other LVDS encoder.
+  mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
+  and shall point to the second encoder to be used as a companion in dual-link
+  mode. It shall not be set for any other LVDS encoder.
 
 
 Example:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
  2019-08-02  7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
@ 2019-08-02  7:33 ` Fabrizio Castro
  2019-08-02  7:44   ` Laurent Pinchart
  2019-08-02  7:34 ` [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support Fabrizio Castro
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:33 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, David Airlie,
	Daniel Vetter, Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, dri-devel, linux-renesas-soc, devicetree,
	linux-kernel, Simon Horman, Geert Uytterhoeven, Chris Paterson,
	Biju Das

R-Car D3, R-Car E3, and RZ/G2E support dual-link mode.
In such a mode, the first LVDS encoder emits even data, and the
second LVDS encoder emits odd data. This patch documents property
renesas,swap-data, used to swap even and odd data around.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
index dece79e..8980179 100644
--- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
+++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
@@ -52,6 +52,11 @@ Optional properties:
   mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
   and shall point to the second encoder to be used as a companion in dual-link
   mode. It shall not be set for any other LVDS encoder.
+- renesas,swap-data : when in dual-link mode, the first LVDS encoder normally
+  emits even data, and the second LVDS encoder emits odd data. When property
+  renesas,swap-data is specified, the data emitted by the two encoders will be
+  swapped around. This property can only be used in conjunction with property
+  renesas,companion.
 
 
 Example:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
  2019-08-02  7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
  2019-08-02  7:33 ` [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data Fabrizio Castro
@ 2019-08-02  7:34 ` Fabrizio Castro
  2019-08-02  8:00   ` Laurent Pinchart
  2019-08-02  7:34 ` [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR Fabrizio Castro
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:34 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, Thierry Reding,
	David Airlie, Daniel Vetter, Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, Sam Ravnborg, dri-devel, devicetree,
	linux-kernel, Simon Horman, Geert Uytterhoeven, Chris Paterson,
	Biju Das, linux-renesas-soc

Dual-link LVDS displays have two ports, therefore document this
with the bindings.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 .../bindings/display/panel/panel-lvds.txt          | 91 ++++++++++++++++------
 1 file changed, 67 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
index 250850a..07795441 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
@@ -41,7 +41,8 @@ Required nodes:
 
 - panel-timing: See panel-common.txt.
 - ports: See panel-common.txt. These bindings require a single port subnode
-  corresponding to the panel LVDS input.
+  (for a single link display) or two port subnodes (for a dual link display)
+  corresponding to the panel LVDS input(s).
 
 
 LVDS data mappings are defined as follows.
@@ -92,30 +93,72 @@ CTL3: 0
 Example
 -------
 
-panel {
-	compatible = "mitsubishi,aa121td01", "panel-lvds";
-
-	width-mm = <261>;
-	height-mm = <163>;
-
-	data-mapping = "jeida-24";
-
-	panel-timing {
-		/* 1280x800 @60Hz */
-		clock-frequency = <71000000>;
-		hactive = <1280>;
-		vactive = <800>;
-		hsync-len = <70>;
-		hfront-porch = <20>;
-		hback-porch = <70>;
-		vsync-len = <5>;
-		vfront-porch = <3>;
-		vback-porch = <15>;
+Single port:
+	panel {
+		compatible = "mitsubishi,aa121td01", "panel-lvds";
+
+		width-mm = <261>;
+		height-mm = <163>;
+
+		data-mapping = "jeida-24";
+
+		panel-timing {
+			/* 1280x800 @60Hz */
+			clock-frequency = <71000000>;
+			hactive = <1280>;
+			vactive = <800>;
+			hsync-len = <70>;
+			hfront-porch = <20>;
+			hback-porch = <70>;
+			vsync-len = <5>;
+			vfront-porch = <3>;
+			vback-porch = <15>;
+		};
+
+		port {
+			panel_in: endpoint {
+				remote-endpoint = <&lvds_encoder>;
+			};
+		};
 	};
 
-	port {
-		panel_in: endpoint {
-			remote-endpoint = <&lvds_encoder>;
+Two ports:
+	panel {
+		compatible = "advantech,idk-2121wr", "panel-lvds";
+
+		width-mm = <476>;
+		height-mm = <268>;
+
+		data-mapping = "vesa-24";
+
+		panel-timing {
+			clock-frequency = <148500000>;
+			hactive = <1920>;
+			vactive = <1080>;
+			hsync-len = <44>;
+			hfront-porch = <88>;
+			hback-porch = <148>;
+			vfront-porch = <4>;
+			vback-porch = <36>;
+			vsync-len = <5>;
+		};
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				lvds0_panel_in: endpoint {
+					remote-endpoint = <&lvds0_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				lvds1_panel_in: endpoint {
+					remote-endpoint = <&lvds1_out>;
+				};
+			};
 		};
 	};
-};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
                   ` (2 preceding siblings ...)
  2019-08-02  7:34 ` [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support Fabrizio Castro
@ 2019-08-02  7:34 ` Fabrizio Castro
  2019-08-02  8:03   ` Laurent Pinchart
  2019-08-02  7:34 ` [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1 Fabrizio Castro
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:34 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, Thierry Reding,
	David Airlie, Daniel Vetter, Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, Sam Ravnborg, dri-devel, devicetree,
	linux-kernel, Simon Horman, Geert Uytterhoeven, Chris Paterson,
	Biju Das, linux-renesas-soc

This panel is handled through the generic lvds-panel bindings,
so only needs its additional compatible specified.

Some panel specific documentation can be found here:
https://buy.advantech.eu/Displays/Embedded-LCD-Kits-High-Brightness/model-IDK-2121WR-K2FHA2E.htm

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 .../display/panel/advantech,idk-2121wr.txt         | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt

diff --git a/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
new file mode 100644
index 0000000..70b15b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
@@ -0,0 +1,62 @@
+Advantech Co., Ltd. IDK-2121WR 21.5" LVDS panel
+===============================================
+
+Required properties:
+- compatible: should be "advantech,idk-2121wr" followed by "panel-lvds"
+
+This binding is compatible with the lvds-panel binding, which is specified
+in panel-lvds.txt in this directory.
+
+Example
+-------
+
+	panel {
+		compatible = "advantech,idk-2121wr", "panel-lvds";
+
+		width-mm = <476>;
+		height-mm = <268>;
+
+		data-mapping = "vesa-24";
+
+		panel-timing {
+			clock-frequency = <148500000>;
+			hactive = <1920>;
+			vactive = <1080>;
+			hsync-len = <44>;
+			hfront-porch = <88>;
+			hback-porch = <148>;
+			vfront-porch = <4>;
+			vback-porch = <36>;
+			vsync-len = <5>;
+		};
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				lvds0_panel_in: endpoint {
+					remote-endpoint = <&lvds0_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				lvds1_panel_in: endpoint {
+					remote-endpoint = <&lvds1_out>;
+				};
+			};
+		};
+	};
+
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm5 0 50000>;
+
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+
+		power-supply = <&reg_12p0v>;
+		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
+	};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
                   ` (3 preceding siblings ...)
  2019-08-02  7:34 ` [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR Fabrizio Castro
@ 2019-08-02  7:34 ` Fabrizio Castro
  2019-08-02  8:27   ` Laurent Pinchart
  2019-08-02  7:34 ` [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator Fabrizio Castro
  2019-08-02  7:34 ` [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Fabrizio Castro
  6 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:34 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland
  Cc: Fabrizio Castro, Simon Horman, Magnus Damm, linux-renesas-soc,
	devicetree, Geert Uytterhoeven, Chris Paterson, Biju Das

Add the new renesas,companion property to the LVDS0 node to point to the
companion LVDS encoder LVDS1.
Based on similar work from Laurent Pinchart for the r8a7799[05].

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
index e7b5bf2..b36d3b08 100644
--- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
@@ -1844,6 +1844,8 @@
 			resets = <&cpg 727>;
 			status = "disabled";
 
+			renesas,companion = <&lvds1>;
+
 			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
                   ` (4 preceding siblings ...)
  2019-08-02  7:34 ` [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1 Fabrizio Castro
@ 2019-08-02  7:34 ` Fabrizio Castro
  2019-08-02  8:29   ` Laurent Pinchart
  2019-08-02  7:34 ` [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Fabrizio Castro
  6 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:34 UTC (permalink / raw)
  To: Geert Uytterhoeven, Laurent Pinchart, Kieran Bingham,
	Jacopo Mondi, Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, Simon Horman, Magnus Damm, linux-renesas-soc,
	devicetree, Chris Paterson, Biju Das, ebiharaml

Power rail "D12.0V" comes straight from the power barrel connector,
and it's used in both main board and sub board.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
index 46a77ee..651383c 100644
--- a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
+++ b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
@@ -65,6 +65,15 @@
 		reg = <0x0 0x48000000 0x0 0x78000000>;
 	};
 
+	reg_12p0v: regulator-12p0v {
+		compatible = "regulator-fixed";
+		regulator-name = "D12.0V";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
 	sound: sound {
 		compatible = "simple-audio-card";
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
  2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
                   ` (5 preceding siblings ...)
  2019-08-02  7:34 ` [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator Fabrizio Castro
@ 2019-08-02  7:34 ` Fabrizio Castro
  2019-08-02  8:34   ` Laurent Pinchart
  2019-08-02  9:11   ` Geert Uytterhoeven
  6 siblings, 2 replies; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-02  7:34 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland
  Cc: Fabrizio Castro, Simon Horman, Magnus Damm, linux-renesas-soc,
	devicetree, Geert Uytterhoeven, Chris Paterson, Biju Das,
	ebiharaml

The EK874 is advertised as compatible with panel IDK-2121WR from
Advantech, however the panel isn't sold alongside the board.
A new dts, adding everything that's required to get the panel to
to work with the EK874, is the most convenient way to support the
EK874 when it's connected to the IDK-2121WR.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/Makefile               |   3 +-
 .../boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts | 112 +++++++++++++++++++++
 2 files changed, 114 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts

diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
index 42b74c2..ce48478 100644
--- a/arch/arm64/boot/dts/renesas/Makefile
+++ b/arch/arm64/boot/dts/renesas/Makefile
@@ -1,7 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m.dtb
 dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m-ex.dtb
-dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb
+dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb \
+			       r8a774c0-ek874-idk-2121wr.dtb
 dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-x.dtb r8a7795-h3ulcb.dtb
 dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-h3ulcb-kf.dtb
 dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-xs.dtb
diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
new file mode 100644
index 0000000..d989998
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the Silicon Linux RZ/G2E evaluation kit (EK874),
+ * connected to an Advantech IDK-2121WR 21.5" LVDS panel
+ *
+ * Copyright (C) 2019 Renesas Electronics Corp.
+ */
+
+#include "r8a774c0-ek874.dts"
+
+/ {
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm5 0 50000>;
+
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+
+		power-supply = <&reg_12p0v>;
+		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
+	};
+
+	panel-lvds {
+		compatible = "advantech,idk-2121wr", "panel-lvds";
+
+		width-mm = <476>;
+		height-mm = <268>;
+
+		data-mapping = "vesa-24";
+
+		panel-timing {
+			clock-frequency = <148500000>;
+			hactive = <1920>;
+			vactive = <1080>;
+			hsync-len = <44>;
+			hfront-porch = <88>;
+			hback-porch = <148>;
+			vfront-porch = <4>;
+			vback-porch = <36>;
+			vsync-len = <5>;
+		};
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				lvds0_panel_in: endpoint {
+					remote-endpoint = <&lvds0_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				lvds1_panel_in: endpoint {
+					remote-endpoint = <&lvds1_out>;
+				};
+			};
+		};
+	};
+};
+
+&gpio0 {
+	lvds-connector-en-gpio{
+		gpio-hog;
+		gpios = <17 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "lvds-connector-en-gpio";
+	};
+};
+
+&lvds0 {
+	renesas,swap-data;
+
+	ports {
+		port@1 {
+			lvds0_out: endpoint {
+				remote-endpoint = <&lvds0_panel_in>;
+			};
+		};
+	};
+};
+
+&lvds1 {
+	status = "okay";
+
+	clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
+	clock-names = "fck", "dclkin.0", "extal";
+
+	ports {
+		port@1 {
+			lvds1_out: endpoint {
+				remote-endpoint = <&lvds1_panel_in>;
+			};
+		};
+	};
+};
+
+&pfc {
+	pwm5_pins: pwm5 {
+		groups = "pwm5_a";
+		function = "pwm5";
+	};
+};
+
+&pwm5 {
+	pinctrl-0 = <&pwm5_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
  2019-08-02  7:33 ` [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data Fabrizio Castro
@ 2019-08-02  7:44   ` Laurent Pinchart
  2019-08-05  8:59     ` Fabrizio Castro
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  7:44 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Kieran Bingham, Jacopo Mondi, David Airlie, Daniel Vetter,
	Rob Herring, Mark Rutland, dri-devel, linux-renesas-soc,
	devicetree, linux-kernel, Simon Horman, Geert Uytterhoeven,
	Chris Paterson, Biju Das

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:33:59AM +0100, Fabrizio Castro wrote:
> R-Car D3, R-Car E3, and RZ/G2E support dual-link mode.
> In such a mode, the first LVDS encoder emits even data, and the
> second LVDS encoder emits odd data. This patch documents property
> renesas,swap-data, used to swap even and odd data around.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> ---
>  Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> index dece79e..8980179 100644
> --- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> +++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> @@ -52,6 +52,11 @@ Optional properties:
>    mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
>    and shall point to the second encoder to be used as a companion in dual-link
>    mode. It shall not be set for any other LVDS encoder.
> +- renesas,swap-data : when in dual-link mode, the first LVDS encoder normally
> +  emits even data, and the second LVDS encoder emits odd data. When property
> +  renesas,swap-data is specified, the data emitted by the two encoders will be
> +  swapped around. This property can only be used in conjunction with property
> +  renesas,companion.

>From an LVDS encoder point of view this is more a configuration option
than a description of the hardware. Wouldn't it be better for the LVDS
sink to report which of the odd or even pixels it expects on each of its
endpoints ? The LVDS encoder driver could then query that at runtime and
configure itself accordingly. Ideally this should be queried through the
drm_bridge_timings structure (or through a similar mean), not through
DT. An LVDS sink that has a fixed mapping of odd/even pixels to
endpoints wouldn't need the information to be specified in DT at all.

>  
>  
>  Example:

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too
  2019-08-02  7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
@ 2019-08-02  7:48   ` Laurent Pinchart
  0 siblings, 0 replies; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  7:48 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, devicetree, Chris Paterson, Geert Uytterhoeven,
	Simon Horman, David Airlie, Kieran Bingham, linux-kernel,
	dri-devel, Biju Das, linux-renesas-soc, Rob Herring,
	Jacopo Mondi

Hello Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:33:58AM +0100, Fabrizio Castro wrote:
> Document RZ/G2E support for property renesas,companion.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and taken in my tree.

> ---
>  Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> index c6a196d..dece79e 100644
> --- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> +++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> @@ -49,9 +49,9 @@ Each port shall have a single endpoint.
>  Optional properties:
>  
>  - renesas,companion : phandle to the companion LVDS encoder. This property is
> -  mandatory for the first LVDS encoder on D3 and E3 SoCs, and shall point to
> -  the second encoder to be used as a companion in dual-link mode. It shall not
> -  be set for any other LVDS encoder.
> +  mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
> +  and shall point to the second encoder to be used as a companion in dual-link
> +  mode. It shall not be set for any other LVDS encoder.
>  
>  
>  Example:

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support
  2019-08-02  7:34 ` [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support Fabrizio Castro
@ 2019-08-02  8:00   ` Laurent Pinchart
  2019-08-05  9:02     ` Fabrizio Castro
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  8:00 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Kieran Bingham, Jacopo Mondi, Thierry Reding, David Airlie,
	Daniel Vetter, Rob Herring, Mark Rutland, Sam Ravnborg,
	dri-devel, devicetree, linux-kernel, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Biju Das, linux-renesas-soc

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:00AM +0100, Fabrizio Castro wrote:
> Dual-link LVDS displays have two ports, therefore document this
> with the bindings.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> ---
>  .../bindings/display/panel/panel-lvds.txt          | 91 ++++++++++++++++------
>  1 file changed, 67 insertions(+), 24 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> index 250850a..07795441 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> +++ b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> @@ -41,7 +41,8 @@ Required nodes:
>  
>  - panel-timing: See panel-common.txt.
>  - ports: See panel-common.txt. These bindings require a single port subnode
> -  corresponding to the panel LVDS input.
> +  (for a single link display) or two port subnodes (for a dual link display)
> +  corresponding to the panel LVDS input(s).

I think you should expand this a bit to explain what the ports
correspond to in the dual link mode.

>  LVDS data mappings are defined as follows.
> @@ -92,30 +93,72 @@ CTL3: 0
>  Example
>  -------
>  
> -panel {
> -	compatible = "mitsubishi,aa121td01", "panel-lvds";
> -
> -	width-mm = <261>;
> -	height-mm = <163>;
> -
> -	data-mapping = "jeida-24";
> -
> -	panel-timing {
> -		/* 1280x800 @60Hz */
> -		clock-frequency = <71000000>;
> -		hactive = <1280>;
> -		vactive = <800>;
> -		hsync-len = <70>;
> -		hfront-porch = <20>;
> -		hback-porch = <70>;
> -		vsync-len = <5>;
> -		vfront-porch = <3>;
> -		vback-porch = <15>;
> +Single port:
> +	panel {
> +		compatible = "mitsubishi,aa121td01", "panel-lvds";
> +
> +		width-mm = <261>;
> +		height-mm = <163>;
> +
> +		data-mapping = "jeida-24";
> +
> +		panel-timing {
> +			/* 1280x800 @60Hz */
> +			clock-frequency = <71000000>;
> +			hactive = <1280>;
> +			vactive = <800>;
> +			hsync-len = <70>;
> +			hfront-porch = <20>;
> +			hback-porch = <70>;
> +			vsync-len = <5>;
> +			vfront-porch = <3>;
> +			vback-porch = <15>;
> +		};
> +
> +		port {
> +			panel_in: endpoint {
> +				remote-endpoint = <&lvds_encoder>;
> +			};
> +		};
>  	};
>  
> -	port {
> -		panel_in: endpoint {
> -			remote-endpoint = <&lvds_encoder>;
> +Two ports:
> +	panel {
> +		compatible = "advantech,idk-2121wr", "panel-lvds";
> +
> +		width-mm = <476>;
> +		height-mm = <268>;
> +
> +		data-mapping = "vesa-24";
> +
> +		panel-timing {
> +			clock-frequency = <148500000>;
> +			hactive = <1920>;
> +			vactive = <1080>;
> +			hsync-len = <44>;
> +			hfront-porch = <88>;
> +			hback-porch = <148>;
> +			vfront-porch = <4>;
> +			vback-porch = <36>;
> +			vsync-len = <5>;
> +		};
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +				lvds0_panel_in: endpoint {

I would name the label panel_in0 and panel_in1 below to have a common
prefix showing that both refer to the same panel.

> +					remote-endpoint = <&lvds0_out>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +				lvds1_panel_in: endpoint {
> +					remote-endpoint = <&lvds1_out>;
> +				};
> +			};
>  		};
>  	};
> -};

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR
  2019-08-02  7:34 ` [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR Fabrizio Castro
@ 2019-08-02  8:03   ` Laurent Pinchart
  2019-08-05  9:04     ` Fabrizio Castro
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  8:03 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Kieran Bingham, Jacopo Mondi, Thierry Reding, David Airlie,
	Daniel Vetter, Rob Herring, Mark Rutland, Sam Ravnborg,
	dri-devel, devicetree, linux-kernel, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Biju Das, linux-renesas-soc

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:01AM +0100, Fabrizio Castro wrote:
> This panel is handled through the generic lvds-panel bindings,
> so only needs its additional compatible specified.
> 
> Some panel specific documentation can be found here:

s/panel specific/panel-specific/

> https://buy.advantech.eu/Displays/Embedded-LCD-Kits-High-Brightness/model-IDK-2121WR-K2FHA2E.htm
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> ---
>  .../display/panel/advantech,idk-2121wr.txt         | 62 ++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> new file mode 100644
> index 0000000..70b15b6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> @@ -0,0 +1,62 @@
> +Advantech Co., Ltd. IDK-2121WR 21.5" LVDS panel
> +===============================================
> +
> +Required properties:
> +- compatible: should be "advantech,idk-2121wr" followed by "panel-lvds"
> +
> +This binding is compatible with the lvds-panel binding, which is specified
> +in panel-lvds.txt in this directory.

How about adding "The panel operates in dual-link mode and thus requires
two port nodes." ?

> +
> +Example
> +-------
> +
> +	panel {
> +		compatible = "advantech,idk-2121wr", "panel-lvds";
> +
> +		width-mm = <476>;
> +		height-mm = <268>;
> +
> +		data-mapping = "vesa-24";
> +
> +		panel-timing {
> +			clock-frequency = <148500000>;
> +			hactive = <1920>;
> +			vactive = <1080>;
> +			hsync-len = <44>;
> +			hfront-porch = <88>;
> +			hback-porch = <148>;
> +			vfront-porch = <4>;
> +			vback-porch = <36>;
> +			vsync-len = <5>;
> +		};
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +				lvds0_panel_in: endpoint {
> +					remote-endpoint = <&lvds0_out>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +				lvds1_panel_in: endpoint {
> +					remote-endpoint = <&lvds1_out>;
> +				};
> +			};
> +		};
> +	};
> +
> +	backlight: backlight {
> +		compatible = "pwm-backlight";
> +		pwms = <&pwm5 0 50000>;
> +
> +		brightness-levels = <0 4 8 16 32 64 128 255>;
> +		default-brightness-level = <6>;
> +
> +		power-supply = <&reg_12p0v>;
> +		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
> +	};

I think you can drop the backlight here, it's a bit out of scope.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1
  2019-08-02  7:34 ` [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1 Fabrizio Castro
@ 2019-08-02  8:27   ` Laurent Pinchart
  2019-08-02  9:03     ` Geert Uytterhoeven
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  8:27 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Kieran Bingham, Jacopo Mondi, Rob Herring, Mark Rutland,
	Simon Horman, Magnus Damm, linux-renesas-soc, devicetree,
	Geert Uytterhoeven, Chris Paterson, Biju Das

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:07AM +0100, Fabrizio Castro wrote:
> Add the new renesas,companion property to the LVDS0 node to point to the
> companion LVDS encoder LVDS1.
> Based on similar work from Laurent Pinchart for the r8a7799[05].
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and taken in my tree.

> ---
>  arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> index e7b5bf2..b36d3b08 100644
> --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> @@ -1844,6 +1844,8 @@
>  			resets = <&cpg 727>;
>  			status = "disabled";
>  
> +			renesas,companion = <&lvds1>;
> +
>  			ports {
>  				#address-cells = <1>;
>  				#size-cells = <0>;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator
  2019-08-02  7:34 ` [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator Fabrizio Castro
@ 2019-08-02  8:29   ` Laurent Pinchart
  2019-08-05  9:17     ` Fabrizio Castro
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  8:29 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, linux-renesas-soc,
	devicetree, Chris Paterson, Biju Das, ebiharaml

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:08AM +0100, Fabrizio Castro wrote:
> Power rail "D12.0V" comes straight from the power barrel connector,
> and it's used in both main board and sub board.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I don't plan to take this in my tree without patch 12/12, so if you
think the rest of the series won't be ready in time for v5.4, feel free
to get this patch merged through Simon or Geert already.

> ---
>  arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> index 46a77ee..651383c 100644
> --- a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> @@ -65,6 +65,15 @@
>  		reg = <0x0 0x48000000 0x0 0x78000000>;
>  	};
>  
> +	reg_12p0v: regulator-12p0v {
> +		compatible = "regulator-fixed";
> +		regulator-name = "D12.0V";
> +		regulator-min-microvolt = <12000000>;
> +		regulator-max-microvolt = <12000000>;
> +		regulator-boot-on;
> +		regulator-always-on;
> +	};
> +
>  	sound: sound {
>  		compatible = "simple-audio-card";
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
  2019-08-02  7:34 ` [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Fabrizio Castro
@ 2019-08-02  8:34   ` Laurent Pinchart
  2019-08-05  9:37     ` Fabrizio Castro
  2019-08-02  9:11   ` Geert Uytterhoeven
  1 sibling, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  8:34 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Kieran Bingham, Jacopo Mondi, Rob Herring, Mark Rutland,
	Simon Horman, Magnus Damm, linux-renesas-soc, devicetree,
	Geert Uytterhoeven, Chris Paterson, Biju Das, ebiharaml

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:09AM +0100, Fabrizio Castro wrote:
> The EK874 is advertised as compatible with panel IDK-2121WR from
> Advantech, however the panel isn't sold alongside the board.
> A new dts, adding everything that's required to get the panel to
> to work with the EK874, is the most convenient way to support the
> EK874 when it's connected to the IDK-2121WR.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> ---
>  arch/arm64/boot/dts/renesas/Makefile               |   3 +-
>  .../boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts | 112 +++++++++++++++++++++
>  2 files changed, 114 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> 
> diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
> index 42b74c2..ce48478 100644
> --- a/arch/arm64/boot/dts/renesas/Makefile
> +++ b/arch/arm64/boot/dts/renesas/Makefile
> @@ -1,7 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0
>  dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m.dtb
>  dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m-ex.dtb
> -dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb
> +dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb \
> +			       r8a774c0-ek874-idk-2121wr.dtb
>  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-x.dtb r8a7795-h3ulcb.dtb
>  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-h3ulcb-kf.dtb
>  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-xs.dtb
> diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> new file mode 100644
> index 0000000..d989998
> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> @@ -0,0 +1,112 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for the Silicon Linux RZ/G2E evaluation kit (EK874),
> + * connected to an Advantech IDK-2121WR 21.5" LVDS panel
> + *
> + * Copyright (C) 2019 Renesas Electronics Corp.
> + */
> +
> +#include "r8a774c0-ek874.dts"
> +
> +/ {
> +	backlight: backlight {
> +		compatible = "pwm-backlight";
> +		pwms = <&pwm5 0 50000>;
> +
> +		brightness-levels = <0 4 8 16 32 64 128 255>;
> +		default-brightness-level = <6>;
> +
> +		power-supply = <&reg_12p0v>;
> +		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
> +	};
> +
> +	panel-lvds {
> +		compatible = "advantech,idk-2121wr", "panel-lvds";
> +
> +		width-mm = <476>;
> +		height-mm = <268>;
> +
> +		data-mapping = "vesa-24";
> +
> +		panel-timing {
> +			clock-frequency = <148500000>;
> +			hactive = <1920>;
> +			vactive = <1080>;
> +			hsync-len = <44>;
> +			hfront-porch = <88>;
> +			hback-porch = <148>;
> +			vfront-porch = <4>;
> +			vback-porch = <36>;
> +			vsync-len = <5>;
> +		};
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +				lvds0_panel_in: endpoint {
> +					remote-endpoint = <&lvds0_out>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +				lvds1_panel_in: endpoint {
> +					remote-endpoint = <&lvds1_out>;
> +				};
> +			};
> +		};
> +	};
> +};
> +
> +&gpio0 {
> +	lvds-connector-en-gpio{
> +		gpio-hog;
> +		gpios = <17 GPIO_ACTIVE_HIGH>;
> +		output-low;
> +		line-name = "lvds-connector-en-gpio";
> +	};

Any chance to specify this as the panel's enable signal in the panel DT
node ?

> +};
> +
> +&lvds0 {
> +	renesas,swap-data;

Let's discuss this property in reply to the DT bindings patch.

> +
> +	ports {
> +		port@1 {
> +			lvds0_out: endpoint {
> +				remote-endpoint = <&lvds0_panel_in>;
> +			};
> +		};
> +	};
> +};
> +
> +&lvds1 {
> +	status = "okay";
> +
> +	clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
> +	clock-names = "fck", "dclkin.0", "extal";
> +
> +	ports {
> +		port@1 {
> +			lvds1_out: endpoint {
> +				remote-endpoint = <&lvds1_panel_in>;
> +			};
> +		};
> +	};
> +};
> +
> +&pfc {
> +	pwm5_pins: pwm5 {
> +		groups = "pwm5_a";
> +		function = "pwm5";
> +	};
> +};
> +
> +&pwm5 {
> +	pinctrl-0 = <&pwm5_pins>;
> +	pinctrl-names = "default";
> +
> +	status = "okay";
> +};

I haven't reviewed pinouts in detail, but the patch otherwise looks sane
to me. Another candidate for DT overlays though ;-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1
  2019-08-02  8:27   ` Laurent Pinchart
@ 2019-08-02  9:03     ` Geert Uytterhoeven
  2019-08-02  9:10       ` Laurent Pinchart
  0 siblings, 1 reply; 29+ messages in thread
From: Geert Uytterhoeven @ 2019-08-02  9:03 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Fabrizio Castro, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, Linux-Renesas,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Geert Uytterhoeven, Chris Paterson, Biju Das

Hi Laurent,

On Fri, Aug 2, 2019 at 10:27 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Fri, Aug 02, 2019 at 08:34:07AM +0100, Fabrizio Castro wrote:
> > Add the new renesas,companion property to the LVDS0 node to point to the
> > companion LVDS encoder LVDS1.
> > Based on similar work from Laurent Pinchart for the r8a7799[05].
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> and taken in my tree.

Shouldn't this go through renesas-devel and arm-soc?

> > ---
> >  arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 2 ++

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1
  2019-08-02  9:03     ` Geert Uytterhoeven
@ 2019-08-02  9:10       ` Laurent Pinchart
  2019-08-05 15:29         ` Geert Uytterhoeven
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-02  9:10 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, Linux-Renesas,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Geert Uytterhoeven, Chris Paterson, Biju Das

Hi Geert,

On Fri, Aug 02, 2019 at 11:03:54AM +0200, Geert Uytterhoeven wrote:
> On Fri, Aug 2, 2019 at 10:27 AM Laurent Pinchart wrote:
> > On Fri, Aug 02, 2019 at 08:34:07AM +0100, Fabrizio Castro wrote:
> > > Add the new renesas,companion property to the LVDS0 node to point to the
> > > companion LVDS encoder LVDS1.
> > > Based on similar work from Laurent Pinchart for the r8a7799[05].
> > >
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> >
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > and taken in my tree.
> 
> Shouldn't this go through renesas-devel and arm-soc?

I'm collecting multimedia-related DT patches for v5.4, but if you or
Simon want to take this patch, it will save me from sending a pull
request, so please go ahead :-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
  2019-08-02  7:34 ` [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Fabrizio Castro
  2019-08-02  8:34   ` Laurent Pinchart
@ 2019-08-02  9:11   ` Geert Uytterhoeven
  2019-08-05  9:44     ` Fabrizio Castro
  1 sibling, 1 reply; 29+ messages in thread
From: Geert Uytterhoeven @ 2019-08-02  9:11 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, Linux-Renesas,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Geert Uytterhoeven, Chris Paterson, Biju Das, ebiharaml

Hi Fabrizio,

On Fri, Aug 2, 2019 at 9:35 AM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> The EK874 is advertised as compatible with panel IDK-2121WR from
> Advantech, however the panel isn't sold alongside the board.
> A new dts, adding everything that's required to get the panel to
> to work with the EK874, is the most convenient way to support the
> EK874 when it's connected to the IDK-2121WR.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> @@ -0,0 +1,112 @@

[...]

> +       panel-lvds {
> +               compatible = "advantech,idk-2121wr", "panel-lvds";
> +
> +               width-mm = <476>;
> +               height-mm = <268>;
> +
> +               data-mapping = "vesa-24";
> +
> +               panel-timing {
> +                       clock-frequency = <148500000>;
> +                       hactive = <1920>;
> +                       vactive = <1080>;
> +                       hsync-len = <44>;
> +                       hfront-porch = <88>;
> +                       hback-porch = <148>;
> +                       vfront-porch = <4>;
> +                       vback-porch = <36>;
> +                       vsync-len = <5>;
> +               };
> +
> +               ports {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +
> +                       port@0 {
> +                               reg = <0>;
> +                               lvds0_panel_in: endpoint {
> +                                       remote-endpoint = <&lvds0_out>;
> +                               };
> +                       };
> +
> +                       port@1 {
> +                               reg = <1>;
> +                               lvds1_panel_in: endpoint {
> +                                       remote-endpoint = <&lvds1_out>;
> +                               };
> +                       };
> +               };
> +       };
> +};

[...]

> +&lvds0 {
> +       renesas,swap-data;
> +
> +       ports {
> +               port@1 {
> +                       lvds0_out: endpoint {
> +                               remote-endpoint = <&lvds0_panel_in>;
> +                       };
> +               };
> +       };
> +};
> +
> +&lvds1 {
> +       status = "okay";
> +
> +       clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
> +       clock-names = "fck", "dclkin.0", "extal";
> +
> +       ports {
> +               port@1 {
> +                       lvds1_out: endpoint {
> +                               remote-endpoint = <&lvds1_panel_in>;
> +                       };
> +               };
> +       };
> +};

Shouldn't the actual panel definition, and the lvds remote-endpoint setup,
be extracted into a separate .dtsi, to be included here?

Cfr. arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi and
arch/arm/boot/dts/r8a77xx-aa121td01-panel.dtsi.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
  2019-08-02  7:44   ` Laurent Pinchart
@ 2019-08-05  8:59     ` Fabrizio Castro
  2019-08-05  9:35       ` Laurent Pinchart
  0 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05  8:59 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Kieran Bingham, Jacopo Mondi, David Airlie, Daniel Vetter,
	Rob Herring, Mark Rutland, dri-devel, linux-renesas-soc,
	devicetree, linux-kernel, Simon Horman, Geert Uytterhoeven,
	Chris Paterson, Biju Das

Hi Laurent,

Thank you for your feedback!

> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 02 August 2019 08:44
> Subject: Re: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
> 
> Hi Fabrizio,
> 
> Thank you for the patch.
> 
> On Fri, Aug 02, 2019 at 08:33:59AM +0100, Fabrizio Castro wrote:
> > R-Car D3, R-Car E3, and RZ/G2E support dual-link mode.
> > In such a mode, the first LVDS encoder emits even data, and the
> > second LVDS encoder emits odd data. This patch documents property
> > renesas,swap-data, used to swap even and odd data around.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > ---
> >  Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > index dece79e..8980179 100644
> > --- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > +++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > @@ -52,6 +52,11 @@ Optional properties:
> >    mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
> >    and shall point to the second encoder to be used as a companion in dual-link
> >    mode. It shall not be set for any other LVDS encoder.
> > +- renesas,swap-data : when in dual-link mode, the first LVDS encoder normally
> > +  emits even data, and the second LVDS encoder emits odd data. When property
> > +  renesas,swap-data is specified, the data emitted by the two encoders will be
> > +  swapped around. This property can only be used in conjunction with property
> > +  renesas,companion.
> 
> From an LVDS encoder point of view this is more a configuration option
> than a description of the hardware. Wouldn't it be better for the LVDS
> sink to report which of the odd or even pixels it expects on each of its
> endpoints ?

Yes, that would be my preference too, and it would be better, I am just not entirely
what's the best place for this information though

> The LVDS encoder driver could then query that at runtime and
> configure itself accordingly. Ideally this should be queried through the
> drm_bridge_timings structure (or through a similar mean), not through
> DT. An LVDS sink that has a fixed mapping of odd/even pixels to
> endpoints wouldn't need the information to be specified in DT at all.

Isn't drm_bridge_timings specific for bridges?

Thanks!
Fab

> 
> >
> >
> >  Example:
> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support
  2019-08-02  8:00   ` Laurent Pinchart
@ 2019-08-05  9:02     ` Fabrizio Castro
  0 siblings, 0 replies; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05  9:02 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Kieran Bingham, Jacopo Mondi, Thierry Reding, David Airlie,
	Daniel Vetter, Rob Herring, Mark Rutland, Sam Ravnborg,
	dri-devel, devicetree, linux-kernel, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Biju Das, linux-renesas-soc

Hi Laurent,

Thank you for your feedback!

> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 02 August 2019 09:00
> Subject: Re: [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support
> 
> Hi Fabrizio,
> 
> Thank you for the patch.
> 
> On Fri, Aug 02, 2019 at 08:34:00AM +0100, Fabrizio Castro wrote:
> > Dual-link LVDS displays have two ports, therefore document this
> > with the bindings.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > ---
> >  .../bindings/display/panel/panel-lvds.txt          | 91 ++++++++++++++++------
> >  1 file changed, 67 insertions(+), 24 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> > index 250850a..07795441 100644
> > --- a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> > +++ b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
> > @@ -41,7 +41,8 @@ Required nodes:
> >
> >  - panel-timing: See panel-common.txt.
> >  - ports: See panel-common.txt. These bindings require a single port subnode
> > -  corresponding to the panel LVDS input.
> > +  (for a single link display) or two port subnodes (for a dual link display)
> > +  corresponding to the panel LVDS input(s).
> 
> I think you should expand this a bit to explain what the ports
> correspond to in the dual link mode.

Will change.

> 
> >  LVDS data mappings are defined as follows.
> > @@ -92,30 +93,72 @@ CTL3: 0
> >  Example
> >  -------
> >
> > -panel {
> > -	compatible = "mitsubishi,aa121td01", "panel-lvds";
> > -
> > -	width-mm = <261>;
> > -	height-mm = <163>;
> > -
> > -	data-mapping = "jeida-24";
> > -
> > -	panel-timing {
> > -		/* 1280x800 @60Hz */
> > -		clock-frequency = <71000000>;
> > -		hactive = <1280>;
> > -		vactive = <800>;
> > -		hsync-len = <70>;
> > -		hfront-porch = <20>;
> > -		hback-porch = <70>;
> > -		vsync-len = <5>;
> > -		vfront-porch = <3>;
> > -		vback-porch = <15>;
> > +Single port:
> > +	panel {
> > +		compatible = "mitsubishi,aa121td01", "panel-lvds";
> > +
> > +		width-mm = <261>;
> > +		height-mm = <163>;
> > +
> > +		data-mapping = "jeida-24";
> > +
> > +		panel-timing {
> > +			/* 1280x800 @60Hz */
> > +			clock-frequency = <71000000>;
> > +			hactive = <1280>;
> > +			vactive = <800>;
> > +			hsync-len = <70>;
> > +			hfront-porch = <20>;
> > +			hback-porch = <70>;
> > +			vsync-len = <5>;
> > +			vfront-porch = <3>;
> > +			vback-porch = <15>;
> > +		};
> > +
> > +		port {
> > +			panel_in: endpoint {
> > +				remote-endpoint = <&lvds_encoder>;
> > +			};
> > +		};
> >  	};
> >
> > -	port {
> > -		panel_in: endpoint {
> > -			remote-endpoint = <&lvds_encoder>;
> > +Two ports:
> > +	panel {
> > +		compatible = "advantech,idk-2121wr", "panel-lvds";
> > +
> > +		width-mm = <476>;
> > +		height-mm = <268>;
> > +
> > +		data-mapping = "vesa-24";
> > +
> > +		panel-timing {
> > +			clock-frequency = <148500000>;
> > +			hactive = <1920>;
> > +			vactive = <1080>;
> > +			hsync-len = <44>;
> > +			hfront-porch = <88>;
> > +			hback-porch = <148>;
> > +			vfront-porch = <4>;
> > +			vback-porch = <36>;
> > +			vsync-len = <5>;
> > +		};
> > +
> > +		ports {
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +
> > +			port@0 {
> > +				reg = <0>;
> > +				lvds0_panel_in: endpoint {
> 
> I would name the label panel_in0 and panel_in1 below to have a common
> prefix showing that both refer to the same panel.

I agree, will change, thank you for pointing this out.

> 
> > +					remote-endpoint = <&lvds0_out>;
> > +				};
> > +			};
> > +
> > +			port@1 {
> > +				reg = <1>;
> > +				lvds1_panel_in: endpoint {
> > +					remote-endpoint = <&lvds1_out>;
> > +				};
> > +			};
> >  		};
> >  	};
> > -};

Thanks,
Fab

> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR
  2019-08-02  8:03   ` Laurent Pinchart
@ 2019-08-05  9:04     ` Fabrizio Castro
  0 siblings, 0 replies; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05  9:04 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Kieran Bingham, Jacopo Mondi, Thierry Reding, David Airlie,
	Daniel Vetter, Rob Herring, Mark Rutland, Sam Ravnborg,
	dri-devel, devicetree, linux-kernel, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Biju Das, linux-renesas-soc

Hi Laurent,

Thank you for your feedback!

> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 02 August 2019 09:04
> Subject: Re: [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR
> 
> Hi Fabrizio,
> 
> Thank you for the patch.
> 
> On Fri, Aug 02, 2019 at 08:34:01AM +0100, Fabrizio Castro wrote:
> > This panel is handled through the generic lvds-panel bindings,
> > so only needs its additional compatible specified.
> >
> > Some panel specific documentation can be found here:
> 
> s/panel specific/panel-specific/

Will change

> 
> > https://buy.advantech.eu/Displays/Embedded-LCD-Kits-High-Brightness/model-IDK-2121WR-K2FHA2E.htm
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > ---
> >  .../display/panel/advantech,idk-2121wr.txt         | 62 ++++++++++++++++++++++
> >  1 file changed, 62 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> >
> > diff --git a/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> > new file mode 100644
> > index 0000000..70b15b6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.txt
> > @@ -0,0 +1,62 @@
> > +Advantech Co., Ltd. IDK-2121WR 21.5" LVDS panel
> > +===============================================
> > +
> > +Required properties:
> > +- compatible: should be "advantech,idk-2121wr" followed by "panel-lvds"
> > +
> > +This binding is compatible with the lvds-panel binding, which is specified
> > +in panel-lvds.txt in this directory.
> 
> How about adding "The panel operates in dual-link mode and thus requires
> two port nodes." ?

You are right, will add.

> 
> > +
> > +Example
> > +-------
> > +
> > +	panel {
> > +		compatible = "advantech,idk-2121wr", "panel-lvds";
> > +
> > +		width-mm = <476>;
> > +		height-mm = <268>;
> > +
> > +		data-mapping = "vesa-24";
> > +
> > +		panel-timing {
> > +			clock-frequency = <148500000>;
> > +			hactive = <1920>;
> > +			vactive = <1080>;
> > +			hsync-len = <44>;
> > +			hfront-porch = <88>;
> > +			hback-porch = <148>;
> > +			vfront-porch = <4>;
> > +			vback-porch = <36>;
> > +			vsync-len = <5>;
> > +		};
> > +
> > +		ports {
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +
> > +			port@0 {
> > +				reg = <0>;
> > +				lvds0_panel_in: endpoint {
> > +					remote-endpoint = <&lvds0_out>;
> > +				};
> > +			};
> > +
> > +			port@1 {
> > +				reg = <1>;
> > +				lvds1_panel_in: endpoint {
> > +					remote-endpoint = <&lvds1_out>;
> > +				};
> > +			};
> > +		};
> > +	};
> > +
> > +	backlight: backlight {
> > +		compatible = "pwm-backlight";
> > +		pwms = <&pwm5 0 50000>;
> > +
> > +		brightness-levels = <0 4 8 16 32 64 128 255>;
> > +		default-brightness-level = <6>;
> > +
> > +		power-supply = <&reg_12p0v>;
> > +		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
> > +	};
> 
> I think you can drop the backlight here, it's a bit out of scope.

Agreed.

Thanks,
Fab

> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator
  2019-08-02  8:29   ` Laurent Pinchart
@ 2019-08-05  9:17     ` Fabrizio Castro
  2019-08-05 15:30       ` Geert Uytterhoeven
  0 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05  9:17 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Geert Uytterhoeven, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, linux-renesas-soc,
	devicetree, Chris Paterson, Biju Das, ebiharaml

Hi Laurent,

Thank you for your feedback!

> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 02 August 2019 09:30
> Subject: Re: [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator
> 
> Hi Fabrizio,
> 
> Thank you for the patch.
> 
> On Fri, Aug 02, 2019 at 08:34:08AM +0100, Fabrizio Castro wrote:
> > Power rail "D12.0V" comes straight from the power barrel connector,
> > and it's used in both main board and sub board.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I don't plan to take this in my tree without patch 12/12, so if you
> think the rest of the series won't be ready in time for v5.4, feel free
> to get this patch merged through Simon or Geert already.

Geert, would you be happy to take this patch?

Thanks,
Fab

> 
> > ---
> >  arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> > index 46a77ee..651383c 100644
> > --- a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> > +++ b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> > @@ -65,6 +65,15 @@
> >  		reg = <0x0 0x48000000 0x0 0x78000000>;
> >  	};
> >
> > +	reg_12p0v: regulator-12p0v {
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "D12.0V";
> > +		regulator-min-microvolt = <12000000>;
> > +		regulator-max-microvolt = <12000000>;
> > +		regulator-boot-on;
> > +		regulator-always-on;
> > +	};
> > +
> >  	sound: sound {
> >  		compatible = "simple-audio-card";
> >
> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
  2019-08-05  8:59     ` Fabrizio Castro
@ 2019-08-05  9:35       ` Laurent Pinchart
  2019-08-05 10:07         ` Fabrizio Castro
  0 siblings, 1 reply; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-05  9:35 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, devicetree, Chris Paterson, Geert Uytterhoeven,
	Simon Horman, David Airlie, Kieran Bingham, linux-kernel,
	dri-devel, Biju Das, linux-renesas-soc, Rob Herring,
	Jacopo Mondi

Hi Fabrizio,

On Mon, Aug 05, 2019 at 08:59:51AM +0000, Fabrizio Castro wrote:
> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Sent: 02 August 2019 08:44
> > Subject: Re: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
> > 
> > Hi Fabrizio,
> > 
> > Thank you for the patch.
> > 
> > On Fri, Aug 02, 2019 at 08:33:59AM +0100, Fabrizio Castro wrote:
> > > R-Car D3, R-Car E3, and RZ/G2E support dual-link mode.
> > > In such a mode, the first LVDS encoder emits even data, and the
> > > second LVDS encoder emits odd data. This patch documents property
> > > renesas,swap-data, used to swap even and odd data around.
> > >
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > > ---
> > >  Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > index dece79e..8980179 100644
> > > --- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > +++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > @@ -52,6 +52,11 @@ Optional properties:
> > >    mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
> > >    and shall point to the second encoder to be used as a companion in dual-link
> > >    mode. It shall not be set for any other LVDS encoder.
> > > +- renesas,swap-data : when in dual-link mode, the first LVDS encoder normally
> > > +  emits even data, and the second LVDS encoder emits odd data. When property
> > > +  renesas,swap-data is specified, the data emitted by the two encoders will be
> > > +  swapped around. This property can only be used in conjunction with property
> > > +  renesas,companion.
> > 
> > From an LVDS encoder point of view this is more a configuration option
> > than a description of the hardware. Wouldn't it be better for the LVDS
> > sink to report which of the odd or even pixels it expects on each of its
> > endpoints ?
> 
> Yes, that would be my preference too, and it would be better, I am just not entirely
> what's the best place for this information though
> 
> > The LVDS encoder driver could then query that at runtime and
> > configure itself accordingly. Ideally this should be queried through the
> > drm_bridge_timings structure (or through a similar mean), not through
> > DT. An LVDS sink that has a fixed mapping of odd/even pixels to
> > endpoints wouldn't need the information to be specified in DT at all.
> 
> Isn't drm_bridge_timings specific for bridges?

Its name makes it specific to bridges, but the information it contains
could equally apply to panels. I would thus use it for both, possibly
after renaming it.

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
  2019-08-02  8:34   ` Laurent Pinchart
@ 2019-08-05  9:37     ` Fabrizio Castro
  2019-08-05 10:36       ` Laurent Pinchart
  0 siblings, 1 reply; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05  9:37 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Kieran Bingham, Jacopo Mondi, Rob Herring, Mark Rutland,
	Simon Horman, Magnus Damm, linux-renesas-soc, devicetree,
	Geert Uytterhoeven, Chris Paterson, Biju Das, ebiharaml

Hi Laurent,

> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 02 August 2019 09:34
> Subject: Re: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
> 
> Hi Fabrizio,
> 
> Thank you for the patch.
> 
> On Fri, Aug 02, 2019 at 08:34:09AM +0100, Fabrizio Castro wrote:
> > The EK874 is advertised as compatible with panel IDK-2121WR from
> > Advantech, however the panel isn't sold alongside the board.
> > A new dts, adding everything that's required to get the panel to
> > to work with the EK874, is the most convenient way to support the
> > EK874 when it's connected to the IDK-2121WR.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > ---
> >  arch/arm64/boot/dts/renesas/Makefile               |   3 +-
> >  .../boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts | 112 +++++++++++++++++++++
> >  2 files changed, 114 insertions(+), 1 deletion(-)
> >  create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> >
> > diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
> > index 42b74c2..ce48478 100644
> > --- a/arch/arm64/boot/dts/renesas/Makefile
> > +++ b/arch/arm64/boot/dts/renesas/Makefile
> > @@ -1,7 +1,8 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >  dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m.dtb
> >  dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m-ex.dtb
> > -dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb
> > +dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb \
> > +			       r8a774c0-ek874-idk-2121wr.dtb
> >  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-x.dtb r8a7795-h3ulcb.dtb
> >  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-h3ulcb-kf.dtb
> >  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-xs.dtb
> > diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-
> 2121wr.dts
> > new file mode 100644
> > index 0000000..d989998
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> > @@ -0,0 +1,112 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Device Tree Source for the Silicon Linux RZ/G2E evaluation kit (EK874),
> > + * connected to an Advantech IDK-2121WR 21.5" LVDS panel
> > + *
> > + * Copyright (C) 2019 Renesas Electronics Corp.
> > + */
> > +
> > +#include "r8a774c0-ek874.dts"
> > +
> > +/ {
> > +	backlight: backlight {
> > +		compatible = "pwm-backlight";
> > +		pwms = <&pwm5 0 50000>;
> > +
> > +		brightness-levels = <0 4 8 16 32 64 128 255>;
> > +		default-brightness-level = <6>;
> > +
> > +		power-supply = <&reg_12p0v>;
> > +		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
> > +	};
> > +
> > +	panel-lvds {
> > +		compatible = "advantech,idk-2121wr", "panel-lvds";
> > +
> > +		width-mm = <476>;
> > +		height-mm = <268>;
> > +
> > +		data-mapping = "vesa-24";
> > +
> > +		panel-timing {
> > +			clock-frequency = <148500000>;
> > +			hactive = <1920>;
> > +			vactive = <1080>;
> > +			hsync-len = <44>;
> > +			hfront-porch = <88>;
> > +			hback-porch = <148>;
> > +			vfront-porch = <4>;
> > +			vback-porch = <36>;
> > +			vsync-len = <5>;
> > +		};
> > +
> > +		ports {
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +
> > +			port@0 {
> > +				reg = <0>;
> > +				lvds0_panel_in: endpoint {
> > +					remote-endpoint = <&lvds0_out>;
> > +				};
> > +			};
> > +
> > +			port@1 {
> > +				reg = <1>;
> > +				lvds1_panel_in: endpoint {
> > +					remote-endpoint = <&lvds1_out>;
> > +				};
> > +			};
> > +		};
> > +	};
> > +};
> > +
> > +&gpio0 {
> > +	lvds-connector-en-gpio{
> > +		gpio-hog;
> > +		gpios = <17 GPIO_ACTIVE_HIGH>;
> > +		output-low;
> > +		line-name = "lvds-connector-en-gpio";
> > +	};
> 
> Any chance to specify this as the panel's enable signal in the panel DT
> node ?

I am not too sure, as this is not exactly an enable signal. When GP0_17 is low
then LVDS[01] are connected to the LVDS connector, when GP0_17 is high
then LVDS[01] are connected to the LT8918L.
Perhaps we should leave this fixed to low to avoid confusion?

Thanks,
Fab

> 
> > +};
> > +
> > +&lvds0 {
> > +	renesas,swap-data;
> 
> Let's discuss this property in reply to the DT bindings patch.
> 
> > +
> > +	ports {
> > +		port@1 {
> > +			lvds0_out: endpoint {
> > +				remote-endpoint = <&lvds0_panel_in>;
> > +			};
> > +		};
> > +	};
> > +};
> > +
> > +&lvds1 {
> > +	status = "okay";
> > +
> > +	clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
> > +	clock-names = "fck", "dclkin.0", "extal";
> > +
> > +	ports {
> > +		port@1 {
> > +			lvds1_out: endpoint {
> > +				remote-endpoint = <&lvds1_panel_in>;
> > +			};
> > +		};
> > +	};
> > +};
> > +
> > +&pfc {
> > +	pwm5_pins: pwm5 {
> > +		groups = "pwm5_a";
> > +		function = "pwm5";
> > +	};
> > +};
> > +
> > +&pwm5 {
> > +	pinctrl-0 = <&pwm5_pins>;
> > +	pinctrl-names = "default";
> > +
> > +	status = "okay";
> > +};
> 
> I haven't reviewed pinouts in detail, but the patch otherwise looks sane
> to me. Another candidate for DT overlays though ;-)
> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
  2019-08-02  9:11   ` Geert Uytterhoeven
@ 2019-08-05  9:44     ` Fabrizio Castro
  0 siblings, 0 replies; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05  9:44 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Laurent Pinchart, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, Linux-Renesas,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Geert Uytterhoeven, Chris Paterson, Biju Das, ebiharaml

Hi Geert,

Thank you for your feedback!

> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 02 August 2019 10:11
> Subject: Re: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
> 
> Hi Fabrizio,
> 
> On Fri, Aug 2, 2019 at 9:35 AM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > The EK874 is advertised as compatible with panel IDK-2121WR from
> > Advantech, however the panel isn't sold alongside the board.
> > A new dts, adding everything that's required to get the panel to
> > to work with the EK874, is the most convenient way to support the
> > EK874 when it's connected to the IDK-2121WR.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> > @@ -0,0 +1,112 @@
> 
> [...]
> 
> > +       panel-lvds {
> > +               compatible = "advantech,idk-2121wr", "panel-lvds";
> > +
> > +               width-mm = <476>;
> > +               height-mm = <268>;
> > +
> > +               data-mapping = "vesa-24";
> > +
> > +               panel-timing {
> > +                       clock-frequency = <148500000>;
> > +                       hactive = <1920>;
> > +                       vactive = <1080>;
> > +                       hsync-len = <44>;
> > +                       hfront-porch = <88>;
> > +                       hback-porch = <148>;
> > +                       vfront-porch = <4>;
> > +                       vback-porch = <36>;
> > +                       vsync-len = <5>;
> > +               };
> > +
> > +               ports {
> > +                       #address-cells = <1>;
> > +                       #size-cells = <0>;
> > +
> > +                       port@0 {
> > +                               reg = <0>;
> > +                               lvds0_panel_in: endpoint {
> > +                                       remote-endpoint = <&lvds0_out>;
> > +                               };
> > +                       };
> > +
> > +                       port@1 {
> > +                               reg = <1>;
> > +                               lvds1_panel_in: endpoint {
> > +                                       remote-endpoint = <&lvds1_out>;
> > +                               };
> > +                       };
> > +               };
> > +       };
> > +};
> 
> [...]
> 
> > +&lvds0 {
> > +       renesas,swap-data;
> > +
> > +       ports {
> > +               port@1 {
> > +                       lvds0_out: endpoint {
> > +                               remote-endpoint = <&lvds0_panel_in>;
> > +                       };
> > +               };
> > +       };
> > +};
> > +
> > +&lvds1 {
> > +       status = "okay";
> > +
> > +       clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
> > +       clock-names = "fck", "dclkin.0", "extal";
> > +
> > +       ports {
> > +               port@1 {
> > +                       lvds1_out: endpoint {
> > +                               remote-endpoint = <&lvds1_panel_in>;
> > +                       };
> > +               };
> > +       };
> > +};
> 
> Shouldn't the actual panel definition, and the lvds remote-endpoint setup,
> be extracted into a separate .dtsi, to be included here?
> 
> Cfr. arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi and
> arch/arm/boot/dts/r8a77xx-aa121td01-panel.dtsi.

It looks like those displays are commonly used with Marzen, Lager, and Koelsch
boards, I am not aware of any plans for reusing this particular panel.
Perhaps we should still make this more generic and create a .dtsi?

Thanks,
Fab

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
  2019-08-05  9:35       ` Laurent Pinchart
@ 2019-08-05 10:07         ` Fabrizio Castro
  0 siblings, 0 replies; 29+ messages in thread
From: Fabrizio Castro @ 2019-08-05 10:07 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Kieran Bingham, Jacopo Mondi, David Airlie, Daniel Vetter,
	Rob Herring, Mark Rutland, dri-devel, linux-renesas-soc,
	devicetree, linux-kernel, Simon Horman, Geert Uytterhoeven,
	Chris Paterson, Biju Das

Hi Laurent,

> From: linux-kernel-owner@vger.kernel.org <linux-kernel-owner@vger.kernel.org> On Behalf Of Laurent Pinchart
> Sent: 05 August 2019 10:36
> Subject: Re: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
> 
> Hi Fabrizio,
> 
> On Mon, Aug 05, 2019 at 08:59:51AM +0000, Fabrizio Castro wrote:
> > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Sent: 02 August 2019 08:44
> > > Subject: Re: [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data
> > >
> > > Hi Fabrizio,
> > >
> > > Thank you for the patch.
> > >
> > > On Fri, Aug 02, 2019 at 08:33:59AM +0100, Fabrizio Castro wrote:
> > > > R-Car D3, R-Car E3, and RZ/G2E support dual-link mode.
> > > > In such a mode, the first LVDS encoder emits even data, and the
> > > > second LVDS encoder emits odd data. This patch documents property
> > > > renesas,swap-data, used to swap even and odd data around.
> > > >
> > > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > > > ---
> > > >  Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt | 5 +++++
> > > >  1 file changed, 5 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > > index dece79e..8980179 100644
> > > > --- a/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > > +++ b/Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
> > > > @@ -52,6 +52,11 @@ Optional properties:
> > > >    mandatory for the first LVDS encoder on R-Car D3, R-Car E3, and RZ/G2E SoCs,
> > > >    and shall point to the second encoder to be used as a companion in dual-link
> > > >    mode. It shall not be set for any other LVDS encoder.
> > > > +- renesas,swap-data : when in dual-link mode, the first LVDS encoder normally
> > > > +  emits even data, and the second LVDS encoder emits odd data. When property
> > > > +  renesas,swap-data is specified, the data emitted by the two encoders will be
> > > > +  swapped around. This property can only be used in conjunction with property
> > > > +  renesas,companion.
> > >
> > > From an LVDS encoder point of view this is more a configuration option
> > > than a description of the hardware. Wouldn't it be better for the LVDS
> > > sink to report which of the odd or even pixels it expects on each of its
> > > endpoints ?
> >
> > Yes, that would be my preference too, and it would be better, I am just not entirely
> > what's the best place for this information though
> >
> > > The LVDS encoder driver could then query that at runtime and
> > > configure itself accordingly. Ideally this should be queried through the
> > > drm_bridge_timings structure (or through a similar mean), not through
> > > DT. An LVDS sink that has a fixed mapping of odd/even pixels to
> > > endpoints wouldn't need the information to be specified in DT at all.
> >
> > Isn't drm_bridge_timings specific for bridges?
> 
> Its name makes it specific to bridges, but the information it contains
> could equally apply to panels. I would thus use it for both, possibly
> after renaming it.

Will give this a try then.

Thanks,
Fab

> 
> --
> Regards,
> 
> Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support
  2019-08-05  9:37     ` Fabrizio Castro
@ 2019-08-05 10:36       ` Laurent Pinchart
  0 siblings, 0 replies; 29+ messages in thread
From: Laurent Pinchart @ 2019-08-05 10:36 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Kieran Bingham, Jacopo Mondi, Rob Herring, Mark Rutland,
	Simon Horman, Magnus Damm, linux-renesas-soc, devicetree,
	Geert Uytterhoeven, Chris Paterson, Biju Das, ebiharaml

Hi Fabrizio,

On Mon, Aug 05, 2019 at 09:37:29AM +0000, Fabrizio Castro wrote:
> On 02 August 2019 09:34 Laurent Pinchart wrote:
> > On Fri, Aug 02, 2019 at 08:34:09AM +0100, Fabrizio Castro wrote:
> > > The EK874 is advertised as compatible with panel IDK-2121WR from
> > > Advantech, however the panel isn't sold alongside the board.
> > > A new dts, adding everything that's required to get the panel to
> > > to work with the EK874, is the most convenient way to support the
> > > EK874 when it's connected to the IDK-2121WR.
> > >
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > > ---
> > >  arch/arm64/boot/dts/renesas/Makefile               |   3 +-
> > >  .../boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts | 112 +++++++++++++++++++++
> > >  2 files changed, 114 insertions(+), 1 deletion(-)
> > >  create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> > >
> > > diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
> > > index 42b74c2..ce48478 100644
> > > --- a/arch/arm64/boot/dts/renesas/Makefile
> > > +++ b/arch/arm64/boot/dts/renesas/Makefile
> > > @@ -1,7 +1,8 @@
> > >  # SPDX-License-Identifier: GPL-2.0
> > >  dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m.dtb
> > >  dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m-ex.dtb
> > > -dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb
> > > +dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb \
> > > +			       r8a774c0-ek874-idk-2121wr.dtb
> > >  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-x.dtb r8a7795-h3ulcb.dtb
> > >  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-h3ulcb-kf.dtb
> > >  dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-xs.dtb
> > > diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-
> > 2121wr.dts
> > > new file mode 100644
> > > index 0000000..d989998
> > > --- /dev/null
> > > +++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
> > > @@ -0,0 +1,112 @@
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +/*
> > > + * Device Tree Source for the Silicon Linux RZ/G2E evaluation kit (EK874),
> > > + * connected to an Advantech IDK-2121WR 21.5" LVDS panel
> > > + *
> > > + * Copyright (C) 2019 Renesas Electronics Corp.
> > > + */
> > > +
> > > +#include "r8a774c0-ek874.dts"
> > > +
> > > +/ {
> > > +	backlight: backlight {
> > > +		compatible = "pwm-backlight";
> > > +		pwms = <&pwm5 0 50000>;
> > > +
> > > +		brightness-levels = <0 4 8 16 32 64 128 255>;
> > > +		default-brightness-level = <6>;
> > > +
> > > +		power-supply = <&reg_12p0v>;
> > > +		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
> > > +	};
> > > +
> > > +	panel-lvds {
> > > +		compatible = "advantech,idk-2121wr", "panel-lvds";
> > > +
> > > +		width-mm = <476>;
> > > +		height-mm = <268>;
> > > +
> > > +		data-mapping = "vesa-24";
> > > +
> > > +		panel-timing {
> > > +			clock-frequency = <148500000>;
> > > +			hactive = <1920>;
> > > +			vactive = <1080>;
> > > +			hsync-len = <44>;
> > > +			hfront-porch = <88>;
> > > +			hback-porch = <148>;
> > > +			vfront-porch = <4>;
> > > +			vback-porch = <36>;
> > > +			vsync-len = <5>;
> > > +		};
> > > +
> > > +		ports {
> > > +			#address-cells = <1>;
> > > +			#size-cells = <0>;
> > > +
> > > +			port@0 {
> > > +				reg = <0>;
> > > +				lvds0_panel_in: endpoint {
> > > +					remote-endpoint = <&lvds0_out>;
> > > +				};
> > > +			};
> > > +
> > > +			port@1 {
> > > +				reg = <1>;
> > > +				lvds1_panel_in: endpoint {
> > > +					remote-endpoint = <&lvds1_out>;
> > > +				};
> > > +			};
> > > +		};
> > > +	};
> > > +};
> > > +
> > > +&gpio0 {
> > > +	lvds-connector-en-gpio{
> > > +		gpio-hog;
> > > +		gpios = <17 GPIO_ACTIVE_HIGH>;
> > > +		output-low;
> > > +		line-name = "lvds-connector-en-gpio";
> > > +	};
> > 
> > Any chance to specify this as the panel's enable signal in the panel DT
> > node ?
> 
> I am not too sure, as this is not exactly an enable signal. When GP0_17 is low
> then LVDS[01] are connected to the LVDS connector, when GP0_17 is high
> then LVDS[01] are connected to the LT8918L.
> Perhaps we should leave this fixed to low to avoid confusion?

The line-name was confusing me. A GPIO hog is thus indeed the best
option. A comment that explains what the signal is for could help.

> > > +};
> > > +
> > > +&lvds0 {
> > > +	renesas,swap-data;
> > 
> > Let's discuss this property in reply to the DT bindings patch.
> > 
> > > +
> > > +	ports {
> > > +		port@1 {
> > > +			lvds0_out: endpoint {
> > > +				remote-endpoint = <&lvds0_panel_in>;
> > > +			};
> > > +		};
> > > +	};
> > > +};
> > > +
> > > +&lvds1 {
> > > +	status = "okay";
> > > +
> > > +	clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
> > > +	clock-names = "fck", "dclkin.0", "extal";
> > > +
> > > +	ports {
> > > +		port@1 {
> > > +			lvds1_out: endpoint {
> > > +				remote-endpoint = <&lvds1_panel_in>;
> > > +			};
> > > +		};
> > > +	};
> > > +};
> > > +
> > > +&pfc {
> > > +	pwm5_pins: pwm5 {
> > > +		groups = "pwm5_a";
> > > +		function = "pwm5";
> > > +	};
> > > +};
> > > +
> > > +&pwm5 {
> > > +	pinctrl-0 = <&pwm5_pins>;
> > > +	pinctrl-names = "default";
> > > +
> > > +	status = "okay";
> > > +};
> > 
> > I haven't reviewed pinouts in detail, but the patch otherwise looks sane
> > to me. Another candidate for DT overlays though ;-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1
  2019-08-02  9:10       ` Laurent Pinchart
@ 2019-08-05 15:29         ` Geert Uytterhoeven
  0 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2019-08-05 15:29 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Fabrizio Castro, Kieran Bingham, Jacopo Mondi, Rob Herring,
	Mark Rutland, Simon Horman, Magnus Damm, Linux-Renesas,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Geert Uytterhoeven, Chris Paterson, Biju Das

Hi Laurent,

On Fri, Aug 2, 2019 at 11:10 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Fri, Aug 02, 2019 at 11:03:54AM +0200, Geert Uytterhoeven wrote:
> > On Fri, Aug 2, 2019 at 10:27 AM Laurent Pinchart wrote:
> > > On Fri, Aug 02, 2019 at 08:34:07AM +0100, Fabrizio Castro wrote:
> > > > Add the new renesas,companion property to the LVDS0 node to point to the
> > > > companion LVDS encoder LVDS1.
> > > > Based on similar work from Laurent Pinchart for the r8a7799[05].
> > > >
> > > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > >
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >
> > > and taken in my tree.
> >
> > Shouldn't this go through renesas-devel and arm-soc?
>
> I'm collecting multimedia-related DT patches for v5.4, but if you or
> Simon want to take this patch, it will save me from sending a pull
> request, so please go ahead :-)

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v5.4.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator
  2019-08-05  9:17     ` Fabrizio Castro
@ 2019-08-05 15:30       ` Geert Uytterhoeven
  0 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2019-08-05 15:30 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Laurent Pinchart, Geert Uytterhoeven, Kieran Bingham,
	Jacopo Mondi, Rob Herring, Mark Rutland, Simon Horman,
	Magnus Damm, linux-renesas-soc, devicetree, Chris Paterson,
	Biju Das, ebiharaml

Hi Fabrizio,

On Mon, Aug 5, 2019 at 11:17 AM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Sent: 02 August 2019 09:30
> > Subject: Re: [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator
> >
> > Hi Fabrizio,
> >
> > Thank you for the patch.
> >
> > On Fri, Aug 02, 2019 at 08:34:08AM +0100, Fabrizio Castro wrote:
> > > Power rail "D12.0V" comes straight from the power barrel connector,
> > > and it's used in both main board and sub board.
> > >
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> >
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > I don't plan to take this in my tree without patch 12/12, so if you
> > think the rest of the series won't be ready in time for v5.4, feel free
> > to get this patch merged through Simon or Geert already.
>
> Geert, would you be happy to take this patch?

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v5.4.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2019-08-05 15:30 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
2019-08-02  7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
2019-08-02  7:48   ` Laurent Pinchart
2019-08-02  7:33 ` [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data Fabrizio Castro
2019-08-02  7:44   ` Laurent Pinchart
2019-08-05  8:59     ` Fabrizio Castro
2019-08-05  9:35       ` Laurent Pinchart
2019-08-05 10:07         ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support Fabrizio Castro
2019-08-02  8:00   ` Laurent Pinchart
2019-08-05  9:02     ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR Fabrizio Castro
2019-08-02  8:03   ` Laurent Pinchart
2019-08-05  9:04     ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 10/12] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1 Fabrizio Castro
2019-08-02  8:27   ` Laurent Pinchart
2019-08-02  9:03     ` Geert Uytterhoeven
2019-08-02  9:10       ` Laurent Pinchart
2019-08-05 15:29         ` Geert Uytterhoeven
2019-08-02  7:34 ` [PATCH/RFC 11/12] arm64: dts: renesas: cat874: Add definition for 12V regulator Fabrizio Castro
2019-08-02  8:29   ` Laurent Pinchart
2019-08-05  9:17     ` Fabrizio Castro
2019-08-05 15:30       ` Geert Uytterhoeven
2019-08-02  7:34 ` [PATCH/RFC 12/12] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Fabrizio Castro
2019-08-02  8:34   ` Laurent Pinchart
2019-08-05  9:37     ` Fabrizio Castro
2019-08-05 10:36       ` Laurent Pinchart
2019-08-02  9:11   ` Geert Uytterhoeven
2019-08-05  9:44     ` Fabrizio Castro

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).