Skip to contentSkip to conversation

arm64: dts: renesas: add V4H White Hawk Sound support

PATCH In review Kuninori Morimoto 2 participants 17 messages Feb 2, 2023 – Feb 13, 2023

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover arm64: dts: renesas: add V4H White Hawk Sound support

Hi Geert

This patch-set add Sound support to V4H White Hawk board. It needs ARD-AUDIO-DA7212 sound expansion board to use it.

And it needs R-Car Gen4 sound driver support which will be supported on v6.3.
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=c2bc65274a307e11743d0f56a762f8e57f279b9e

I think [5/9] / [6/9] are depends on above ASoC branch, others has no dependencies.

I'm happy to re-post [5/9][6/9] patches after v6.3-rc1 was released. Please let me know about it if you need.

Kuninori Morimoto (5):
clk: renesas: r8a779g0: Add Audio clocks
arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator
arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support
arm64: defconfig: Enable DA7213 Codec
arm64: renesas_defconfig: Enable DA7213 Codec

Linh Phung (3):
pinctrl: renesas: r8a779g0: Add Audio Clock support
pinctrl: renesas: r8a779g0: Add Audio SSI support
arm64: dts: renesas: r8a779g0: R-Car Sound support

Takeshi Kihara (1):
clk: renesas: cpg-mssr: Fix MSSR register range for V4H

 arch/arm64/boot/dts/renesas/Makefile          |   1 +
 .../r8a779g0-white-hawk-ard-audio-da7212.dts  | 194 ++++++++++++++++++
 .../dts/renesas/r8a779g0-white-hawk-cpu.dtsi  |   9 +
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi     |  78 +++++++
 arch/arm64/configs/defconfig                  |   1 +
 arch/arm64/configs/renesas_defconfig          |   1 +
 drivers/clk/renesas/r8a779g0-cpg-mssr.c       |   2 +
 drivers/clk/renesas/renesas-cpg-mssr.c        |   8 +-
 drivers/pinctrl/renesas/pfc-r8a779g0.c        |  58 ++++++
 9 files changed, 348 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/9 pinctrl: renesas: r8a779g0: Add Audio Clock support

From: Linh Phung <[email protected]>

This patch adds Audio Clock pins, groups, and functions to r8a779g0 SoC.

---
 drivers/pinctrl/renesas/pfc-r8a779g0.c | 29 ++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
drivers/pinctrl/renesas/pfc-r8a779g0.c +29 -0
index bf7fcce2d9c6..a145466d1cf9 100644
@@ -1196,6 +1196,25 @@ static const struct sh_pfc_pin pinmux_pins[] = {
 	PINMUX_GPIO_GP_ALL(),
 };
 
+/* - AUDIO CLOCK ----------------------------------------- */
+static const unsigned int audio_clkin_pins[] = {
+	/* CLK IN */
+	RCAR_GP_PIN(1, 22),
+};
+
+static const unsigned int audio_clkin_mux[] = {
+	AUDIO_CLKIN_MARK,
+};
+
+static const unsigned int audio_clkout_pins[] = {
+	/* CLK OUT */
+	RCAR_GP_PIN(1, 21),
+};
+
+static const unsigned int audio_clkout_mux[] = {
+	AUDIO_CLKOUT_MARK,
+};
+
 /* - AVB0 ------------------------------------------------ */
 static const unsigned int avb0_link_pins[] = {
 	/* AVB0_LINK */
@@ -2461,6 +2480,9 @@ static const unsigned int tsn0_avtp_match_mux[] = {
 };
 
 static const struct sh_pfc_pin_group pinmux_groups[] = {
+	SH_PFC_PIN_GROUP(audio_clkin),
+	SH_PFC_PIN_GROUP(audio_clkout),
+
 	SH_PFC_PIN_GROUP(avb0_link),
 	SH_PFC_PIN_GROUP(avb0_magic),
 	SH_PFC_PIN_GROUP(avb0_phy_int),
@@ -2640,6 +2662,11 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(tsn0_avtp_match),
 };
 
+static const char * const audio_clk_groups[] = {
+	"audio_clkin",
+	"audio_clkout",
+};
+
 static const char * const avb0_groups[] = {
 	"avb0_link",
 	"avb0_magic",
@@ -2957,6 +2984,8 @@ static const char * const tsn0_groups[] = {
 };
 
 static const struct sh_pfc_function pinmux_functions[] = {
+	SH_PFC_FUNCTION(audio_clk),
+
 	SH_PFC_FUNCTION(avb0),
 	SH_PFC_FUNCTION(avb1),
 	SH_PFC_FUNCTION(avb2),
Signature · 1 line
2.25.1
Reviewed-by on v1 1/9
#2 lore raw

Re: [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support

Quoted 7 lines · Kuninori Morimoto

From: Linh Phung <[email protected]>

This patch adds Audio Clock pins, groups, and functions to r8a779g0 SoC.

My

on v1 is still valid, i.e. will queue in renesas-pinctrl-for-v6.4.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#3 lore raw

PATCH 2/9 pinctrl: renesas: r8a779g0: Add Audio SSI support

In reply to Kuninori Morimoto

From: Linh Phung <[email protected]>

This patch adds Audio SSI pins, groups, and functions to r8a779g0 SoC.

---
 drivers/pinctrl/renesas/pfc-r8a779g0.c | 29 ++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
drivers/pinctrl/renesas/pfc-r8a779g0.c +29 -0
index a145466d1cf9..1954d66adf4f 100644
@@ -2348,6 +2348,25 @@ static const unsigned int scif_clk_mux[] = {
 	SCIF_CLK_MARK,
 };
 
+/* - SSI ------------------------------------------------- */
+static const unsigned int ssi_data_pins[] = {
+	/* SSI_SD */
+	RCAR_GP_PIN(1, 20),
+};
+
+static const unsigned int ssi_data_mux[] = {
+	SSI_SD_MARK,
+};
+
+static const unsigned int ssi_ctrl_pins[] = {
+	/* SSI_SCK,  SSI_WS */
+	RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 19),
+};
+
+static const unsigned int ssi_ctrl_mux[] = {
+	SSI_SCK_MARK, SSI_WS_MARK,
+};
+
 /* - TPU ------------------------------------------------------------------- */
 static const unsigned int tpu_to0_pins[] = {
 	/* TPU0TO0 */
@@ -2643,6 +2662,9 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(scif4_ctrl),
 	SH_PFC_PIN_GROUP(scif_clk),
 
+	SH_PFC_PIN_GROUP(ssi_data),
+	SH_PFC_PIN_GROUP(ssi_ctrl),
+
 	SH_PFC_PIN_GROUP(tpu_to0),		/* suffix might be updated */
 	SH_PFC_PIN_GROUP(tpu_to0_a),		/* suffix might be updated */
 	SH_PFC_PIN_GROUP(tpu_to1),		/* suffix might be updated */
@@ -2960,6 +2982,11 @@ static const char * const scif_clk_groups[] = {
 	"scif_clk",
 };
 
+static const char * const ssi_groups[] = {
+	"ssi_data",
+	"ssi_ctrl",
+};
+
 static const char * const tpu_groups[] = {
 	/* suffix might be updated */
 	"tpu_to0",
@@ -3043,6 +3070,8 @@ static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(scif4),
 	SH_PFC_FUNCTION(scif_clk),
 
+	SH_PFC_FUNCTION(ssi),
+
 	SH_PFC_FUNCTION(tpu),
 
 	SH_PFC_FUNCTION(tsn0),
Signature · 1 line
2.25.1
Reviewed-by on v1 2/9
#4 lore raw

Re: [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support

Quoted 7 lines · Kuninori Morimoto

From: Linh Phung <[email protected]>

This patch adds Audio SSI pins, groups, and functions to r8a779g0 SoC.

My

on v1 is still valid, i.e. will queue in renesas-pinctrl-for-v6.4.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#5 lore raw

PATCH 3/9 clk: renesas: cpg-mssr: Fix MSSR register range for V4H

In reply to Kuninori Morimoto

From: Takeshi Kihara <[email protected]>

The SRCR, SRSTCLR, MSTPCR and MSTPSR registers for R-Car V4H (R8A779G0) each have registers up to offset 0x74.
This patch update it.

---
 drivers/clk/renesas/renesas-cpg-mssr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/renesas/renesas-cpg-mssr.c +4 -4
index 202aeb232044..3b899ffa88b4 100644
@@ -61,7 +61,7 @@ static const u16 mstpsr_for_gen4[] = {
 	0x2E00, 0x2E04, 0x2E08, 0x2E0C, 0x2E10, 0x2E14, 0x2E18, 0x2E1C,
 	0x2E20, 0x2E24, 0x2E28, 0x2E2C, 0x2E30, 0x2E34, 0x2E38, 0x2E3C,
 	0x2E40, 0x2E44, 0x2E48, 0x2E4C, 0x2E50, 0x2E54, 0x2E58, 0x2E5C,
-	0x2E60, 0x2E64, 0x2E68, 0x2E6C,
+	0x2E60, 0x2E64, 0x2E68, 0x2E6C, 0x2E70, 0x2E74,
 };
 
 /*
@@ -77,7 +77,7 @@ static const u16 mstpcr_for_gen4[] = {
 	0x2D00, 0x2D04, 0x2D08, 0x2D0C, 0x2D10, 0x2D14, 0x2D18, 0x2D1C,
 	0x2D20, 0x2D24, 0x2D28, 0x2D2C, 0x2D30, 0x2D34, 0x2D38, 0x2D3C,
 	0x2D40, 0x2D44, 0x2D48, 0x2D4C, 0x2D50, 0x2D54, 0x2D58, 0x2D5C,
-	0x2D60, 0x2D64, 0x2D68, 0x2D6C,
+	0x2D60, 0x2D64, 0x2D68, 0x2D6C, 0x2D70, 0x2D74,
 };
 
 /*
@@ -103,7 +103,7 @@ static const u16 srcr_for_gen4[] = {
 	0x2C00, 0x2C04, 0x2C08, 0x2C0C, 0x2C10, 0x2C14, 0x2C18, 0x2C1C,
 	0x2C20, 0x2C24, 0x2C28, 0x2C2C, 0x2C30, 0x2C34, 0x2C38, 0x2C3C,
 	0x2C40, 0x2C44, 0x2C48, 0x2C4C, 0x2C50, 0x2C54, 0x2C58, 0x2C5C,
-	0x2C60, 0x2C64, 0x2C68, 0x2C6C,
+	0x2C60, 0x2C64, 0x2C68, 0x2C6C, 0x2C70, 0x2C74,
 };
 
 /*
@@ -119,7 +119,7 @@ static const u16 srstclr_for_gen4[] = {
 	0x2C80, 0x2C84, 0x2C88, 0x2C8C, 0x2C90, 0x2C94, 0x2C98, 0x2C9C,
 	0x2CA0, 0x2CA4, 0x2CA8, 0x2CAC, 0x2CB0, 0x2CB4, 0x2CB8, 0x2CBC,
 	0x2CC0, 0x2CC4, 0x2CC8, 0x2CCC, 0x2CD0, 0x2CD4, 0x2CD8, 0x2CDC,
-	0x2CE0, 0x2CE4, 0x2CE8, 0x2CEC,
+	0x2CE0, 0x2CE4, 0x2CE8, 0x2CEC, 0x2CF0, 0x2CF4,
 };
 
 /**
Signature · 1 line
2.25.1
Reviewed-by on v1 3/9
#6 lore raw

Re: [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H

Quoted 8 lines · Kuninori Morimoto

From: Takeshi Kihara <[email protected]>

The SRCR, SRSTCLR, MSTPCR and MSTPSR registers for R-Car V4H (R8A779G0) each have registers up to offset 0x74.
This patch update it.

i.e. will queue in renesas-clk-for-v6.4.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#7 lore raw

PATCH 4/9 clk: renesas: r8a779g0: Add Audio clocks

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

This patch adds module clocks for Audio (SSI/SSIU) blocks on the Renesas R-Car V4H (R8A779G0) SoC.

---
 drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/renesas/r8a779g0-cpg-mssr.c +2 -0
index 7fca11204f74..18a9462dab76 100644
@@ -213,6 +213,8 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = {
 	DEF_MOD("pfc1",		916,	R8A779G0_CLK_CL16M),
 	DEF_MOD("pfc2",		917,	R8A779G0_CLK_CL16M),
 	DEF_MOD("pfc3",		918,	R8A779G0_CLK_CL16M),
+	DEF_MOD("ssiu",		2926,	R8A779G0_CLK_S0D6_PER),
+	DEF_MOD("ssi",		2927,	R8A779G0_CLK_S0D6_PER),
 };
 
 /*
Signature · 1 line
2.25.1
Reviewed-by on v1 4/9
#8 lore raw

Re: [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks

Quoted 6 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

This patch adds module clocks for Audio (SSI/SSIU) blocks on the Renesas R-Car V4H (R8A779G0) SoC.

i.e. will queue in renesas-clk-for-v6.4.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#9 lore raw

PATCH 5/9 arm64: dts: renesas: r8a779g0: R-Car Sound support

In reply to Kuninori Morimoto

From: Linh Phung <[email protected]>

This patch adds Sound support for R-Car V4H.

---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 78 +++++++++++++++++++++++
 1 file changed, 78 insertions(+)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +78 -0
index 7a87a5dc1b6a..b7855aaebddc 100644
@@ -178,6 +178,15 @@ scif_clk: scif {
 		clock-frequency = <0>;
 	};
 
+	/*
+	 * The clock from AUDIO_CLKIN pin are configured as 0 Hz fixed frequency
+	 */
+	audio_clkin: audio_clkin {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+	};
+
 	soc: soc {
 		compatible = "simple-bus";
 		interrupt-parent = <&gic>;
@@ -1168,6 +1177,75 @@ dmac1: dma-controller@e7351000 {
 			dma-channels = <16>;
 		};
 
+		rcar_sound: sound@ec540000 {
+			/*
+			 * #sound-dai-cells is required
+			 *
+			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
+			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
+			 */
+			/*
+			 * #clock-cells is required
+			 *
+			 * clkout		: #clock-cells = <0>;	<&rcar_sound>;
+			 * audio_clkout0/1/2/3	: #clock-cells = <1>;	<&rcar_sound N>;
+			 */
+			compatible = "renesas,rcar_sound-r8a779g0", "renesas,rcar_sound-gen4";
+			reg =	<0 0xec5a0000 0 0x020>,		/* ADG  */
+				<0 0xec540000 0 0x1000>,	/* SSIU */
+				<0 0xec541000 0 0x050>,		/* SSI  */
+				<0 0xec400000 0 0x40000>;	/* SDMC */
+			reg-names = "adg", "ssiu", "ssi", "sdmc";
+
+			clocks = <&cpg CPG_MOD 2926>, <&cpg CPG_MOD 2927>, <&audio_clkin>;
+			clock-names = "ssiu.0", "ssi.0", "clkin";
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 2926>, <&cpg 2927>;
+			reset-names = "ssiu.0", "ssi.0";
+			status = "disabled";
+
+			rcar_sound,ssiu {
+				ssiu00: ssiu-0 {
+					dmas = <&dmac0 0x6e>, <&dmac0 0x6f>;
+					dma-names = "tx", "rx";
+				};
+				ssiu01: ssiu-1 {
+					dmas = <&dmac0 0x6c>, <&dmac0 0x6d>;
+					dma-names = "tx", "rx";
+				};
+				ssiu02: ssiu-2 {
+					dmas = <&dmac0 0x6a>, <&dmac0 0x6b>;
+					dma-names = "tx", "rx";
+				};
+				ssiu03: ssiu-3 {
+					dmas = <&dmac0 0x68>, <&dmac0 0x69>;
+					dma-names = "tx", "rx";
+				};
+				ssiu04: ssiu-4 {
+					dmas = <&dmac0 0x66>, <&dmac0 0x67>;
+					dma-names = "tx", "rx";
+				};
+				ssiu05: ssiu-5 {
+					dmas = <&dmac0 0x64>, <&dmac0 0x65>;
+					dma-names = "tx", "rx";
+				};
+				ssiu06: ssiu-6 {
+					dmas = <&dmac0 0x62>, <&dmac0 0x63>;
+					dma-names = "tx", "rx";
+				};
+				ssiu07: ssiu-7 {
+					dmas = <&dmac0 0x60>, <&dmac0 0x61>;
+					dma-names = "tx", "rx";
+				};
+			};
+
+			rcar_sound,ssi {
+				ssi0: ssi-0 {
+					interrupts = <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>;
+				};
+			};
+		};
+
 		mmc0: mmc@ee140000 {
 			compatible = "renesas,sdhi-r8a779g0",
 				     "renesas,rcar-gen4-sdhi";
Signature · 1 line
2.25.1
#10 lore raw

PATCH 6/9 arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

This is prepare for White Hawk Audio Support.

---
 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi +9 -0
index bb4a5270f71b..e1fee0d38752 100644
@@ -136,6 +136,15 @@ reg_3p3v: regulator-3p3v {
 		regulator-always-on;
 	};
 
+	reg_5p0v: regulator-5p0v {
+			compatible = "regulator-fixed";
+			regulator-name = "fixed-5.0V";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			regulator-boot-on;
+			regulator-always-on;
+	};
+
 	sn65dsi86_refclk: clk-x6 {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
Signature · 1 line
2.25.1
#11 lore raw

Re: [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator

Hi Morimoto-san,

Quoted 5 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

This is prepare for White Hawk Audio Support.

Thanks for your patch!

However, I think you do not need this patch, cfr. my comments on [PATCH 7/9].

Quoted 8 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi +2 -0
@@ -136,6 +136,15 @@ reg_3p3v: regulator-3p3v {
                regulator-always-on;
        };
 
+       reg_5p0v: regulator-5p0v {
+                       compatible = "regulator-fixed";

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi reg_3p3v: regulator-3p3v { · line 150

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi +7 -0
+                       regulator-name = "fixed-5.0V";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+       };
+
        sn65dsi86_refclk: clk-x6 {
                compatible = "fixed-clock";
                #clock-cells = <0>;

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#12 lore raw

PATCH 7/9 arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

These adds R-Car Sound support for WhiteHawk board using ARD-AUDIO-DA7212 external audio board.

---
 arch/arm64/boot/dts/renesas/Makefile          |   1 +
 .../r8a779g0-white-hawk-ard-audio-da7212.dts  | 194 ++++++++++++++++++
 2 files changed, 195 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts
arch/arm64/boot/dts/renesas/Makefile +1 -0
index 0699b51c1247..df80c30e03ce 100644
@@ -67,6 +67,7 @@ dtb-$(CONFIG_ARCH_R8A779A0) += r8a779a0-falcon.dtb
 dtb-$(CONFIG_ARCH_R8A779F0) += r8a779f0-spider.dtb
 
 dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk.dtb
+dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtb
 
 dtb-$(CONFIG_ARCH_R8A77951) += r8a779m1-salvator-xs.dtb
 dtb-$(CONFIG_ARCH_R8A77951) += r8a779m1-ulcb.dtb
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +194 -0

194 lines not on this page · raw message

Signature · 1 line
2.25.1
#13 lore raw

Re: [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support

Hi Morimoto-san,

Quoted 7 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

These adds R-Car Sound support for WhiteHawk board using ARD-AUDIO-DA7212 external audio board.

Thanks for your patch!

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 7

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +7 -0
@@ -0,0 +1,194 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the White Hawk boards with R-Car V4H + ARD-AUDIO-DA7212 Board
+ *
+ * You can find and buy "ARD-AUDIO-DA7212" at Digi-Key
+ *
+ *     https://www.digikey.jp/en/products/detail/ARD-AUDIO-DA7212/1564-1021-ND/5456357?curr=usd&utm_campaign=buynow&utm_medium=aggregator&utm_source=octopart

Please drop the question mark and everything after it from the URL.

Quoted 20 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +20 -0
+ * [Connection]
+ *
+ * White Hawk                          ARD-AUDIO-DA7212
+ * +----------------------------+
+ * |CPU board                  |
+ * |                           |
+ * |CN40 (IO PIN HEADER)       |
+ * |   AUDIO_CLKIN_V     pin1  |<--\   +---------------+
+ * |(*) GP1_25/SL_SW2_V          pin2  |<--/   |J2             |
+ * |   AUDIO_CLKOUT_V    pin5  |<----->| pin7  MCLK    |
+ * |   SSI_SCK_V         pin9  |<----->| pin1  BCLK    |
+ * |   SSI_WS_V          pin13 |<----->| pin3  WCLK    |
+ * |   SSI_SD_V          pin15 |<----->| pin5  DATIN   | (@)
+ * |                           |   \-->| pin15 DATOUT  | [CAPTURE]
+ * +----------------------------+      +---------------+
+ * (*) GP1_25/SL_SW2_V is used as TPU
+ * (@) Connect to pin5 (DATIN = playback) or pin15 (DATOUT = capture)
+ *
+ * +----------------------------+
+ * |Breakout board             |

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 38

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +10 -0
+ * |                           |       +---------------+
+ * |CN34 (I2C CN)              |       |J1             |
+ * |   I2C0_SCL           pin3 |<----->| pin20 SCL     |
+ * |   I2C0_SDA           pin5 |<----->| pin18 SDA     |
+ * +----------------------------+  +--->| pin14 GND    |
+ *                                |    +---------------+
+ * +----------------------------+  |
+ * |Switch Board               |  |
+ * |                           |  |    +---------------+
+ * |CN5                            GND |<-+    |J7             |

Probably it would be more logical to wire GND to pin 14 of J7 (which is the power connector) instead?
Doesn't matter much though, as all GND signals are connected to each other.

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 39

Quoted 1 line
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +1 -0
+ * |                       3v3 |<----->| pin8  (+3.3v) |

Do you need the Switch Board?
GND and SPI_D1.8V/3.3V and I2C_D1.8V/3.3V (which are 3.3V by default) are available on CN40 and CN34 above, too.

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 92

Quoted 2 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +2 -0
+/dts-v1/;
+#include "r8a779g0-white-hawk.dts"

Please do not include "r8a779g0-white-hawk.dts", but make this file a .dtso (DTS overlay) instead, cfr. salvator-panel-aa104xd12.dtso.

Quoted 11 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +11 -0
+&i2c0 {
+       da7212: codec@1a {
+               compatible = "dlg,da7212";
+
+               #sound-dai-cells = <0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg = <0x1a>;
+
+               clocks = <&rcar_sound>;

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 147

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +10 -0
+               clock-names = "mclk";
+
+               dlg,micbias1-lvl = <2500>;
+               dlg,micbias2-lvl = <2500>;
+               dlg,dmic-data-sel = "lrise_rfall";
+               dlg,dmic-samplephase = "between_clkedge";
+               dlg,dmic-clkrate = <3000000>;
+
+               VDDA-supply   = <&reg_1p8v>;
+               VDDSP-supply  = <&reg_5p0v>;

As the wiring above does not provide VDD_SP (which is fine if the speaker is not connected), you can drop VDDSP-supply, and [PATCH 6/9] providing reg_5p0v.

FTR, "VDDSP-supply" is not documented in the DA7212 DT bindings.

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 157

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +10 -0
+               VDDMIC-supply = <&reg_3p3v>;
+               VDDIO-supply  = <&reg_3p3v>;
+
+               port@0 {
+                       da7212_endpoint: endpoint {
+                               remote-endpoint = <&rsnd_endpoint>;
+                       };
+               };
+       };
+};

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#14 lore raw

Re: [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support

Hi Geert

Quoted 5 lines
Quoted 3 lines

+ * You can find and buy "ARD-AUDIO-DA7212" at Digi-Key
+ *
+ * https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.digikey.jp%2Fen%2Fproducts%2Fdetail%2FARD-AUDIO-DA7212%2F1564-1021-ND%2F5456357%3Fcurr%3Dusd%26utm_campaign%3Dbuynow%26utm_medium%3Daggregator%26utm_source%3Doctopart&data=05%7C01%7Ckuninori.morimoto.gx%40renesas.com%7C809b5824f9e74675c42708db0b6b633c%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C638116328075928235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LuhLL%2BL0O5NaBHeocnJ%2FHDVEZ1PC8FYyY1gNErCrDEA%3D&reserved=0

Please drop the question mark and everything after it from the URL.

Thank you pointing it !
Will do in v2

Quoted 10 lines
Quoted 4 lines

+ * +----------------------------+ |

+ * |Switch Board               |  |
+ * |                           |  |    +---------------+
+ * |CN5                            GND |<-+    |J7             |

Probably it would be more logical to wire GND to pin 14 of J7 (which is the power connector) instead?
Doesn't matter much though, as all GND signals are connected to each other.

Quoted 5 lines
Quoted 1 line

+ * | 3v3 |<----->| pin8 (+3.3v) |

Do you need the Switch Board?
GND and SPI_D1.8V/3.3V and I2C_D1.8V/3.3V (which are 3.3V by default) are available on CN40 and CN34 above, too.

I double checked around here, and noticed some miss on it. Thank you for pointing it. I will fixup in v2.
About power, indeed we can find many 3v3 / GND pins on WhiteHawk. But to keep simple Image I will use similar style,
but will add small explanation for it on v2.

Quoted 5 lines

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 92

Quoted 2 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +2 -0
+/dts-v1/;
+#include "r8a779g0-white-hawk.dts"

Please do not include "r8a779g0-white-hawk.dts", but make this file a .dtso (DTS overlay) instead, cfr. salvator-panel-aa104xd12.dtso.

OK, I see.
Will do in v2

Quoted 8 lines

arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts line 147

Quoted 2 lines
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts new file +2 -0
+               VDDA-supply   = <&reg_1p8v>;
+               VDDSP-supply  = <&reg_5p0v>;

As the wiring above does not provide VDD_SP (which is fine if the speaker is not connected), you can drop VDDSP-supply, and [PATCH 6/9] providing reg_5p0v.

FTR, "VDDSP-supply" is not documented in the DA7212 DT bindings.

Thank you for pointing it.
I didn't noticed about it, will fix in v2.
And as you mentioned, we can remove [6/9] patch.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

#15 lore raw

PATCH 8/9 arm64: defconfig: Enable DA7213 Codec

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

This patch enable DA7213 Codec for ARD-AUDIO-DA7212 support on R-Car V4H White Hawk

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 851e8f9be06d..f6b0505dcc79 100644
@@ -857,6 +857,7 @@ CONFIG_SND_SOC_TEGRA210_ADX=m
 CONFIG_SND_SOC_TEGRA210_MIXER=m
 CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD=m
 CONFIG_SND_SOC_AK4613=m
+CONFIG_SND_SOC_DA7213=m
 CONFIG_SND_SOC_ES7134=m
 CONFIG_SND_SOC_ES7241=m
 CONFIG_SND_SOC_GTM601=m
Signature · 1 line
2.25.1
#16 lore raw

PATCH 9/9 arm64: renesas_defconfig: Enable DA7213 Codec

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

This patch enable DA7213 Codec for ARD-AUDIO-DA7212 support on R-Car V4H White Hawk

---
 arch/arm64/configs/renesas_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/renesas_defconfig +1 -0
index 0f73d81f333d..83f9ee4aa90c 100644
@@ -286,6 +286,7 @@ CONFIG_SND_SOC=y
 CONFIG_SND_SOC_RCAR=y
 CONFIG_SND_SOC_RZ=y
 CONFIG_SND_SOC_AK4613=y
+CONFIG_SND_SOC_DA7213=y
 CONFIG_SND_SOC_PCM3168A_I2C=y
 CONFIG_SND_SOC_WM8978=y
 CONFIG_SND_SIMPLE_CARD=y
Signature · 1 line
2.25.1