linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board
@ 2024-01-23 14:53 Niklas Söderlund
  2024-02-10 13:04 ` Niklas Söderlund
  2024-02-15 18:32 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Niklas Söderlund @ 2024-01-23 14:53 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc, devicetree, Niklas Söderlund

The Eagle board supports an optional expansion board. The expansion
board adds support for HDMI OUT, HDMI capture from two different sources
and eMMC.

This change only adds support for the two HDMI capture sources.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 arch/arm64/boot/dts/renesas/Makefile          |   2 +
 .../dts/renesas/r8a77970-eagle-expansion.dtso | 214 ++++++++++++++++++
 2 files changed, 216 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso

diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
index 8ea68d582710..38fadc161709 100644
--- a/arch/arm64/boot/dts/renesas/Makefile
+++ b/arch/arm64/boot/dts/renesas/Makefile
@@ -62,6 +62,8 @@ dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb.dtb
 dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb-kf.dtb
 
 dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle.dtb
+r8a77970-eagle-expansion-dtbs := r8a77970-eagle.dtb r8a77970-eagle-expansion.dtbo
+dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle-expansion.dtb
 dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-v3msk.dtb
 
 dtb-$(CONFIG_ARCH_R8A77980) += r8a77980-condor.dtb
diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso b/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso
new file mode 100644
index 000000000000..bd32f263e740
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso
@@ -0,0 +1,214 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the Eagle V3M expansion board.
+ *
+ * Copyright (C) 2024 Niklas Söderlund <niklas.soderlund@ragnatech.se>
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/dts-v1/;
+/plugin/;
+
+/ {
+	/* CN4 */
+	/* Eagle: SW18 set to OFF */
+	cvbs-in-cn4 {
+		compatible = "composite-video-connector";
+		label = "CVBS IN CN4";
+
+		port {
+			cvbs_con: endpoint {
+				remote-endpoint = <&adv7482_ain7>;
+			};
+		};
+	};
+
+	/* CN3 */
+	/* Eagle: SW18 set to OFF */
+	hdmi-in-cn3 {
+		compatible = "hdmi-connector";
+		label = "HDMI IN CN3";
+		type = "a";
+
+		port {
+			hdmi_in_con: endpoint {
+				remote-endpoint = <&adv7482_hdmi>;
+			};
+		};
+	};
+
+	/* CN2 */
+	/* Eagle: SW35 set 5, 6 and 8 to OFF */
+	hdmi-in-cn2 {
+		compatible = "hdmi-connector";
+		label = "HDMI IN CN2";
+		type = "a";
+
+		port {
+			hdmi_in_con2: endpoint {
+				remote-endpoint = <&adv7612_in>;
+			};
+		};
+	};
+};
+
+/* Disconnect MAX9286 GMSL i2c. */
+&i2c3 {
+	status = "disabled";
+};
+
+/* Connect expansion board i2c. */
+&i2c0 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	io_expander_27: gpio@27 {
+		compatible = "onnn,pca9654";
+		reg = <0x27>;
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		vin0_adv7612_en {
+                       gpio-hog;
+                       gpios = <0x3 0x0>;
+                       output-low;
+                       line-name = "VIN0_ADV7612_ENn";
+               };
+	};
+
+	dmi-decoder@4c {
+		compatible = "adi,adv7612";
+		reg = <0x4c>, <0x50>, <0x52>, <0x54>, <0x56>, <0x58>;
+		reg-names = "main", "afe", "rep", "edid", "hdmi", "cp";
+		interrupt-parent = <&gpio3>;
+		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+		default-input = <0>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				adv7612_in: endpoint {
+					remote-endpoint = <&hdmi_in_con2>;
+				};
+			};
+
+			port@2 {
+				reg = <2>;
+
+				adv7612_out: endpoint {
+					remote-endpoint = <&vin0_in>;
+				};
+			};
+		};
+	};
+
+	adv7482_70: video-receiver@70 {
+		compatible = "adi,adv7482";
+		reg = <0x70 0x71 0x72 0x73 0x74 0x75
+		       0x60 0x61 0x62 0x63 0x64 0x65>;
+		reg-names = "main", "dpll", "cp", "hdmi", "edid", "repeater",
+			    "infoframe", "cbus", "cec", "sdp", "txa", "txb" ;
+		interrupt-parent = <&gpio3>;
+		interrupts = <03 IRQ_TYPE_LEVEL_LOW>, <04 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "intrq1", "intrq2";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@7 {
+				reg = <7>;
+
+				adv7482_ain7: endpoint {
+					remote-endpoint = <&cvbs_con>;
+				};
+			};
+
+			port@8 {
+				reg = <8>;
+
+				adv7482_hdmi: endpoint {
+					remote-endpoint = <&hdmi_in_con>;
+				};
+			};
+
+			port@a {
+				reg = <10>;
+
+				adv7482_txa: endpoint {
+					clock-lanes = <0>;
+					data-lanes = <1 2 3 4>;
+					remote-endpoint = <&csi40_in>;
+				};
+			};
+		};
+	};
+
+};
+
+&csi40 {
+	status = "okay";
+
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			csi40_in: endpoint {
+				clock-lanes = <0>;
+				data-lanes = <1 2 3 4>;
+				remote-endpoint = <&adv7482_txa>;
+			};
+		};
+	};
+};
+
+&pfc {
+	vin0_pins_parallel: vin0 {
+		groups = "vin0_data12", "vin0_sync", "vin0_clk", "vin0_clkenb";
+		function = "vin0";
+	};
+};
+
+&vin0 {
+	status = "okay";
+
+	pinctrl-0 = <&vin0_pins_parallel>;
+	pinctrl-names = "default";
+
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			vin0_in: endpoint {
+				pclk-sample = <0>;
+				hsync-active = <0>;
+				vsync-active = <0>;
+				remote-endpoint = <&adv7612_out>;
+			};
+		};
+	};
+};
+
+&vin1 {
+	status = "okay";
+};
+
+&vin2 {
+	status = "okay";
+};
+
+&vin3 {
+	status = "okay";
+};
-- 
2.43.0


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

* Re: [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board
  2024-01-23 14:53 [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board Niklas Söderlund
@ 2024-02-10 13:04 ` Niklas Söderlund
  2024-02-15 18:32 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2024-02-10 13:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc, devicetree

Hi Geert,

A gentle ping on this patch.

On 2024-01-23 15:53:54 +0100, Niklas Söderlund wrote:
> The Eagle board supports an optional expansion board. The expansion
> board adds support for HDMI OUT, HDMI capture from two different sources
> and eMMC.
> 
> This change only adds support for the two HDMI capture sources.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  arch/arm64/boot/dts/renesas/Makefile          |   2 +
>  .../dts/renesas/r8a77970-eagle-expansion.dtso | 214 ++++++++++++++++++
>  2 files changed, 216 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso
> 
> diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
> index 8ea68d582710..38fadc161709 100644
> --- a/arch/arm64/boot/dts/renesas/Makefile
> +++ b/arch/arm64/boot/dts/renesas/Makefile
> @@ -62,6 +62,8 @@ dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb.dtb
>  dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb-kf.dtb
>  
>  dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle.dtb
> +r8a77970-eagle-expansion-dtbs := r8a77970-eagle.dtb r8a77970-eagle-expansion.dtbo
> +dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle-expansion.dtb
>  dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-v3msk.dtb
>  
>  dtb-$(CONFIG_ARCH_R8A77980) += r8a77980-condor.dtb
> diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso b/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso
> new file mode 100644
> index 000000000000..bd32f263e740
> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso
> @@ -0,0 +1,214 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for the Eagle V3M expansion board.
> + *
> + * Copyright (C) 2024 Niklas Söderlund <niklas.soderlund@ragnatech.se>
> + */
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +
> +/dts-v1/;
> +/plugin/;
> +
> +/ {
> +	/* CN4 */
> +	/* Eagle: SW18 set to OFF */
> +	cvbs-in-cn4 {
> +		compatible = "composite-video-connector";
> +		label = "CVBS IN CN4";
> +
> +		port {
> +			cvbs_con: endpoint {
> +				remote-endpoint = <&adv7482_ain7>;
> +			};
> +		};
> +	};
> +
> +	/* CN3 */
> +	/* Eagle: SW18 set to OFF */
> +	hdmi-in-cn3 {
> +		compatible = "hdmi-connector";
> +		label = "HDMI IN CN3";
> +		type = "a";
> +
> +		port {
> +			hdmi_in_con: endpoint {
> +				remote-endpoint = <&adv7482_hdmi>;
> +			};
> +		};
> +	};
> +
> +	/* CN2 */
> +	/* Eagle: SW35 set 5, 6 and 8 to OFF */
> +	hdmi-in-cn2 {
> +		compatible = "hdmi-connector";
> +		label = "HDMI IN CN2";
> +		type = "a";
> +
> +		port {
> +			hdmi_in_con2: endpoint {
> +				remote-endpoint = <&adv7612_in>;
> +			};
> +		};
> +	};
> +};
> +
> +/* Disconnect MAX9286 GMSL i2c. */
> +&i2c3 {
> +	status = "disabled";
> +};
> +
> +/* Connect expansion board i2c. */
> +&i2c0 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +
> +	io_expander_27: gpio@27 {
> +		compatible = "onnn,pca9654";
> +		reg = <0x27>;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +
> +		vin0_adv7612_en {
> +                       gpio-hog;
> +                       gpios = <0x3 0x0>;
> +                       output-low;
> +                       line-name = "VIN0_ADV7612_ENn";
> +               };
> +	};
> +
> +	dmi-decoder@4c {
> +		compatible = "adi,adv7612";
> +		reg = <0x4c>, <0x50>, <0x52>, <0x54>, <0x56>, <0x58>;
> +		reg-names = "main", "afe", "rep", "edid", "hdmi", "cp";
> +		interrupt-parent = <&gpio3>;
> +		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> +		default-input = <0>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				adv7612_in: endpoint {
> +					remote-endpoint = <&hdmi_in_con2>;
> +				};
> +			};
> +
> +			port@2 {
> +				reg = <2>;
> +
> +				adv7612_out: endpoint {
> +					remote-endpoint = <&vin0_in>;
> +				};
> +			};
> +		};
> +	};
> +
> +	adv7482_70: video-receiver@70 {
> +		compatible = "adi,adv7482";
> +		reg = <0x70 0x71 0x72 0x73 0x74 0x75
> +		       0x60 0x61 0x62 0x63 0x64 0x65>;
> +		reg-names = "main", "dpll", "cp", "hdmi", "edid", "repeater",
> +			    "infoframe", "cbus", "cec", "sdp", "txa", "txb" ;
> +		interrupt-parent = <&gpio3>;
> +		interrupts = <03 IRQ_TYPE_LEVEL_LOW>, <04 IRQ_TYPE_LEVEL_LOW>;
> +		interrupt-names = "intrq1", "intrq2";
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@7 {
> +				reg = <7>;
> +
> +				adv7482_ain7: endpoint {
> +					remote-endpoint = <&cvbs_con>;
> +				};
> +			};
> +
> +			port@8 {
> +				reg = <8>;
> +
> +				adv7482_hdmi: endpoint {
> +					remote-endpoint = <&hdmi_in_con>;
> +				};
> +			};
> +
> +			port@a {
> +				reg = <10>;
> +
> +				adv7482_txa: endpoint {
> +					clock-lanes = <0>;
> +					data-lanes = <1 2 3 4>;
> +					remote-endpoint = <&csi40_in>;
> +				};
> +			};
> +		};
> +	};
> +
> +};
> +
> +&csi40 {
> +	status = "okay";
> +
> +	ports {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		port@0 {
> +			reg = <0>;
> +
> +			csi40_in: endpoint {
> +				clock-lanes = <0>;
> +				data-lanes = <1 2 3 4>;
> +				remote-endpoint = <&adv7482_txa>;
> +			};
> +		};
> +	};
> +};
> +
> +&pfc {
> +	vin0_pins_parallel: vin0 {
> +		groups = "vin0_data12", "vin0_sync", "vin0_clk", "vin0_clkenb";
> +		function = "vin0";
> +	};
> +};
> +
> +&vin0 {
> +	status = "okay";
> +
> +	pinctrl-0 = <&vin0_pins_parallel>;
> +	pinctrl-names = "default";
> +
> +	ports {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		port@0 {
> +			reg = <0>;
> +
> +			vin0_in: endpoint {
> +				pclk-sample = <0>;
> +				hsync-active = <0>;
> +				vsync-active = <0>;
> +				remote-endpoint = <&adv7612_out>;
> +			};
> +		};
> +	};
> +};
> +
> +&vin1 {
> +	status = "okay";
> +};
> +
> +&vin2 {
> +	status = "okay";
> +};
> +
> +&vin3 {
> +	status = "okay";
> +};
> -- 
> 2.43.0
> 

-- 
Kind Regards,
Niklas Söderlund

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

* Re: [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board
  2024-01-23 14:53 [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board Niklas Söderlund
  2024-02-10 13:04 ` Niklas Söderlund
@ 2024-02-15 18:32 ` Geert Uytterhoeven
  2024-02-24 18:00   ` Niklas Söderlund
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2024-02-15 18:32 UTC (permalink / raw)
  To: Niklas Söderlund; +Cc: linux-renesas-soc, devicetree

Hi Niklas,

On Tue, Jan 23, 2024 at 3:54 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The Eagle board supports an optional expansion board. The expansion

The title page of the schematics document calls this the "Function
expansion board".

> board adds support for HDMI OUT, HDMI capture from two different sources
> and eMMC.
>
> This change only adds support for the two HDMI capture sources.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/Makefile
> +++ b/arch/arm64/boot/dts/renesas/Makefile
> @@ -62,6 +62,8 @@ dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb.dtb
>  dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb-kf.dtb
>
>  dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle.dtb

Please add

    dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle-expansion.dtbo

so that the .dtbo is considered for installation, too.

> +r8a77970-eagle-expansion-dtbs := r8a77970-eagle.dtb r8a77970-eagle-expansion.dtbo
> +dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle-expansion.dtb
>  dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-v3msk.dtb
>
>  dtb-$(CONFIG_ARCH_R8A77980) += r8a77980-condor.dtb

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso

This is a rather generic name.
What about r8a77970-eagle-function-expansion.dtso?

> @@ -0,0 +1,214 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for the Eagle V3M expansion board.

... Function expansion board?

> + *
> + * Copyright (C) 2024 Niklas Söderlund <niklas.soderlund@ragnatech.se>
> + */
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/interrupt-controller/irq.h>

Please move the includes below the /.../; markers.

> +
> +/dts-v1/;
> +/plugin/;
> +
> +/ {
> +       /* CN4 */
> +       /* Eagle: SW18 set to OFF */
> +       cvbs-in-cn4 {
> +               compatible = "composite-video-connector";
> +               label = "CVBS IN CN4";
> +
> +               port {
> +                       cvbs_con: endpoint {
> +                               remote-endpoint = <&adv7482_ain7>;
> +                       };
> +               };
> +       };
> +
> +       /* CN3 */
> +       /* Eagle: SW18 set to OFF */
> +       hdmi-in-cn3 {

Please use alphabetical sort order for nodes without unit addresses.

> +               compatible = "hdmi-connector";
> +               label = "HDMI IN CN3";
> +               type = "a";
> +
> +               port {
> +                       hdmi_in_con: endpoint {
> +                               remote-endpoint = <&adv7482_hdmi>;
> +                       };
> +               };
> +       };
> +
> +       /* CN2 */
> +       /* Eagle: SW35 set 5, 6 and 8 to OFF */
> +       hdmi-in-cn2 {
> +               compatible = "hdmi-connector";
> +               label = "HDMI IN CN2";
> +               type = "a";
> +
> +               port {
> +                       hdmi_in_con2: endpoint {
> +                               remote-endpoint = <&adv7612_in>;
> +                       };
> +               };
> +       };
> +};
> +
> +/* Disconnect MAX9286 GMSL i2c. */

I2C

> +&i2c3 {
> +       status = "disabled";
> +};
> +
> +/* Connect expansion board i2c. */

I2C

> +&i2c0 {
> +       #address-cells = <1>;
> +       #size-cells = <0>;
> +
> +       io_expander_27: gpio@27 {
> +               compatible = "onnn,pca9654";
> +               reg = <0x27>;
> +               gpio-controller;
> +               #gpio-cells = <2>;
> +
> +               vin0_adv7612_en {
> +                       gpio-hog;
> +                       gpios = <0x3 0x0>;

Please use symbolic values for GPIO flags, i.e. GPIO_ACTIVE_HIGH.

> +                       output-low;
> +                       line-name = "VIN0_ADV7612_ENn";

Given this signal is active-low, you probably want:

    gpios = <3 GPIO_ACTIVE_LOW>;
    output-high;

> +               };
> +       };
> +
> +       dmi-decoder@4c {

hdmi-decoder

According to the schematics, the primary address is 0x4d?

> +               compatible = "adi,adv7612";
> +               reg = <0x4c>, <0x50>, <0x52>, <0x54>, <0x56>, <0x58>;
> +               reg-names = "main", "afe", "rep", "edid", "hdmi", "cp";
> +               interrupt-parent = <&gpio3>;
> +               interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> +               default-input = <0>;

> +       };
> +
> +       adv7482_70: video-receiver@70 {

Do you see a future user for this label?
Just wondering, as some nodes have labels, others haven't.

> +               compatible = "adi,adv7482";
> +               reg = <0x70 0x71 0x72 0x73 0x74 0x75
> +                      0x60 0x61 0x62 0x63 0x64 0x65>;
> +               reg-names = "main", "dpll", "cp", "hdmi", "edid", "repeater",
> +                           "infoframe", "cbus", "cec", "sdp", "txa", "txb" ;
> +               interrupt-parent = <&gpio3>;
> +               interrupts = <03 IRQ_TYPE_LEVEL_LOW>, <04 IRQ_TYPE_LEVEL_LOW>;
> +               interrupt-names = "intrq1", "intrq2";

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] 4+ messages in thread

* Re: [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board
  2024-02-15 18:32 ` Geert Uytterhoeven
@ 2024-02-24 18:00   ` Niklas Söderlund
  0 siblings, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2024-02-24 18:00 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc, devicetree

Hi Geert,

Tanks for your feedback.

I have taken all your comments for v2 except the i2c address of adv7126, 
see reason below.

On 2024-02-15 19:32:32 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Tue, Jan 23, 2024 at 3:54 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > The Eagle board supports an optional expansion board. The expansion
> 
> The title page of the schematics document calls this the "Function
> expansion board".
> 
> > board adds support for HDMI OUT, HDMI capture from two different sources
> > and eMMC.
> >
> > This change only adds support for the two HDMI capture sources.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> Thanks for your patch!
> 
> > --- a/arch/arm64/boot/dts/renesas/Makefile
> > +++ b/arch/arm64/boot/dts/renesas/Makefile
> > @@ -62,6 +62,8 @@ dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb.dtb
> >  dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-ulcb-kf.dtb
> >
> >  dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle.dtb
> 
> Please add
> 
>     dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle-expansion.dtbo
> 
> so that the .dtbo is considered for installation, too.
> 
> > +r8a77970-eagle-expansion-dtbs := r8a77970-eagle.dtb r8a77970-eagle-expansion.dtbo
> > +dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle-expansion.dtb
> >  dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-v3msk.dtb
> >
> >  dtb-$(CONFIG_ARCH_R8A77980) += r8a77980-condor.dtb
> 
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle-expansion.dtso
> 
> This is a rather generic name.
> What about r8a77970-eagle-function-expansion.dtso?
> 
> > @@ -0,0 +1,214 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Device Tree Source for the Eagle V3M expansion board.
> 
> ... Function expansion board?
> 
> > + *
> > + * Copyright (C) 2024 Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > + */
> > +
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/interrupt-controller/irq.h>
> 
> Please move the includes below the /.../; markers.
> 
> > +
> > +/dts-v1/;
> > +/plugin/;
> > +
> > +/ {
> > +       /* CN4 */
> > +       /* Eagle: SW18 set to OFF */
> > +       cvbs-in-cn4 {
> > +               compatible = "composite-video-connector";
> > +               label = "CVBS IN CN4";
> > +
> > +               port {
> > +                       cvbs_con: endpoint {
> > +                               remote-endpoint = <&adv7482_ain7>;
> > +                       };
> > +               };
> > +       };
> > +
> > +       /* CN3 */
> > +       /* Eagle: SW18 set to OFF */
> > +       hdmi-in-cn3 {
> 
> Please use alphabetical sort order for nodes without unit addresses.
> 
> > +               compatible = "hdmi-connector";
> > +               label = "HDMI IN CN3";
> > +               type = "a";
> > +
> > +               port {
> > +                       hdmi_in_con: endpoint {
> > +                               remote-endpoint = <&adv7482_hdmi>;
> > +                       };
> > +               };
> > +       };
> > +
> > +       /* CN2 */
> > +       /* Eagle: SW35 set 5, 6 and 8 to OFF */
> > +       hdmi-in-cn2 {
> > +               compatible = "hdmi-connector";
> > +               label = "HDMI IN CN2";
> > +               type = "a";
> > +
> > +               port {
> > +                       hdmi_in_con2: endpoint {
> > +                               remote-endpoint = <&adv7612_in>;
> > +                       };
> > +               };
> > +       };
> > +};
> > +
> > +/* Disconnect MAX9286 GMSL i2c. */
> 
> I2C
> 
> > +&i2c3 {
> > +       status = "disabled";
> > +};
> > +
> > +/* Connect expansion board i2c. */
> 
> I2C
> 
> > +&i2c0 {
> > +       #address-cells = <1>;
> > +       #size-cells = <0>;
> > +
> > +       io_expander_27: gpio@27 {
> > +               compatible = "onnn,pca9654";
> > +               reg = <0x27>;
> > +               gpio-controller;
> > +               #gpio-cells = <2>;
> > +
> > +               vin0_adv7612_en {
> > +                       gpio-hog;
> > +                       gpios = <0x3 0x0>;
> 
> Please use symbolic values for GPIO flags, i.e. GPIO_ACTIVE_HIGH.
> 
> > +                       output-low;
> > +                       line-name = "VIN0_ADV7612_ENn";
> 
> Given this signal is active-low, you probably want:
> 
>     gpios = <3 GPIO_ACTIVE_LOW>;
>     output-high;
> 
> > +               };
> > +       };
> > +
> > +       dmi-decoder@4c {
> 
> hdmi-decoder
> 
> According to the schematics, the primary address is 0x4d?

Indeed it is, but it do not answer at 0x4d but at 0x4c, I do not know 
why, maybe the datasheet is wrong? I have had some version or not of 
this change in my tree for years so I can't remember how I figured this 
out, but I just retested and nothing answers at 0x4d but capture works 
find with 0x4c.

> 
> > +               compatible = "adi,adv7612";
> > +               reg = <0x4c>, <0x50>, <0x52>, <0x54>, <0x56>, <0x58>;
> > +               reg-names = "main", "afe", "rep", "edid", "hdmi", "cp";
> > +               interrupt-parent = <&gpio3>;
> > +               interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> > +               default-input = <0>;
> 
> > +       };
> > +
> > +       adv7482_70: video-receiver@70 {
> 
> Do you see a future user for this label?
> Just wondering, as some nodes have labels, others haven't.
> 
> > +               compatible = "adi,adv7482";
> > +               reg = <0x70 0x71 0x72 0x73 0x74 0x75
> > +                      0x60 0x61 0x62 0x63 0x64 0x65>;
> > +               reg-names = "main", "dpll", "cp", "hdmi", "edid", "repeater",
> > +                           "infoframe", "cbus", "cec", "sdp", "txa", "txb" ;
> > +               interrupt-parent = <&gpio3>;
> > +               interrupts = <03 IRQ_TYPE_LEVEL_LOW>, <04 IRQ_TYPE_LEVEL_LOW>;
> > +               interrupt-names = "intrq1", "intrq2";
> 
> 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

-- 
Kind Regards,
Niklas Söderlund

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

end of thread, other threads:[~2024-02-24 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 14:53 [PATCH] arm64: dts: renesas: eagle: Add capture overlay for expansion board Niklas Söderlund
2024-02-10 13:04 ` Niklas Söderlund
2024-02-15 18:32 ` Geert Uytterhoeven
2024-02-24 18:00   ` Niklas Söderlund

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