All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support
@ 2023-02-02  1:02 Kuninori Morimoto
  2023-02-02  1:03 ` [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support Kuninori Morimoto
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:02 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


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.

Link: https://lore.kernel.org/r/87y1pqt4vs.wl-kuninori.morimoto.gx@renesas.com

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

-- 
2.25.1


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

* [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
@ 2023-02-02  1:03 ` Kuninori Morimoto
  2023-02-10 12:46   ` Geert Uytterhoeven
  2023-02-02  1:03 ` [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support Kuninori Morimoto
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Linh Phung <linh.phung.jy@renesas.com>

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

Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/pinctrl/renesas/pfc-r8a779g0.c | 29 ++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/pinctrl/renesas/pfc-r8a779g0.c b/drivers/pinctrl/renesas/pfc-r8a779g0.c
index bf7fcce2d9c6..a145466d1cf9 100644
--- a/drivers/pinctrl/renesas/pfc-r8a779g0.c
+++ b/drivers/pinctrl/renesas/pfc-r8a779g0.c
@@ -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),
-- 
2.25.1


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

* [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
  2023-02-02  1:03 ` [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support Kuninori Morimoto
@ 2023-02-02  1:03 ` Kuninori Morimoto
  2023-02-10 12:46   ` Geert Uytterhoeven
  2023-02-02  1:03 ` [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H Kuninori Morimoto
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Linh Phung <linh.phung.jy@renesas.com>

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

Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/pinctrl/renesas/pfc-r8a779g0.c | 29 ++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/pinctrl/renesas/pfc-r8a779g0.c b/drivers/pinctrl/renesas/pfc-r8a779g0.c
index a145466d1cf9..1954d66adf4f 100644
--- a/drivers/pinctrl/renesas/pfc-r8a779g0.c
+++ b/drivers/pinctrl/renesas/pfc-r8a779g0.c
@@ -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),
-- 
2.25.1


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

* [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
  2023-02-02  1:03 ` [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support Kuninori Morimoto
  2023-02-02  1:03 ` [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support Kuninori Morimoto
@ 2023-02-02  1:03 ` Kuninori Morimoto
  2023-02-10 12:47   ` Geert Uytterhoeven
  2023-02-02  1:03 ` [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks Kuninori Morimoto
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Takeshi Kihara <takeshi.kihara.df@renesas.com>

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

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/clk/renesas/renesas-cpg-mssr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
index 202aeb232044..3b899ffa88b4 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.c
+++ b/drivers/clk/renesas/renesas-cpg-mssr.c
@@ -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,
 };
 
 /**
-- 
2.25.1


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

* [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2023-02-02  1:03 ` [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H Kuninori Morimoto
@ 2023-02-02  1:03 ` Kuninori Morimoto
  2023-02-10 12:50   ` Geert Uytterhoeven
  2023-02-02  1:03 ` [PATCH 5/9] arm64: dts: renesas: r8a779g0: R-Car Sound support Kuninori Morimoto
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a779g0-cpg-mssr.c b/drivers/clk/renesas/r8a779g0-cpg-mssr.c
index 7fca11204f74..18a9462dab76 100644
--- a/drivers/clk/renesas/r8a779g0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779g0-cpg-mssr.c
@@ -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),
 };
 
 /*
-- 
2.25.1


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

* [PATCH 5/9] arm64: dts: renesas: r8a779g0: R-Car Sound support
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
                   ` (3 preceding siblings ...)
  2023-02-02  1:03 ` [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks Kuninori Morimoto
@ 2023-02-02  1:03 ` Kuninori Morimoto
  2023-02-02  1:04 ` [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add " Kuninori Morimoto
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Linh Phung <linh.phung.jy@renesas.com>

This patch adds Sound support for R-Car V4H.

Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 78 +++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
index 7a87a5dc1b6a..b7855aaebddc 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
@@ -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";
-- 
2.25.1


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

* [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
                   ` (4 preceding siblings ...)
  2023-02-02  1:03 ` [PATCH 5/9] arm64: dts: renesas: r8a779g0: R-Car Sound support Kuninori Morimoto
@ 2023-02-02  1:04 ` Kuninori Morimoto
  2023-02-10 13:33   ` Geert Uytterhoeven
  2023-02-02  1:04 ` [PATCH 8/9] arm64: defconfig: Enable DA7213 Codec Kuninori Morimoto
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 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

diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
index 0699b51c1247..df80c30e03ce 100644
--- a/arch/arm64/boot/dts/renesas/Makefile
+++ b/arch/arm64/boot/dts/renesas/Makefile
@@ -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
diff --git a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts
new file mode 100644
index 000000000000..25c89217c122
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts
@@ -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
+ *
+ * [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		|
+ * |				|	+---------------+
+ * |CN34 (I2C CN)		|	|J1		|
+ * |	I2C0_SCL	   pin3 |<----->| pin20 SCL	|
+ * |	I2C0_SDA	   pin5 |<----->| pin18 SDA	|
+ * +----------------------------+  +--->| pin14 GND	|
+ *				   |	+---------------+
+ * +----------------------------+  |
+ * |Switch Board		|  |
+ * |				|  |	+---------------+
+ * |CN5			    GND |<-+	|J7		|
+ * |			    3v3 |<----->| pin8  (+3.3v)	|
+ * +----------------------------+	+---------------+
+ *
+ * [How to enable]
+ *
+ * You need these configs
+ *
+ *	CONFIG_PWM_RENESAS_TPU
+ *	CONFIG_SND_SOC_DA7213
+ *
+ * [How to use]
+ *
+ * You need setup audio_clkin (see [(C) clock]).
+ * And set TPU from user space.
+ * Let's use duty_cycle = 50% here.
+ *
+ * For 44.1kHz (= 11289600 Hz) (= audio_clkin)
+ *	1000000000 / 11289600 = 88.577 = period
+ *
+ *	echo 0   > /sys/class/pwm/pwmchip0/export
+ *	echo 88  > /sys/class/pwm/pwmchip0/pwm0/period
+ *	echo 44  > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
+ *	echo 1   > /sys/class/pwm/pwmchip0/pwm0/enable
+ *
+ *	> aplay 22050.wav
+ *	> aplay 44100.wav
+ *	> aplay 88200.wav
+ *
+ * For 48kHz (= 12288000 Hz) (= audio_clkin)
+ *	1000000000 / 12288000 = 81.380 = period
+ *
+ *	echo 0   > /sys/class/pwm/pwmchip0/export
+ *	echo 82  > /sys/class/pwm/pwmchip0/pwm0/period
+ *	echo 41  > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
+ *	echo 1   > /sys/class/pwm/pwmchip0/pwm0/enable
+ *
+ *	> aplay 24000.wav
+ *	> aplay 48000.wav
+ *	> aplay 95000.wav
+ *
+ * You need to setup Headphone
+ *
+ *	> amixer set "Headphone" 40%
+ *	> amixer set "Headphone" on
+ *	> amixer set "Mixout Left DAC Left" on
+ *	> amixer set "Mixout Right DAC Right" on
+ *
+ * You can use capture (see [CAPTURE])
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r8a779g0-white-hawk.dts"
+
+/ {
+	sound_card: sound {
+		compatible = "audio-graph-card";
+		label = "rcar-sound";
+
+		dais = <&rsnd_port0>;	/* DA7212 Audio Codec */
+	};
+};
+
+&pfc {
+	sound_pins: sound {
+		groups = "ssi_ctrl", "ssi_data";
+		function = "ssi";
+	};
+
+	sound_clk_pins: sound_clk {
+		groups = "audio_clkin", "audio_clkout";
+		function = "audio_clk";
+	};
+
+	tpu0_pins: tpu0 {
+		groups = "tpu_to0_a";
+		function = "tpu";
+	};
+};
+
+&tpu {
+	pinctrl-0 = <&tpu0_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};
+
+&i2c0 {
+	da7212: codec@1a {
+		compatible = "dlg,da7212";
+
+		#sound-dai-cells = <0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reg = <0x1a>;
+
+		clocks = <&rcar_sound>;
+		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>;
+		VDDMIC-supply = <&reg_3p3v>;
+		VDDIO-supply  = <&reg_3p3v>;
+
+		port@0 {
+			da7212_endpoint: endpoint {
+				remote-endpoint = <&rsnd_endpoint>;
+			};
+		};
+	};
+};
+
+&audio_clkin {
+	clock-frequency = <11289600>; /* 44.1kHz groups [(C) clock] */
+//	clock-frequency = <12288000>; /* 48  kHz groups [(C) clock] */
+};
+
+&rcar_sound {
+	pinctrl-0 = <&sound_clk_pins>, <&sound_pins>;
+	pinctrl-names = "default";
+
+	/* Single DAI */
+	#sound-dai-cells = <0>;
+
+	/* audio_clkout */
+	#clock-cells = <0>;
+	clock-frequency = <5644800>; /* 44.1kHz groups [(C) clock] */
+//	clock-frequency = <6144000>; /* 48  kHz groups [(C) clock] */
+
+	status = "okay";
+
+	ports {
+		rsnd_port0: port@0 {
+			rsnd_endpoint: endpoint {
+				remote-endpoint = <&da7212_endpoint>;
+
+				dai-format = "i2s";
+				bitclock-master = <&rsnd_endpoint>;
+				frame-master = <&rsnd_endpoint>;
+
+				/* Please use exclusively to the 'capture' */
+				playback = <&ssi0>;
+				/* [CAPTURE] */
+				/* capture = <&ssi0>; */
+			};
+		};
+	};
+};
-- 
2.25.1


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

* [PATCH 8/9] arm64: defconfig: Enable DA7213 Codec
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
                   ` (5 preceding siblings ...)
  2023-02-02  1:04 ` [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add " Kuninori Morimoto
@ 2023-02-02  1:04 ` Kuninori Morimoto
  2023-02-02  1:04 ` [PATCH 9/9] arm64: renesas_defconfig: " Kuninori Morimoto
  2023-02-02  1:05 ` [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator Kuninori Morimoto
  8 siblings, 0 replies; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 851e8f9be06d..f6b0505dcc79 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -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
-- 
2.25.1


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

* [PATCH 9/9] arm64: renesas_defconfig: Enable DA7213 Codec
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
                   ` (6 preceding siblings ...)
  2023-02-02  1:04 ` [PATCH 8/9] arm64: defconfig: Enable DA7213 Codec Kuninori Morimoto
@ 2023-02-02  1:04 ` Kuninori Morimoto
  2023-02-02  1:05 ` [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator Kuninori Morimoto
  8 siblings, 0 replies; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm64/configs/renesas_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/renesas_defconfig b/arch/arm64/configs/renesas_defconfig
index 0f73d81f333d..83f9ee4aa90c 100644
--- a/arch/arm64/configs/renesas_defconfig
+++ b/arch/arm64/configs/renesas_defconfig
@@ -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
-- 
2.25.1


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

* [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator
  2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
                   ` (7 preceding siblings ...)
  2023-02-02  1:04 ` [PATCH 9/9] arm64: renesas_defconfig: " Kuninori Morimoto
@ 2023-02-02  1:05 ` Kuninori Morimoto
  2023-02-10 13:21   ` Geert Uytterhoeven
  8 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-02  1:05 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This is prepare for White Hawk Audio Support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
index bb4a5270f71b..e1fee0d38752 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
@@ -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>;
-- 
2.25.1


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

* Re: [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support
  2023-02-02  1:03 ` [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support Kuninori Morimoto
@ 2023-02-10 12:46   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2023-02-10 12:46 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

On Thu, Feb 2, 2023 at 2:03 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Linh Phung <linh.phung.jy@renesas.com>
>
> This patch adds Audio Clock pins, groups, and functions
> to r8a779g0 SoC.
>
> Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

My
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
on v1 is still valid, i.e. will queue in renesas-pinctrl-for-v6.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] 17+ messages in thread

* Re: [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support
  2023-02-02  1:03 ` [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support Kuninori Morimoto
@ 2023-02-10 12:46   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2023-02-10 12:46 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

On Thu, Feb 2, 2023 at 2:03 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Linh Phung <linh.phung.jy@renesas.com>
>
> This patch adds Audio SSI pins, groups, and functions
> to r8a779g0 SoC.
>
> Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

My
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
on v1 is still valid, i.e. will queue in renesas-pinctrl-for-v6.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] 17+ messages in thread

* Re: [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H
  2023-02-02  1:03 ` [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H Kuninori Morimoto
@ 2023-02-10 12:47   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2023-02-10 12:47 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

On Thu, Feb 2, 2023 at 2:03 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>
> The SRCR, SRSTCLR, MSTPCR and MSTPSR registers for R-Car V4H (R8A779G0)
> each have registers up to offset 0x74.
> This patch update it.
>
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk-for-v6.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] 17+ messages in thread

* Re: [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks
  2023-02-02  1:03 ` [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks Kuninori Morimoto
@ 2023-02-10 12:50   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2023-02-10 12:50 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Geert Uytterhoeven, Linux-Renesas

On Thu, Feb 2, 2023 at 2:03 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> This patch adds module clocks for Audio (SSI/SSIU) blocks on
> the Renesas R-Car V4H (R8A779G0) SoC.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk-for-v6.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] 17+ messages in thread

* Re: [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator
  2023-02-02  1:05 ` [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator Kuninori Morimoto
@ 2023-02-10 13:21   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2023-02-10 13:21 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Thu, Feb 2, 2023 at 2:05 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> This is prepare for White Hawk Audio Support.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

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

> --- a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
> @@ -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>;

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

* Re: [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support
  2023-02-02  1:04 ` [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add " Kuninori Morimoto
@ 2023-02-10 13:33   ` Geert Uytterhoeven
  2023-02-13  6:09     ` Kuninori Morimoto
  0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2023-02-10 13:33 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Thu, Feb 2, 2023 at 2:04 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> These adds R-Car Sound support for WhiteHawk board using ARD-AUDIO-DA7212
> external audio board.
>
> Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-ard-audio-da7212.dts
> @@ -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.

> + * [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             |
> + * |                           |       +---------------+
> + * |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.

> + * |                       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.

> +/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.

> +&i2c0 {
> +       da7212: codec@1a {
> +               compatible = "dlg,da7212";
> +
> +               #sound-dai-cells = <0>;
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +
> +               reg = <0x1a>;
> +
> +               clocks = <&rcar_sound>;
> +               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.

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

* Re: [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add R-Car Sound support
  2023-02-10 13:33   ` Geert Uytterhoeven
@ 2023-02-13  6:09     ` Kuninori Morimoto
  0 siblings, 0 replies; 17+ messages in thread
From: Kuninori Morimoto @ 2023-02-13  6:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


Hi Geert

> > + * 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

> > + * +----------------------------+  |
> > + * |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.
> 
> > + * |                       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.

> > +/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

> > +               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

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

end of thread, other threads:[~2023-02-13  6:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02  1:02 [PATCH 0/9] arm64: dts: renesas: add V4H White Hawk Sound support Kuninori Morimoto
2023-02-02  1:03 ` [PATCH 1/9] pinctrl: renesas: r8a779g0: Add Audio Clock support Kuninori Morimoto
2023-02-10 12:46   ` Geert Uytterhoeven
2023-02-02  1:03 ` [PATCH 2/9] pinctrl: renesas: r8a779g0: Add Audio SSI support Kuninori Morimoto
2023-02-10 12:46   ` Geert Uytterhoeven
2023-02-02  1:03 ` [PATCH 3/9] clk: renesas: cpg-mssr: Fix MSSR register range for V4H Kuninori Morimoto
2023-02-10 12:47   ` Geert Uytterhoeven
2023-02-02  1:03 ` [PATCH 4/9] clk: renesas: r8a779g0: Add Audio clocks Kuninori Morimoto
2023-02-10 12:50   ` Geert Uytterhoeven
2023-02-02  1:03 ` [PATCH 5/9] arm64: dts: renesas: r8a779g0: R-Car Sound support Kuninori Morimoto
2023-02-02  1:04 ` [PATCH 7/9] arm64: dts: renesas: r8a779g0: whitehawk: Add " Kuninori Morimoto
2023-02-10 13:33   ` Geert Uytterhoeven
2023-02-13  6:09     ` Kuninori Morimoto
2023-02-02  1:04 ` [PATCH 8/9] arm64: defconfig: Enable DA7213 Codec Kuninori Morimoto
2023-02-02  1:04 ` [PATCH 9/9] arm64: renesas_defconfig: " Kuninori Morimoto
2023-02-02  1:05 ` [PATCH 6/9] arm64: dts: r8a779g0-white-hawk-cpu.dtsi: add 5.0v regulator Kuninori Morimoto
2023-02-10 13:21   ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.