diff mbox series

[v3,2/2] arm64: dts: renesas: Add HiHope RZ/G2M board with idk-1110wr display

Message ID 1583872919-7757-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series Add LVDS panel support to HiHope RZ/G2M | expand

Commit Message

Lad Prabhakar March 10, 2020, 8:41 p.m. UTC
From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

The HiHope RZ/G2M is advertised as compatible with panel idk-1110wr
from Advantech, however the panel isn't sold alongside the board.
A new dts, adding everything that's required to get the panel to
work the HiHope RZ/G2M, is the most convenient way to support the
HiHope RZ/G2M when it's connected to the idk-1110wr.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/Makefile               |  1 +
 .../r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts        | 86 ++++++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts

Comments

Geert Uytterhoeven March 11, 2020, 10:08 a.m. UTC | #1
Hi Lad,

On Tue, Mar 10, 2020 at 9:42 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
>
> The HiHope RZ/G2M is advertised as compatible with panel idk-1110wr
> from Advantech, however the panel isn't sold alongside the board.
> A new dts, adding everything that's required to get the panel to
> work the HiHope RZ/G2M, is the most convenient way to support the
> HiHope RZ/G2M when it's connected to the idk-1110wr.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Thanks for picking up this patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts
> @@ -0,0 +1,86 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for the HiHope RZ/G2M sub board connected to an
> + * Advantech IDK-1110WR 10.1" LVDS panel
> + *
> + * Copyright (C) 2020 Renesas Electronics Corp.
> + */
> +
> +#include "r8a774a1-hihope-rzg2m-ex.dts"
> +
> +/ {
> +       backlight {
> +               compatible = "pwm-backlight";
> +               pwms = <&pwm0 0 50000>;
> +
> +               brightness-levels = <0 2 8 16 32 64 128 255>;
> +               default-brightness-level = <6>;
> +       };
> +
> +       panel-lvds {
> +               compatible = "advantech,idk-1110wr", "panel-lvds";
> +
> +               width-mm = <223>;
> +               height-mm = <125>;
> +
> +               data-mapping = "jeida-24";
> +
> +               panel-timing {
> +                       /* 1024x600 @60Hz */
> +                       clock-frequency = <51200000>;
> +                       hactive = <1024>;
> +                       vactive = <600>;
> +                       hsync-len = <240>;
> +                       hfront-porch = <40>;
> +                       hback-porch = <40>;
> +                       vfront-porch = <15>;
> +                       vback-porch = <10>;
> +                       vsync-len = <10>;
> +               };
> +
> +               port {
> +                       panel_in: endpoint {
> +                               remote-endpoint = <&lvds0_out>;
> +                       };
> +               };
> +       };

I believe the plan was to include the existing
rzg2-advantech-idk-1110wr-panel.dtsi instead, to provide the
panel-lvds node...

> +};
> +
> +&gpio1 {
> +       /*
> +        * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
> +        * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
> +        */
> +       lvds-connector-en-gpio {
> +               gpio-hog;
> +               gpios = <20 GPIO_ACTIVE_HIGH>;
> +               output-low;
> +               line-name = "lvds-connector-en-gpio";
> +       };
> +};
> +
> +&lvds0 {
> +       status = "okay";
> +
> +       ports {
> +               port@1 {
> +                       lvds0_out: endpoint {
> +                               remote-endpoint = <&panel_in>;
> +                       };
> +               };
> +       };
> +};

... and the lvds_connector endpoint configuration.

The rest looks good to me.

Gr{oetje,eeting}s,

                        Geert
Lad Prabhakar March 11, 2020, 10:48 a.m. UTC | #2
Hi Geert,

Thank you for the review.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 11 March 2020 10:08
> To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>; Sam Ravnborg
> <sam@ravnborg.org>; David Airlie <airlied@linux.ie>; Daniel Vetter
> <daniel@ffwll.ch>; Rob Herring <robh+dt@kernel.org>; Mark Rutland
> <mark.rutland@arm.com>; Magnus Damm <magnus.damm@gmail.com>;
> DRI Development <dri-devel@lists.freedesktop.org>; open list:OPEN
> FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
> <devicetree@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Linux-Renesas <linux-renesas-
> soc@vger.kernel.org>
> Subject: Re: [PATCH v3 2/2] arm64: dts: renesas: Add HiHope RZ/G2M board
> with idk-1110wr display
>
> Hi Lad,
>
> On Tue, Mar 10, 2020 at 9:42 PM Lad Prabhakar <prabhakar.mahadev-
> lad.rj@bp.renesas.com> wrote:
> > From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> >
> > The HiHope RZ/G2M is advertised as compatible with panel idk-1110wr
> > from Advantech, however the panel isn't sold alongside the board.
> > A new dts, adding everything that's required to get the panel to work
> > the HiHope RZ/G2M, is the most convenient way to support the HiHope
> > RZ/G2M when it's connected to the idk-1110wr.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-
> lad.rj@bp.renesas.com>
>
> Thanks for picking up this patch!
>
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex-idk-
> 1110wr.
> > +++ dts
> > @@ -0,0 +1,86 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Device Tree Source for the HiHope RZ/G2M sub board connected to an
> > + * Advantech IDK-1110WR 10.1" LVDS panel
> > + *
> > + * Copyright (C) 2020 Renesas Electronics Corp.
> > + */
> > +
> > +#include "r8a774a1-hihope-rzg2m-ex.dts"
> > +
> > +/ {
> > +       backlight {
> > +               compatible = "pwm-backlight";
> > +               pwms = <&pwm0 0 50000>;
> > +
> > +               brightness-levels = <0 2 8 16 32 64 128 255>;
> > +               default-brightness-level = <6>;
> > +       };
> > +
> > +       panel-lvds {
> > +               compatible = "advantech,idk-1110wr", "panel-lvds";
> > +
> > +               width-mm = <223>;
> > +               height-mm = <125>;
> > +
> > +               data-mapping = "jeida-24";
> > +
> > +               panel-timing {
> > +                       /* 1024x600 @60Hz */
> > +                       clock-frequency = <51200000>;
> > +                       hactive = <1024>;
> > +                       vactive = <600>;
> > +                       hsync-len = <240>;
> > +                       hfront-porch = <40>;
> > +                       hback-porch = <40>;
> > +                       vfront-porch = <15>;
> > +                       vback-porch = <10>;
> > +                       vsync-len = <10>;
> > +               };
> > +
> > +               port {
> > +                       panel_in: endpoint {
> > +                               remote-endpoint = <&lvds0_out>;
> > +                       };
> > +               };
> > +       };
>
> I believe the plan was to include the existing rzg2-advantech-idk-1110wr-
> panel.dtsi instead, to provide the panel-lvds node...
>
Ahha missed it, I'll quickly respin the series fixing it.

> > +};
> > +
> > +&gpio1 {
> > +       /*
> > +        * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
> > +        * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
> > +        */
> > +       lvds-connector-en-gpio {
> > +               gpio-hog;
> > +               gpios = <20 GPIO_ACTIVE_HIGH>;
> > +               output-low;
> > +               line-name = "lvds-connector-en-gpio";
> > +       };
> > +};
> > +
> > +&lvds0 {
> > +       status = "okay";
> > +
> > +       ports {
> > +               port@1 {
> > +                       lvds0_out: endpoint {
> > +                               remote-endpoint = <&panel_in>;
> > +                       };
> > +               };
> > +       };
> > +};
>
> ... and the lvds_connector endpoint configuration.
>
Agreed.

Cheers,
--Prabhakar

> The rest looks good to me.
>
> 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


Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
index 2153842..82dd245 100644
--- a/arch/arm64/boot/dts/renesas/Makefile
+++ b/arch/arm64/boot/dts/renesas/Makefile
@@ -1,6 +1,7 @@ 
 # 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_R8A774A1) += r8a774a1-hihope-rzg2m-ex-idk-1110wr.dtb
 dtb-$(CONFIG_ARCH_R8A774B1) += r8a774b1-hihope-rzg2n.dtb
 dtb-$(CONFIG_ARCH_R8A774B1) += r8a774b1-hihope-rzg2n-ex.dtb
 dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb \
diff --git a/arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts b/arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts
new file mode 100644
index 0000000..6033cae
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts
@@ -0,0 +1,86 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the HiHope RZ/G2M sub board connected to an
+ * Advantech IDK-1110WR 10.1" LVDS panel
+ *
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ */
+
+#include "r8a774a1-hihope-rzg2m-ex.dts"
+
+/ {
+	backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm0 0 50000>;
+
+		brightness-levels = <0 2 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+	};
+
+	panel-lvds {
+		compatible = "advantech,idk-1110wr", "panel-lvds";
+
+		width-mm = <223>;
+		height-mm = <125>;
+
+		data-mapping = "jeida-24";
+
+		panel-timing {
+			/* 1024x600 @60Hz */
+			clock-frequency = <51200000>;
+			hactive = <1024>;
+			vactive = <600>;
+			hsync-len = <240>;
+			hfront-porch = <40>;
+			hback-porch = <40>;
+			vfront-porch = <15>;
+			vback-porch = <10>;
+			vsync-len = <10>;
+		};
+
+		port {
+			panel_in: endpoint {
+				remote-endpoint = <&lvds0_out>;
+			};
+		};
+	};
+};
+
+&gpio1 {
+	/*
+	 * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
+	 * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
+	 */
+	lvds-connector-en-gpio {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "lvds-connector-en-gpio";
+	};
+};
+
+&lvds0 {
+	status = "okay";
+
+	ports {
+		port@1 {
+			lvds0_out: endpoint {
+				remote-endpoint = <&panel_in>;
+			};
+		};
+	};
+};
+
+&pfc {
+	pwm0_pins: pwm0 {
+		groups = "pwm0";
+		function = "pwm0";
+	};
+};
+
+&pwm0 {
+	pinctrl-0 = <&pwm0_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};