All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
@ 2022-12-14  1:47 Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 1/8] ARM: dts: renesas: #sound-dai-cells is used when simple-card Kuninori Morimoto
                   ` (9 more replies)
  0 siblings, 10 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:47 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


Hi Geert

ALSA SoC is now supporting generic Sound Card driver such as
Simple-Card / Audio-Graph-Card/Card2, and it supports
"normal connection" and "special connections".
I'm its maintainer, thus I need/want to test these.

I have been tested these by using my local patches to switching card,
but maintenance it locally is not useful for me, and users who want to
know the sample DT settings.

And I have noticed that some local patch had bug, but no one noticed
about it (of course :)

ULCB/KF is very good board to test these.
So, I want to upstream these.

One note here is that this patch *should not* have effect to
existing normal users, but useful for test user.
So, this patch-set adds "3 card" x "2 use case" dtsi file,
and ulcb/ulcb-kf "include" one of them which doesn't change anything.
test user can switch to other card or other use case by changing
"include" dtsi.

[1/8][2/8] are small tidyup patches for all SoC sound.

Kuninori Morimoto (8):
  ARM: dts: renesas: #sound-dai-cells is used when simple-card
  arm64: dts: renesas: #sound-dai-cells is used when simple-card
  arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
  arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
  arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
  arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
  arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
  arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi

 arch/arm/boot/dts/r8a7742.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7743.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7744.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7745.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7778.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7790.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7791.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7793.dtsi                |   2 +-
 arch/arm/boot/dts/r8a7794.dtsi                |   2 +-
 arch/arm64/boot/dts/renesas/r8a774a1.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a774e1.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a77951.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a77960.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a77961.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a77965.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a77990.dtsi     |   2 +-
 arch/arm64/boot/dts/renesas/r8a77995.dtsi     |   2 +-
 .../boot/dts/renesas/salvator-common.dtsi     |   3 -
 .../ulcb-audio-graph-card-mix+split.dtsi      |  89 +++++++++
 .../dts/renesas/ulcb-audio-graph-card.dtsi    |  85 +++++++++
 .../ulcb-audio-graph-card2-mix+split.dtsi     | 111 +++++++++++
 .../dts/renesas/ulcb-audio-graph-card2.dtsi   |  26 +++
 .../ulcb-kf-audio-graph-card-mix+split.dtsi   | 162 ++++++++++++++++
 .../dts/renesas/ulcb-kf-audio-graph-card.dtsi |  88 +++++++++
 .../ulcb-kf-audio-graph-card2-mix+split.dtsi  | 177 ++++++++++++++++++
 .../renesas/ulcb-kf-audio-graph-card2.dtsi    |  30 +++
 .../ulcb-kf-simple-audio-card-mix+split.dtsi  | 137 ++++++++++++++
 .../renesas/ulcb-kf-simple-audio-card.dtsi    |  85 +++++++++
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |  66 ++-----
 .../ulcb-simple-audio-card-mix+split.dtsi     |  86 +++++++++
 .../dts/renesas/ulcb-simple-audio-card.dtsi   |  89 +++++++++
 arch/arm64/boot/dts/renesas/ulcb.dtsi         |  60 ++----
 34 files changed, 1212 insertions(+), 120 deletions(-)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi

-- 
2.25.1





Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* [PATCH 1/8] ARM: dts: renesas: #sound-dai-cells is used when simple-card
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 2/8] arm64: " Kuninori Morimoto
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

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

Current sound comment is indicating that #sound-dai-cells is
required, but it is needed if board is using simple-card.
This patch tidyup the comment.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7742.dtsi | 2 +-
 arch/arm/boot/dts/r8a7743.dtsi | 2 +-
 arch/arm/boot/dts/r8a7744.dtsi | 2 +-
 arch/arm/boot/dts/r8a7745.dtsi | 2 +-
 arch/arm/boot/dts/r8a7778.dtsi | 2 +-
 arch/arm/boot/dts/r8a7790.dtsi | 2 +-
 arch/arm/boot/dts/r8a7791.dtsi | 2 +-
 arch/arm/boot/dts/r8a7793.dtsi | 2 +-
 arch/arm/boot/dts/r8a7794.dtsi | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7742.dtsi b/arch/arm/boot/dts/r8a7742.dtsi
index 758a1bf02fae..d1c256d8bd56 100644
--- a/arch/arm/boot/dts/r8a7742.dtsi
+++ b/arch/arm/boot/dts/r8a7742.dtsi
@@ -1155,7 +1155,7 @@ vin3: video@e6ef3000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index 20f1d98a048d..2245d19a23bb 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -1190,7 +1190,7 @@ vin2: video@e6ef2000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7744.dtsi b/arch/arm/boot/dts/r8a7744.dtsi
index 96b2d5a4e8f6..aa13841f9781 100644
--- a/arch/arm/boot/dts/r8a7744.dtsi
+++ b/arch/arm/boot/dts/r8a7744.dtsi
@@ -1190,7 +1190,7 @@ vin2: video@e6ef2000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi
index afc902e532d8..44688b8431c3 100644
--- a/arch/arm/boot/dts/r8a7745.dtsi
+++ b/arch/arm/boot/dts/r8a7745.dtsi
@@ -1120,7 +1120,7 @@ vin1: video@e6ef1000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
index 95efbafb0b70..8d4530ed2fc6 100644
--- a/arch/arm/boot/dts/r8a7778.dtsi
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -241,7 +241,7 @@ tmu2: timer@ffd82000 {
 
 	rcar_sound: sound@ffd90000 {
 		/*
-		 * #sound-dai-cells is required
+		 * #sound-dai-cells is required if simple-card
 		 *
 		 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 		 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index db171e3c62f2..b5e362fab418 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -1109,7 +1109,7 @@ vin3: video@e6ef3000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d8f91d9f42ae..853eef9e031d 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -1223,7 +1223,7 @@ vin2: video@e6ef2000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 9ebe7bfaf0ed..8bc3e19f8adf 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -988,7 +988,7 @@ vin2: video@e6ef2000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index 7aa781ff3bff..371dd4715dde 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -955,7 +955,7 @@ vin1: video@e6ef1000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
-- 
2.25.1


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

* [PATCH 2/8] arm64: dts: renesas: #sound-dai-cells is used when simple-card
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 1/8] ARM: dts: renesas: #sound-dai-cells is used when simple-card Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 3/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi Kuninori Morimoto
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

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

Current sound comment is indicating that #sound-dai-cells is
required, but it is needed if board is using "simple-card".
This patch tidyup the comment.
Because it is already using "audio-graph", this patch removes
unneeded #sound-dai-cells from ulcb.dtsi / salvator-common.dtsi.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a774a1.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a774e1.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a77951.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a77960.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a77961.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a77965.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a77990.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/r8a77995.dtsi        | 2 +-
 arch/arm64/boot/dts/renesas/salvator-common.dtsi | 3 ---
 arch/arm64/boot/dts/renesas/ulcb.dtsi            | 3 ---
 12 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
index 7e643243c3be..c21b78685123 100644
--- a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
@@ -1678,7 +1678,7 @@ vin7csi40: endpoint@2 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
index d541b48c7e38..82216ce7a92a 100644
--- a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
@@ -1562,7 +1562,7 @@ vin7csi40: endpoint@2 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
index 151e32ac0368..e21653d86228 100644
--- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
@@ -1317,7 +1317,7 @@ vin5csi40: endpoint@2 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a774e1.dtsi b/arch/arm64/boot/dts/renesas/r8a774e1.dtsi
index c5a0e7866b2f..2828e05b40b3 100644
--- a/arch/arm64/boot/dts/renesas/r8a774e1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774e1.dtsi
@@ -1774,7 +1774,7 @@ vin7csi20: endpoint@0 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
index 07c8763c1e77..f770d160e948 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
@@ -1998,7 +1998,7 @@ drif31: rif@e6fb0000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77960.dtsi b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
index 1424d4ad941f..09c61696f7fb 100644
--- a/arch/arm64/boot/dts/renesas/r8a77960.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
@@ -1870,7 +1870,7 @@ drif31: rif@e6fb0000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
index 3c744b7d0dc4..59a18dfcb8cc 100644
--- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
@@ -1750,7 +1750,7 @@ vin7csi40: endpoint@2 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index 997f29521f66..9b4f7ad95ca8 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -1733,7 +1733,7 @@ drif31: rif@e6fb0000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 3053b4b21497..d4718f144e33 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -1469,7 +1469,7 @@ drif31: rif@e6fb0000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77995.dtsi b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
index f040d03e0a87..e25024a7b66c 100644
--- a/arch/arm64/boot/dts/renesas/r8a77995.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
@@ -1037,7 +1037,7 @@ vin4: video@e6ef4000 {
 
 		rcar_sound: sound@ec500000 {
 			/*
-			 * #sound-dai-cells is required
+			 * #sound-dai-cells is required if simple-card
 			 *
 			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
 			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index d97473401819..4a3d5037821f 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -799,9 +799,6 @@ &rcar_sound {
 	pinctrl-0 = <&sound_pins>, <&sound_clk_pins>;
 	pinctrl-names = "default";
 
-	/* Single DAI */
-	#sound-dai-cells = <0>;
-
 	/* audio_clkout0/1/2/3 */
 	#clock-cells = <1>;
 	clock-frequency = <12288000 11289600>;
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index 29cedf4dc1a9..4b6562fc1bdf 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -381,9 +381,6 @@ &rcar_sound {
 	pinctrl-0 = <&sound_pins>, <&sound_clk_pins>;
 	pinctrl-names = "default";
 
-	/* Single DAI */
-	#sound-dai-cells = <0>;
-
 	/* audio_clkout0/1/2/3 */
 	#clock-cells = <1>;
 	clock-frequency = <12288000 11289600>;
-- 
2.25.1


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

* [PATCH 3/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 1/8] ARM: dts: renesas: #sound-dai-cells is used when simple-card Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 2/8] arm64: " Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2023-01-12 11:12   ` Geert Uytterhoeven
  2022-12-14  1:48 ` [PATCH 4/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi Kuninori Morimoto
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


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

ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
to test these.

Generic Audio Card driver had been requested on ALSA SoC.
It has many type of device connection method, and historically,
requested connection support range of generic driver have been
upgraded.

Upgrading connection support range itself was possible on generic
driver, but could not implemented, because we need to keep compatibility
on Device-Tree. This is one of the reason why we have many type of
Generic Audio Card driver.

ULCB/KF is good board to test these.
Kuninori has been testing these Generic Audio Card driver by using his
local patch to switching drivers. But it is good idea to upstream these
from information sharing point of view, because DT setting is complex.
It can be good sample for user. This patch is one of them.

From normal user point of view who don't need to test the driver,
it should keep as-is, nothing changed.

This patch adds "Audio Graph Card" DT setting file for ULCB/KF.
We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.

Because it needs "switching driver", not "add extra feature",
it doesn't use Device-Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../dts/renesas/ulcb-audio-graph-card.dtsi    | 85 ++++++++++++++++++
 .../dts/renesas/ulcb-kf-audio-graph-card.dtsi | 88 +++++++++++++++++++
 2 files changed, 173 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi

diff --git a/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi
new file mode 100644
index 000000000000..8a1ca100cef8
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Audio Graph Card
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ *	(A) CPU0 ------ ak4613
+ *	(B) CPU1 ------ HDMI
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ */
+
+/ {
+	sound_card: sound {
+		compatible = "audio-graph-card";
+		label = "rcar-sound";
+
+		dais = <&rsnd_port0	/* (A) ak4613 */
+			&rsnd_port1	/* (B) HDMI0  */
+		>;
+	};
+};
+
+&ak4613 {
+	#sound-dai-cells = <0>;
+
+	port {
+		/*
+		 * (A) CPU0 <-> ak4613
+		 */
+		ak4613_endpoint: endpoint {
+			remote-endpoint = <&rsnd_for_ak4613>;
+		};
+	};
+};
+
+&hdmi0 {
+	ports {
+		port@2 {
+			/*
+			 * (B) CPU1 <-> HDMI
+			 */
+			dw_hdmi0_snd_in: endpoint {
+				remote-endpoint = <&rsnd_for_hdmi>;
+			};
+		};
+	};
+};
+
+&rcar_sound {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		rsnd_port0: port@0 {
+			/*
+			 * (A) CPU0 <-> ak4613
+			 */
+			reg = <0>;
+			rsnd_for_ak4613: endpoint {
+				remote-endpoint = <&ak4613_endpoint>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssi0>, <&src0>, <&dvc0>;
+				capture  = <&ssi1>, <&src1>, <&dvc1>;
+			};
+		};
+		rsnd_port1: port@1 {
+			/*
+			 * (B) CPU1 <-> HDMI
+			 */
+			reg = <1>;
+			rsnd_for_hdmi: endpoint {
+				remote-endpoint = <&dw_hdmi0_snd_in>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssi2>;
+			};
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi
new file mode 100644
index 000000000000..fcdd2e949b5f
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Audio Graph Card
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ *	(A) CPU0 ------ ak4613
+ *	(B) CPU1 ------ HDMI
+ *	(C) CPU2 ------ PCM3168A-p (8ch)
+ *	(D) CPU3 ------ PCM3168A-c (6ch)
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *	(C) aplay   -D plughw:0,2 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ *	(D) arecord -D plughw:0,3 xxx.wav
+ */
+
+&sound_card {
+	dais = <&rsnd_port0	/* (A) ak4613 */
+		&rsnd_port1	/* (B) HDMI0  */
+		&rsnd_port2	/* (C) pcm3168a playback */
+		&rsnd_port3	/* (D) pcm3168a capture  */
+		>;
+};
+
+&pcm3168a {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		mclk-fs = <512>;
+		/*
+		 * (C) CPU2 <-> PCM3168A-p
+		 */
+		port@0 {
+			reg = <0>;
+			pcm3168a_endpoint_p: endpoint {
+				remote-endpoint = <&rsnd_for_pcm3168a_play>;
+				clocks = <&clksndsel>;
+			};
+		};
+		/*
+		 * (D) CPU3 <-> PCM3168A-c
+		 */
+		port@1 {
+			reg = <1>;
+			pcm3168a_endpoint_c: endpoint {
+				remote-endpoint = <&rsnd_for_pcm3168a_capture>;
+				clocks = <&clksndsel>;
+			};
+		};
+	};
+};
+
+&rcar_sound {
+	ports {
+		/* rsnd_port0/1 are defined in ulcb.dtsi */
+		/*
+		 * (C) CPU2 <-> PCM3168A-p
+		 */
+		rsnd_port2: port@2 {
+			reg = <2>;
+			rsnd_for_pcm3168a_play: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_p>;
+				bitclock-master;
+				frame-master;
+				dai-tdm-slot-num = <8>;
+				playback = <&ssi3>;
+			};
+		};
+		/*
+		 * (D) CPU3 <-> PCM3168A-c
+		 */
+		rsnd_port3: port@3 {
+			reg = <3>;
+			rsnd_for_pcm3168a_capture: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_c>;
+				bitclock-master;
+				frame-master;
+				dai-tdm-slot-num = <6>;
+				capture = <&ssi4>;
+			};
+		};
+	};
+};
-- 
2.25.1


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

* [PATCH 4/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2022-12-14  1:48 ` [PATCH 3/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2023-01-12 11:14   ` Geert Uytterhoeven
  2022-12-14  1:48 ` [PATCH 5/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi Kuninori Morimoto
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


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

ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
to test these.

Generic Audio Card driver had been requested on ALSA SoC.
It has many type of device connection method, and historically,
requested connection support range of generic driver have been
upgraded.

Upgrading connection support range itself was possible on generic
driver, but could not implemented, because we need to keep compatibility
on Device-Tree. This is one of the reason why we have many type of
Generic Audio Card driver.

ULCB/KF is good board to test these.
Kuninori has been testing these Generic Audio Card driver by using his
local patch to switching drivers. But it is good idea to upstream these
from information sharing point of view, because DT setting is complex.
It can be good sample for user. This patch is one of them.

From normal user point of view who don't need to test the driver,
it should keep as-is, nothing changed.

This patch adds "Audio Graph Card2" DT setting file for ULCB/KF,
and switch to use it. We can switch to other Generic Audio Graph driver
if ulcb.dtsi / ulcb-kf.dtsi were updated.

Because it needs "switching driver", not "add extra feature",
it doesn't use Device-Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../dts/renesas/ulcb-audio-graph-card2.dtsi   | 26 ++++++++
 .../renesas/ulcb-kf-audio-graph-card2.dtsi    | 30 +++++++++
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      | 62 +++----------------
 arch/arm64/boot/dts/renesas/ulcb.dtsi         | 52 +++-------------
 4 files changed, 75 insertions(+), 95 deletions(-)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi

diff --git a/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
new file mode 100644
index 000000000000..4668ee5383fc
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Audio Graph Card2
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ *	(A) CPU0 ------ ak4613
+ *	(B) CPU1 ------ HDMI
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ */
+#include "ulcb-audio-graph-card.dtsi"
+
+&sound_card {
+	compatible = "audio-graph-card2";
+
+	/delete-property/ dais;
+	links = <&rsnd_port0	/* (A) ak4613 */
+		 &rsnd_port1	/* (B) HDMI0  */
+		>;
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi
new file mode 100644
index 000000000000..7b4ed8fc8cc2
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Audio Graph Card2
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ *	(A) CPU0 ------ ak4613
+ *	(B) CPU1 ------ HDMI
+ *	(C) CPU2 ------ PCM3168A-p (8ch)
+ *	(D) CPU3 ------ PCM3168A-c (6ch)
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *	(C) aplay   -D plughw:0,2 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ *	(D) arecord -D plughw:0,3 xxx.wav
+ */
+#include "ulcb-kf-audio-graph-card.dtsi"
+
+&sound_card {
+	/delete-property/ dais;
+	links = <&rsnd_port0	/* (A) ak4613 */
+		 &rsnd_port1	/* (B) HDMI0  */
+		 &rsnd_port2	/* (C) pcm3168a playback */
+		 &rsnd_port3	/* (D) pcm3168a capture  */
+		>;
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index 408871c2859d..b5877120ab46 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -212,26 +212,6 @@ pcm3168a: audio-codec@44 {
 				VCCAD2-supply = <&snd_vcc5v>;
 				VCCDA1-supply = <&snd_vcc5v>;
 				VCCDA2-supply = <&snd_vcc5v>;
-
-				ports {
-					#address-cells = <1>;
-					#size-cells = <0>;
-					mclk-fs = <512>;
-					port@0 {
-						reg = <0>;
-						pcm3168a_endpoint_p: endpoint {
-							remote-endpoint = <&rsnd_for_pcm3168a_play>;
-							clocks = <&clksndsel>;
-						};
-					};
-					port@1 {
-						reg = <1>;
-						pcm3168a_endpoint_c: endpoint {
-							remote-endpoint = <&rsnd_for_pcm3168a_capture>;
-							clocks = <&clksndsel>;
-						};
-					};
-				};
 			};
 
 			gyroscope@6b {
@@ -418,30 +398,6 @@ &rcar_sound {
 	pinctrl-0 = <&sound_pins
 		     &sound_clk_pins
 		     &sound_pcm_pins>;
-
-	ports {
-		/* rsnd_port0/1 are defined in ulcb.dtsi */
-		rsnd_port2: port@2 {
-			reg = <2>;
-			rsnd_for_pcm3168a_play: endpoint {
-				remote-endpoint = <&pcm3168a_endpoint_p>;
-				bitclock-master;
-				frame-master;
-				dai-tdm-slot-num = <8>;
-				playback = <&ssi3>;
-			};
-		};
-		rsnd_port3: port@3 {
-			reg = <3>;
-			rsnd_for_pcm3168a_capture: endpoint {
-				remote-endpoint = <&pcm3168a_endpoint_c>;
-				bitclock-master;
-				frame-master;
-				dai-tdm-slot-num = <6>;
-				capture = <&ssi4>;
-			};
-		};
-	};
 };
 
 &scif1 {
@@ -476,14 +432,6 @@ wlcore: wlcore@2 {
 	};
 };
 
-&sound_card {
-	links = <&rsnd_port0	/* ak4613 */
-		 &rsnd_port1	/* HDMI0  */
-		 &rsnd_port2	/* pcm3168a playback */
-		 &rsnd_port3	/* pcm3168a capture  */
-		>;
-};
-
 &ssi4 {
 	shared-pin;
 };
@@ -498,3 +446,13 @@ &usb2_phy0 {
 &xhci0 {
 	status = "okay";
 };
+
+/*
+ * For sound-test.
+ *
+ * We can switch Audio Card for testing
+ * see also ulcb.dtsi
+ *
+ * #include "ulcb-kf-audio-graph-card.dtsi"
+ */
+#include "ulcb-kf-audio-graph-card2.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index 4b6562fc1bdf..6196494452c9 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -102,15 +102,6 @@ reg_3p3v: regulator-3p3v {
 		regulator-always-on;
 	};
 
-	sound_card: sound {
-		compatible = "audio-graph-card2";
-		label = "rcar-sound";
-
-		links = <&rsnd_port0	/* ak4613 */
-			 &rsnd_port1	/* HDMI0  */
-			>;
-	};
-
 	vcc_sdhi0: regulator-vcc-sdhi0 {
 		compatible = "regulator-fixed";
 
@@ -201,9 +192,6 @@ rcar_dw_hdmi0_out: endpoint {
 		};
 		port@2 {
 			reg = <2>;
-			dw_hdmi0_snd_in: endpoint {
-				remote-endpoint = <&rsnd_for_hdmi>;
-			};
 		};
 	};
 };
@@ -218,7 +206,6 @@ &i2c2 {
 
 	ak4613: codec@10 {
 		compatible = "asahi-kasei,ak4613";
-		#sound-dai-cells = <0>;
 		reg = <0x10>;
 		clocks = <&rcar_sound 3>;
 
@@ -230,12 +217,6 @@ ak4613: codec@10 {
 		asahi-kasei,out4-single-end;
 		asahi-kasei,out5-single-end;
 		asahi-kasei,out6-single-end;
-
-		port {
-			ak4613_endpoint: endpoint {
-				remote-endpoint = <&rsnd_for_ak4613>;
-			};
-		};
 	};
 
 	cs2000: clk-multiplier@4f {
@@ -405,30 +386,6 @@ &rcar_sound {
 		 <&audio_clk_a>, <&cs2000>,
 		 <&audio_clk_c>,
 		 <&cpg CPG_CORE CPG_AUDIO_CLK_I>;
-
-	ports {
-		#address-cells = <1>;
-		#size-cells = <0>;
-		rsnd_port0: port@0 {
-			reg = <0>;
-			rsnd_for_ak4613: endpoint {
-				remote-endpoint = <&ak4613_endpoint>;
-				bitclock-master;
-				frame-master;
-				playback = <&ssi0>, <&src0>, <&dvc0>;
-				capture = <&ssi1>, <&src1>, <&dvc1>;
-			};
-		};
-		rsnd_port1: port@1 {
-			reg = <1>;
-			rsnd_for_hdmi: endpoint {
-				remote-endpoint = <&dw_hdmi0_snd_in>;
-				bitclock-master;
-				frame-master;
-				playback = <&ssi2>;
-			};
-		};
-	};
 };
 
 &rpc {
@@ -538,3 +495,12 @@ &usb2_phy1 {
 
 	status = "okay";
 };
+
+/*
+ * For sound-test.
+ *
+ * We can switch Audio Card for testing
+ *
+ * #include "ulcb-audio-graph-card.dtsi"
+ */
+#include "ulcb-audio-graph-card2.dtsi"
-- 
2.25.1


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

* [PATCH 5/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
                   ` (3 preceding siblings ...)
  2022-12-14  1:48 ` [PATCH 4/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2023-01-12 11:18   ` Geert Uytterhoeven
  2022-12-14  1:48 ` [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi Kuninori Morimoto
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


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

ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
to test these.

Generic Audio Card driver had been requested on ALSA SoC.
It has many type of device connection method, and historically,
requested connection support range of generic driver have been
upgraded.

Upgrading connection support range itself was possible on generic
driver, but could not implemented, because we need to keep compatibility
on Device-Tree. This is one of the reason why we have many type of
Generic Audio Card driver.

ULCB/KF is good board to test these.
Kuninori has been testing these Generic Audio Card driver by using his
local patch to switching drivers. But it is good idea to upstream these
from information sharing point of view, because DT setting is complex.
It can be good sample for user. This patch is one of them.

From normal user point of view who don't need to test the driver,
it should keep as-is, nothing changed.

This patch adds "Simle Audio Card" DT setting file for ULCB/KF.
We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.

Because it needs "switching driver", not "add extra feature",
it doesn't use Device-Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../renesas/ulcb-kf-simple-audio-card.dtsi    | 85 ++++++++++++++++++
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |  1 +
 .../dts/renesas/ulcb-simple-audio-card.dtsi   | 89 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/ulcb.dtsi         |  1 +
 4 files changed, 176 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi

diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
new file mode 100644
index 000000000000..8949145d447d
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Simple Audio Card
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ *	(A) CPU0 ------ ak4613
+ *	(B) CPU1 ------ HDMI
+ *	(C) CPU2 ------ PCM3168A-p
+ *	(D) CPU3 ------ PCM3168A-c
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *	(C) aplay   -D plughw:0,2 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ *	(D) arecord -D plughw:0,3 xxx.wav
+ */
+
+&sound_card {
+	/* dai-link@0/1 are defined in ulcb.dtsi */
+
+	/*
+	 * (C) CPU2 <-> PCM3168A-p
+	 */
+	simple-audio-card,dai-link@2 {
+		reg = <2>;
+		cpu {
+			bitclock-master;
+			frame-master;
+			dai-tdm-slot-num = <8>;
+			sound-dai = <&rcar_sound 2>;
+		};
+		codec {
+			mclk-fs = <512>;
+			sound-dai = <&pcm3168a 0>;
+		};
+	};
+	/*
+	 * (D) CPU3 <-> PCM3168A-c
+	 */
+	simple-audio-card,dai-link@3 {
+		reg = <3>;
+		cpu {
+			bitclock-master;
+			frame-master;
+			dai-tdm-slot-num = <6>;
+			sound-dai = <&rcar_sound 3>;
+		};
+		codec {
+			mclk-fs = <512>;
+			sound-dai = <&pcm3168a 1>;
+		};
+	};
+};
+
+&pcm3168a {
+	/*
+	 * (C) CPU2 <-> PCM3168A-p
+	 * (D) CPU3 <-> PCM3168A-c
+	 */
+	#sound-dai-cells = <1>;
+};
+
+&rcar_sound {
+
+	/* dai0-1 are defined in ulcb.dtsi */
+
+	rcar_sound,dai {
+		/*
+		 * (C) CPU2 <-> PCM3168A-p
+		 */
+		dai2 {
+			playback = <&ssi3>;
+		};
+		/*
+		 * (D) CPU3 <-> PCM3168A-c
+		 */
+		dai3 {
+			capture = <&ssi4>;
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index b5877120ab46..6913d778a40b 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -453,6 +453,7 @@ &xhci0 {
  * We can switch Audio Card for testing
  * see also ulcb.dtsi
  *
+ * #include "ulcb-kf-simple-audio-card.dtsi"
  * #include "ulcb-kf-audio-graph-card.dtsi"
  */
 #include "ulcb-kf-audio-graph-card2.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi b/arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi
new file mode 100644
index 000000000000..ae1ea872fd11
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Simple Audio Card
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ *	(A) CPU0 ------ ak4613
+ *	(B) CPU1 ------ HDMI
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ */
+
+/ {
+	sound_card: sound {
+		compatible = "simple-audio-card";
+		label = "rcar-sound";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/*
+		 * (A) CPU0 <-> ak4613
+		 */
+		simple-audio-card,dai-link@0 {
+			reg = <0>;
+			cpu {
+				bitclock-master;
+				frame-master;
+				sound-dai = <&rcar_sound 0>;
+			};
+			codec {
+				sound-dai = <&ak4613>;
+			};
+		};
+		/*
+		 * (B) CPU1 <-> HDMI
+		 */
+		simple-audio-card,dai-link@1 {
+			reg = <1>;
+			cpu {
+				bitclock-master;
+				frame-master;
+				sound-dai = <&rcar_sound 1>;
+			};
+			codec {
+				sound-dai = <&hdmi0>;
+			};
+		};
+	};
+};
+
+&ak4613 {
+	/*
+	 * (A) CPU0 <-> ak4613
+	 */
+	#sound-dai-cells = <0>;
+};
+
+&hdmi0 {
+	/*
+	 * (B) CPU1 <-> HDMI
+	 */
+	#sound-dai-cells = <0>;
+};
+
+&rcar_sound {
+	#sound-dai-cells = <1>;
+
+	rcar_sound,dai {
+		/*
+		 * (A) CPU0 <-> ak4613
+		 */
+		dai0 {
+			playback = <&ssi0 &src0 &dvc0>;
+			capture  = <&ssi1 &src1 &dvc1>;
+		};
+		/*
+		 * (B) CPU1 <-> HDMI
+		 */
+		dai1 {
+			playback = <&ssi2>;
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index 6196494452c9..497d07df6944 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -501,6 +501,7 @@ &usb2_phy1 {
  *
  * We can switch Audio Card for testing
  *
+ * #include "ulcb-simple-audio-card.dtsi"
  * #include "ulcb-audio-graph-card.dtsi"
  */
 #include "ulcb-audio-graph-card2.dtsi"
-- 
2.25.1


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

* [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
                   ` (4 preceding siblings ...)
  2022-12-14  1:48 ` [PATCH 5/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2023-01-12 11:28   ` Geert Uytterhoeven
  2022-12-14  1:48 ` [PATCH 7/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card " Kuninori Morimoto
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

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

ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
to test these.

Generic Audio Card driver had been requested on ALSA SoC.
It has many type of device connection method, and historically,
requested connection support range of generic driver have been
upgraded.

Upgrading connection support range itself was possible on generic
driver, but could not implemented, because we need to keep compatibility
on Device-Tree. This is one of the reason why we have many type of
Generic Audio Card driver.

ULCB/KF is good board to test these.
Kuninori has been testing these Generic Audio Card driver by using his
local patch to switching drivers. But it is good idea to upstream these
from information sharing point of view, because DT setting is complex.
It can be good sample for user. This patch is one of them.

From normal user point of view who don't need to test the driver,
it should keep as-is, nothing changed.

This patch adds "Audio Graph Card2 + MIXer + TDM Split" DT setting file
for ULCB/KF. Because it reach to subdevice maximum, it ignore HDMI.
We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.

Because it needs "switching driver", not "add extra feature",
it doesn't use Device-Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../ulcb-audio-graph-card2-mix+split.dtsi     | 111 +++++++++++
 .../ulcb-kf-audio-graph-card2-mix+split.dtsi  | 177 ++++++++++++++++++
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |   1 +
 arch/arm64/boot/dts/renesas/ulcb.dtsi         |   1 +
 4 files changed, 290 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi

diff --git a/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
new file mode 100644
index 000000000000..af84b03c2a94
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
@@ -0,0 +1,111 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Audio Graph Card2 (MIX + TDM Split)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Note:
+ * Because there is subdevice maximum, it will ignore HDMI output
+ *
+ *	(A) CPU0 (2ch) ------ (2ch) (X) ak4613  (MIX-0)
+ *	(B) CPU1 (2ch) --/                      (MIX-1)
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ */
+/ {
+	sound_card: sound {
+		compatible = "audio-graph-card2";
+		label = "rcar-sound";
+
+		routing = "ak4613 Playback", "DAI0 Playback",
+		"ak4613 Playback", "DAI1 Playback",
+		"DAI0 Capture",    "ak4613 Capture";
+
+		/delete-property/ dais;
+		links = <&fe_a		/* (A) CPU0   */
+			 &fe_b		/* (B) CPU1   */
+			 &be_x		/* (X) ak4613 */
+		>;
+
+		dpcm {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports@0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0>;
+				/*
+				 * FE
+				 * (A) CPU0 (MIX-0)
+				 * (B) CPU1 (MIX-1)
+				 */
+			fe_a:	port@0 { reg = <0>; fe_a_ep: endpoint { remote-endpoint = <&rsnd_a_ep>; }; };
+			fe_b:	port@1 { reg = <1>; fe_b_ep: endpoint { remote-endpoint = <&rsnd_b_ep>; }; };
+			};
+
+			ports@1 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <1>;
+				/*
+				 * BE
+				 * (X) ak4613
+				 */
+			be_x:	port@0 { reg = <0>; be_x_ep: endpoint { remote-endpoint = <&ak4613_x_ep>; }; };
+			};
+		};
+	};
+};
+
+&ak4613 {
+	port {
+		/*
+		 * (X) ak4613
+		 */
+		prefix = "ak4613";
+		convert-rate = <48000>;
+
+		ak4613_x_ep: endpoint {
+			remote-endpoint = <&be_x_ep>;
+		};
+	};
+};
+
+&rcar_sound {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/*
+		 * (A) CPU0 (MIX-0)
+		 */
+		port@0 {
+			reg = <0>;
+			rsnd_a_ep: endpoint {
+				remote-endpoint = <&fe_a_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
+				capture  = <&ssi1 &src0 &dvc1>;
+			};
+		};
+		/*
+		 * (B) CPU1 (MIX-1)
+		 */
+		port@1 {
+			reg = <1>;
+			rsnd_b_ep: endpoint {
+				remote-endpoint = <&fe_b_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
+			};
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi
new file mode 100644
index 000000000000..505ed1e3d2bb
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Audio Graph Card2 (MIX + TDM Split)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Because it reach to subdevice maximum, it ignore HDMI
+ *
+ *	(A) CPU0 (2ch) ------ (2ch) (X)	ak4613	   (MIX-0)
+ *	(B) CPU1 (2ch) --/			   (MIX-1)
+ *	(C) CPU3 (2ch) ------ (8ch) (Y)	PCM3168A-p (TDM-0 : 0,1ch)
+ *	(D) CPU2 (2ch) --/			   (TDM-1 : 2,3ch)
+ *	(E) CPU4 (2ch) --/			   (TDM-2 : 4,5ch)
+ *	(F) CPU5 (2ch) --/			   (TDM-3 : 6,7ch)
+ *	(G) CPU6 (6ch) ------ (6ch) (Z)	PCM3168A-c
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav (MIX-0)
+ *	(B) aplay   -D plughw:0,1 xxx.wav (MIX-1)
+ *	(C) aplay   -D plughw:0,2 xxx.wav (TDM-0)
+ *	(D) aplay   -D plughw:0,3 xxx.wav (TDM-1)
+ *	(E) aplay   -D plughw:0,4 xxx.wav (TDM-2)
+ *	(F) aplay   -D plughw:0,5 xxx.wav (TDM-3)
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ *	(G) arecord -D plughw:0,6 xxx.wav
+ */
+&sound_card {
+	routing = "ak4613 Playback",   "DAI0 Playback",
+		  "ak4613 Playback",   "DAI1 Playback",
+		  "DAI0 Capture",      "ak4613 Capture",
+		  "pcm3168a Playback", "DAI2 Playback",
+		  "pcm3168a Playback", "DAI3 Playback",
+		  "pcm3168a Playback", "DAI4 Playback",
+		  "pcm3168a Playback", "DAI5 Playback",
+		  "DAI6 Capture",      "pcm3168a Capture";
+
+	/delete-property/ dais;
+	links = <&fe_a		/* (A) CPU0		 */
+		 &fe_b		/* (B) CPU1		 */
+		 &fe_c		/* (C) CPU2		 */
+		 &fe_d		/* (D) CPU3		 */
+		 &fe_e		/* (E) CPU4		 */
+		 &fe_f		/* (F) CPU5		 */
+		 &rsnd_g	/* (G) CPU6 - PCM3168A-c */
+		 &be_x		/* (X) ak4613		 */
+		 &be_y		/* (Y) PCM3168A-p	 */
+	>;
+
+	dpcm {
+		ports@0 {
+		/*
+		 * FE
+		 *
+		 * (A)/(B) are defined on ulcb
+		 * (C) CPU2
+		 * (D) CPU3
+		 * (E) CPU4
+		 * (F) CPU5
+		 */
+		fe_c:	port@2 { reg = <2>; fe_c_ep: endpoint { remote-endpoint = <&rsnd_c_ep>; }; };
+		fe_d:	port@3 { reg = <3>; fe_d_ep: endpoint { remote-endpoint = <&rsnd_d_ep>; }; };
+		fe_e:	port@4 { reg = <4>; fe_e_ep: endpoint { remote-endpoint = <&rsnd_e_ep>; }; };
+		fe_f:	port@5 { reg = <5>; fe_f_ep: endpoint { remote-endpoint = <&rsnd_f_ep>; }; };
+		};
+
+		ports@1 {
+		/*
+		 * BE
+		 *
+		 * (X) is defined on ulcb
+		 * (Y) PCM3168A-p
+		 */
+		be_y:	port@1 { reg = <1>; be_y_ep: endpoint { remote-endpoint = <&pcm3168a_y_ep>; }; };
+		};
+	};
+};
+
+&pcm3168a {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		mclk-fs = <512>;
+		prefix = "pcm3168a";
+
+		/*
+		 * (Y) pcm3168a-p
+		 */
+		port@0 {
+			reg = <0>;
+			convert-channels = <8>; /* to 8ch TDM */
+			pcm3168a_y_ep: endpoint {
+				remote-endpoint = <&be_y_ep>;
+				clocks = <&clksndsel>;
+			};
+		};
+		/*
+		 * (Z) pcm3168a-c
+		 */
+		port@1 {
+			reg = <1>;
+			pcm3168a_z_ep: endpoint {
+				remote-endpoint = <&rsnd_g_ep>;
+				clocks = <&clksndsel>;
+			};
+		};
+	};
+};
+
+&rcar_sound {
+	ports {
+		/* (A)/(B) are defined in ulcb.dtsi */
+
+		/*
+		 * (C) CPU2
+		 */
+		port@2 {
+			reg = <2>;
+			rsnd_c_ep: endpoint {
+				remote-endpoint = <&fe_c_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu30 &ssi3>;
+			};
+		};
+		/*
+		 * (D) CPU3
+		 */
+		port@3 {
+			reg = <3>;
+			rsnd_d_ep: endpoint {
+				remote-endpoint = <&fe_d_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu31 &ssi3>;
+			};
+		};
+		/*
+		 * (E) CPU4
+		 */
+		port@4 {
+			reg = <4>;
+			rsnd_e_ep: endpoint {
+				remote-endpoint = <&fe_e_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu32 &ssi3>;
+			};
+		};
+		/*
+		 * (F) CPU5
+		 */
+		port@5 {
+			reg = <5>;
+			rsnd_f_ep: endpoint {
+				remote-endpoint = <&fe_f_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu33 &ssi3>;
+			};
+		};
+		/*
+		 * (G) CPU6
+		 */
+		rsnd_g: port@6 {
+			reg = <6>;
+			rsnd_g_ep: endpoint {
+				remote-endpoint = <&pcm3168a_z_ep>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssi4>;
+			};
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index 6913d778a40b..0690c1b1b5e9 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -455,5 +455,6 @@ &xhci0 {
  *
  * #include "ulcb-kf-simple-audio-card.dtsi"
  * #include "ulcb-kf-audio-graph-card.dtsi"
+ * #include "ulcb-kf-audio-graph-card2-mix+split.dtsi"
  */
 #include "ulcb-kf-audio-graph-card2.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index 497d07df6944..b357267a9083 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -503,5 +503,6 @@ &usb2_phy1 {
  *
  * #include "ulcb-simple-audio-card.dtsi"
  * #include "ulcb-audio-graph-card.dtsi"
+ * #include "ulcb-audio-graph-card2-mix+split.dtsi"
  */
 #include "ulcb-audio-graph-card2.dtsi"
-- 
2.25.1


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

* [PATCH 7/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
                   ` (5 preceding siblings ...)
  2022-12-14  1:48 ` [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2022-12-14  1:48 ` [PATCH 8/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card " Kuninori Morimoto
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

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

ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
to test these.

Generic Audio Card driver had been requested on ALSA SoC.
It has many type of device connection method, and historically,
requested connection support range of generic driver have been
upgraded.

Upgrading connection support range itself was possible on generic
driver, but could not implemented, because we need to keep compatibility
on Device-Tree. This is one of the reason why we have many type of
Generic Audio Card driver.

ULCB/KF is good board to test these.
Kuninori has been testing these Generic Audio Card driver by using his
local patch to switching drivers. But it is good idea to upstream these
from information sharing point of view, because DT setting is complex.
It can be good sample for user. This patch is one of them.

From normal user point of view who don't need to test the driver,
it should keep as-is, nothing changed.

This patch adds "Audio Graph Card + MIXer + TDM Split" DT setting file
for ULCB/KF. Because it reach to subdevice maximum, it ignore HDMI.
We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.

Because it needs "switching driver", not "add extra feature",
it doesn't use Device-Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../ulcb-audio-graph-card-mix+split.dtsi      |  89 ++++++++++
 .../ulcb-kf-audio-graph-card-mix+split.dtsi   | 162 ++++++++++++++++++
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |   1 +
 arch/arm64/boot/dts/renesas/ulcb.dtsi         |   1 +
 4 files changed, 253 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi

diff --git a/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi
new file mode 100644
index 000000000000..55acfe6c1268
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Audio Graph Card (MIX)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Note:
+ * Because there is subdevice maximum, it will ignore HDMI output
+ *
+ *	(A) CPU0 (2ch) ------ (2ch) ak4613     (MIX-0)
+ *	(B) CPU1 (2ch) --/                     (MIX-1)
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ */
+
+/ {
+	sound_card: sound {
+		compatible = "audio-graph-scu-card";
+		label = "rcar-sound";
+
+		routing = "ak4613 Playback", "DAI0 Playback",
+			  "ak4613 Playback", "DAI1 Playback",
+			  "DAI0 Capture",    "ak4613 Capture";
+
+		dais = <&rsnd_port0 /* (A) ak4613 (MIX-0) */
+			&rsnd_port1 /* (B) ak4613 (MIX-1) */
+		>;
+	};
+};
+
+&ak4613 {
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/*
+		 * (A)/(B) ak4613
+		 */
+		prefix = "ak4613";
+		convert-rate = <48000>;
+
+		ak4613_ep1: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&rsnd_for_ak4613_1>;
+		};
+		ak4613_ep2: endpoint@1 {
+			reg = <1>;
+			remote-endpoint = <&rsnd_for_ak4613_2>;
+		};
+	};
+};
+
+&rcar_sound {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/*
+		 * (A) CPU0
+		 */
+		rsnd_port0: port@0 {
+			reg = <0>;
+			rsnd_for_ak4613_1: endpoint {
+				remote-endpoint = <&ak4613_ep1>;
+				bitclock-master;
+				frame-master;
+				playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
+				capture  = <&ssi1 &src0 &dvc1>;
+			};
+		};
+		/*
+		 * (B) CPU1
+		 */
+		rsnd_port1: port@1 {
+			reg = <1>;
+			rsnd_for_ak4613_2: endpoint {
+				remote-endpoint = <&ak4613_ep2>;
+				bitclock-master;
+				frame-master;
+				playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
+			};
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi
new file mode 100644
index 000000000000..92cc06353746
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi
@@ -0,0 +1,162 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Audio Graph Card (MIX + TDM Split)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Because it reach to subdevice maximum, it ignore HDMI
+ *
+ *	(A) CPU0 (2ch) ------ (2ch) ak4613     (MIX-0)
+ *	(B) CPU1 (2ch) --/                     (MIX-1)
+ *	(C) CPU3 (2ch) ------ (8ch) PCM3168A-p (TDM-0 : 0,1ch)
+ *	(D) CPU2 (2ch) --/                     (TDM-1 : 2,3ch)
+ *	(E) CPU4 (2ch) --/                     (TDM-2 : 4,5ch)
+ *	(F) CPU5 (2ch) --/                     (TDM-3 : 6,7ch)
+ *	(G) CPU6 (6ch) ------ (6ch) PCM3168A-c
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav (MIX-0)
+ *	(B) aplay   -D plughw:0,1 xxx.wav (MIX-1)
+ *	(C) aplay   -D plughw:0,2 xxx.wav (TDM-0)
+ *	(D) aplay   -D plughw:0,3 xxx.wav (TDM-1)
+ *	(E) aplay   -D plughw:0,4 xxx.wav (TDM-2)
+ *	(F) aplay   -D plughw:0,5 xxx.wav (TDM-3)
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ *	(G) arecord -D plughw:0,6 xxx.wav
+ */
+
+&sound_card {
+	routing = "ak4613 Playback",   "DAI0 Playback",
+		  "ak4613 Playback",   "DAI1 Playback",
+		  "DAI0 Capture",      "ak4613 Capture",
+		  "pcm3168a Playback", "DAI2 Playback",
+		  "pcm3168a Playback", "DAI3 Playback",
+		  "pcm3168a Playback", "DAI4 Playback",
+		  "pcm3168a Playback", "DAI5 Playback";
+
+	dais = <&rsnd_port0 /* (A) ak4613   (MIX-0) */
+		&rsnd_port1 /* (B) ak4613   (MIX-1) */
+		&rsnd_port2 /* (C) pcm3168a (TDM-0) */
+		&rsnd_port3 /* (D) pcm3168a (TDM-1) */
+		&rsnd_port4 /* (E) pcm3168a (TDM-2) */
+		&rsnd_port5 /* (F) pcm3168a (TDM-3) */
+		&rsnd_port6 /* (G) pcm3168a	    */
+	>;
+};
+
+&pcm3168a {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		mclk-fs = <512>;
+
+		/*
+		 * (C) CPU2 <-> pcm3168a (TDM-0)
+		 * (D) CPU3 <-> pcm3168a (TDM-1)
+		 * (E) CPU4 <-> pcm3168a (TDM-1)
+		 * (F) CPU5 <-> pcm3168a (TDM-1)
+		 */
+		port@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;
+			prefix = "pcm3168a";
+			convert-channels = <8>; /* to 8ch TDM */
+
+			pcm3168a_endpoint_p1: endpoint@0 {
+				reg = <0>;
+				remote-endpoint = <&rsnd_for_pcm3168a_play1>;
+				clocks = <&clksndsel>;
+			};
+			pcm3168a_endpoint_p2: endpoint@1 {
+				reg = <1>;
+				remote-endpoint = <&rsnd_for_pcm3168a_play2>;
+				clocks = <&clksndsel>;
+			};
+			pcm3168a_endpoint_p3: endpoint@2 {
+				reg = <2>;
+				remote-endpoint = <&rsnd_for_pcm3168a_play3>;
+				clocks = <&clksndsel>;
+			};
+			pcm3168a_endpoint_p4: endpoint@3 {
+				reg = <3>;
+				remote-endpoint = <&rsnd_for_pcm3168a_play4>;
+				clocks = <&clksndsel>;
+			};
+		};
+		/*
+		 * (G) CPU6 <-> pcm3168a
+		 */
+		port@1 {
+			reg = <1>;
+			pcm3168a_endpoint_c: endpoint {
+				remote-endpoint = <&rsnd_for_pcm3168a_capture>;
+				clocks = <&clksndsel>;
+			};
+		};
+	};
+};
+
+&rcar_sound {
+	ports {
+		/* rsnd_port0-1 are defined in ulcb.dtsi */
+
+		/*
+		 * (C) CPU2 <-> pcm3168a (TDM-0)
+		 * (D) CPU3 <-> pcm3168a (TDM-1)
+		 * (E) CPU4 <-> pcm3168a (TDM-1)
+		 * (F) CPU5 <-> pcm3168a (TDM-1)
+		 */
+		rsnd_port2: port@2 {
+			reg = <2>;
+			rsnd_for_pcm3168a_play1: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_p1>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu30 &ssi3>;
+			};
+		};
+		rsnd_port3: port@3 {
+			reg = <3>;
+			rsnd_for_pcm3168a_play2: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_p2>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu31 &ssi3>;
+			};
+		};
+		rsnd_port4: port@4 {
+			reg = <4>;
+			rsnd_for_pcm3168a_play3: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_p3>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu32 &ssi3>;
+			};
+		};
+		rsnd_port5: port@5 {
+			reg = <5>;
+			rsnd_for_pcm3168a_play4: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_p4>;
+				bitclock-master;
+				frame-master;
+				playback = <&ssiu33 &ssi3>;
+			};
+		};
+		/*
+		 * (G) CPU6 <-> pcm3168a
+		 */
+		rsnd_port6: port@6 {
+			reg = <6>;
+			rsnd_for_pcm3168a_capture: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_c>;
+				bitclock-master;
+				frame-master;
+				dai-tdm-slot-num = <6>;
+				capture  = <&ssi4>;
+			};
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index 0690c1b1b5e9..131846dde002 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -455,6 +455,7 @@ &xhci0 {
  *
  * #include "ulcb-kf-simple-audio-card.dtsi"
  * #include "ulcb-kf-audio-graph-card.dtsi"
+ * #include "ulcb-kf-audio-graph-card-mix+split.dtsi"
  * #include "ulcb-kf-audio-graph-card2-mix+split.dtsi"
  */
 #include "ulcb-kf-audio-graph-card2.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index b357267a9083..d8b0b07404ca 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -503,6 +503,7 @@ &usb2_phy1 {
  *
  * #include "ulcb-simple-audio-card.dtsi"
  * #include "ulcb-audio-graph-card.dtsi"
+ * #include "ulcb-audio-graph-card-mix+split.dtsi"
  * #include "ulcb-audio-graph-card2-mix+split.dtsi"
  */
 #include "ulcb-audio-graph-card2.dtsi"
-- 
2.25.1


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

* [PATCH 8/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
                   ` (6 preceding siblings ...)
  2022-12-14  1:48 ` [PATCH 7/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card " Kuninori Morimoto
@ 2022-12-14  1:48 ` Kuninori Morimoto
  2023-01-10 23:46 ` [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
  2023-01-11 14:45   ` Geert Uytterhoeven
  9 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2022-12-14  1:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

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

ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
to test these.

Generic Audio Card driver had been requested on ALSA SoC.
It has many type of device connection method, and historically,
requested connection support range of generic driver have been
upgraded.

Upgrading connection support range itself was possible on generic
driver, but could not implemented, because we need to keep compatibility
on Device-Tree. This is one of the reason why we have many type of
Generic Audio Card driver.

ULCB/KF is good board to test these.
Kuninori has been testing these Generic Audio Card driver by using his
local patch to switching drivers. But it is good idea to upstream these
from information sharing point of view, because DT setting is complex.
It can be good sample for user. This patch is one of them.

From normal user point of view who don't need to test the driver,
it should keep as-is, nothing changed.

This patch adds "Simle Audio Card + MIXer + TDM Split" DT setting file
for ULCB/KF. Because it reach to subdevice maximum, it ignore HDMI.
We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.

Because it needs "switching driver", not "add extra feature",
it doesn't use Device-Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../ulcb-kf-simple-audio-card-mix+split.dtsi  | 137 ++++++++++++++++++
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |   1 +
 .../ulcb-simple-audio-card-mix+split.dtsi     |  86 +++++++++++
 arch/arm64/boot/dts/renesas/ulcb.dtsi         |   2 +
 4 files changed, 226 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
 create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi

diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
new file mode 100644
index 000000000000..fba226fae0a4
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
@@ -0,0 +1,137 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Simple Audio Card (MIX + TDM Split)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Note:
+ * Because there is subdevice maximum, it will ignore HDMI output
+ *
+ *	(A) CPU0 ------ ak4613      (MIX-0)
+ *	(B) CPU1 --/                (MIX-1)
+ *	(C) CPU2 ------ PCM3168A-p  (TDM-0 : 0,1ch)
+ *	(D) CPU3 ------ PCM3168A-p  (TDM-1 : 2,3ch)
+ *	(E) CPU4 ------ PCM3168A-p  (TDM-2 : 4,5ch)
+ *	(F) CPU5 ------ PCM3168A-p  (TDM-3 : 6,7ch)
+ *	(G) CPU6 ------ PCM3168A-c
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav (MIX-0)
+ *	(B) aplay   -D plughw:0,1 xxx.wav (MIX-1)
+ *	(C) aplay   -D plughw:0,2 xxx.wav (TDM-0)
+ *	(D) aplay   -D plughw:0,3 xxx.wav (TDM-1)
+ *	(E) aplay   -D plughw:0,4 xxx.wav (TDM-2)
+ *	(F) aplay   -D plughw:0,5 xxx.wav (TDM-3)
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ *	(G) arecord -D plughw:0,6 xxx.wav
+ */
+
+&sound_card {
+
+	simple-audio-card,routing = "ak4613 Playback",   "DAI0 Playback",
+				    "ak4613 Playback",   "DAI1 Playback",
+				    "DAI0 Capture",      "ak4613 Capture",
+				    "pcm3168a Playback", "DAI2 Playback",
+				    "pcm3168a Playback", "DAI3 Playback",
+				    "pcm3168a Playback", "DAI4 Playback",
+				    "pcm3168a Playback", "DAI5 Playback";
+
+	/* dai-link@0 is defined in ulcb.dtsi */
+
+	/*
+	 * (C) CPU2 <-> PCM3168A-p  (TDM-0 : 0,1ch)
+	 * (D) CPU3 <-> PCM3168A-p  (TDM-1 : 2,3ch)
+	 * (E) CPU4 <-> PCM3168A-p  (TDM-2 : 4,5ch)
+	 * (F) CPU5 <-> PCM3168A-p  (TDM-3 : 6,7ch)
+	 */
+	simple-audio-card,dai-link@1 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <1>;
+		convert-channels = <8>; /* to 8ch TDM */
+
+		cpu@0 {
+			reg = <0>;
+			bitclock-master;
+			frame-master;
+			sound-dai = <&rcar_sound 2>;
+		};
+		cpu@1 {
+			reg = <1>;
+			sound-dai = <&rcar_sound 3>;
+		};
+		cpu@2 {
+			reg = <2>;
+			sound-dai = <&rcar_sound 4>;
+		};
+		cpu@3 {
+			reg = <3>;
+			sound-dai = <&rcar_sound 5>;
+		};
+		codec {
+			prefix = "pcm3168a";
+			mclk-fs = <512>;
+			sound-dai = <&pcm3168a 0>;
+		};
+	};
+	/*
+	 * (G) CPU6 <-> PCM3168A-c
+	 */
+	simple-audio-card,dai-link@2 {
+		reg = <2>;
+		cpu {
+			bitclock-master;
+			frame-master;
+			sound-dai = <&rcar_sound 6>;
+		};
+		codec {
+			prefix = "pcm3168a";
+			mclk-fs = <512>;
+			sound-dai = <&pcm3168a 1>;
+		};
+	};
+};
+
+&pcm3168a {
+	/*
+	 * (C) CPU2 <-> PCM3168A-p  (TDM-0 : 0,1ch)
+	 * (D) CPU3 <-> PCM3168A-p  (TDM-1 : 2,3ch)
+	 * (E) CPU4 <-> PCM3168A-p  (TDM-2 : 4,5ch)
+	 * (F) CPU5 <-> PCM3168A-p  (TDM-3 : 6,7ch)
+	 * (G) CPU6 <-> PCM3168A-c
+	 */
+	#sound-dai-cells = <1>;
+};
+
+&rcar_sound {
+
+	/* dai0-1 are defined in ulcb.dtsi */
+
+	rcar_sound,dai {
+		/*
+		 * (C) CPU2 <-> PCM3168A-p  (TDM-0 : 0,1ch)
+		 * (D) CPU3 <-> PCM3168A-p  (TDM-1 : 2,3ch)
+		 * (E) CPU4 <-> PCM3168A-p  (TDM-2 : 4,5ch)
+		 * (F) CPU5 <-> PCM3168A-p  (TDM-3 : 6,7ch)
+		 */
+		dai2 {
+			playback = <&ssiu30 &ssi3>;
+		};
+		dai3 {
+			playback = <&ssiu31 &ssi3>;
+		};
+		dai4 {
+			playback = <&ssiu32 &ssi3>;
+		};
+		dai5 {
+			playback = <&ssiu33 &ssi3>;
+		};
+		/*
+		 * (G) CPU6 <-> PCM3168A-c
+		 */
+		dai6 {
+			capture = <&ssi4>;
+	};	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index 131846dde002..ec115124035b 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -454,6 +454,7 @@ &xhci0 {
  * see also ulcb.dtsi
  *
  * #include "ulcb-kf-simple-audio-card.dtsi"
+ * #include "ulcb-kf-simple-audio-card-mix+split.dtsi"
  * #include "ulcb-kf-audio-graph-card.dtsi"
  * #include "ulcb-kf-audio-graph-card-mix+split.dtsi"
  * #include "ulcb-kf-audio-graph-card2-mix+split.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi
new file mode 100644
index 000000000000..37cd9a7ec1b2
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Simple Audio Card (MIXer)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Note:
+ * Because there is subdevice maximum, it will ignore HDMI output
+ *
+ *	(A) CPU0 ------ ak4613      (MIX-0)
+ *	(B) CPU1 --/                (MIX-1)
+ *
+ *	(A) aplay   -D plughw:0,0 xxx.wav
+ *	(B) aplay   -D plughw:0,1 xxx.wav
+ *
+ *	(A) arecord -D plughw:0,0 xxx.wav
+ */
+
+/ {
+	sound_card: sound {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		compatible = "simple-scu-audio-card";
+		label = "rcar-sound";
+
+		simple-audio-card,prefix  = "ak4613";
+		simple-audio-card,routing = "ak4613 Playback", "DAI0 Playback",
+					    "ak4613 Playback", "DAI1 Playback",
+					    "DAI0 Capture",    "ak4613 Capture";
+
+		simple-audio-card,dai-link@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;
+			convert-rate = <48000>;
+
+			/*
+			 * (A) CPU0 <-> ak4613
+			 */
+			cpu@0 {
+				reg = <0>;
+				bitclock-master;
+				frame-master;
+				sound-dai = <&rcar_sound 0>;
+			};
+			/*
+			 * (B) CPU1 <-> ak4613
+			 */
+			cpu@1 {
+				reg = <1>;
+				sound-dai = <&rcar_sound 1>;
+			};
+			codec {
+				prefix = "ak4613";
+				sound-dai = <&ak4613>;
+			};
+		};
+	};
+};
+
+&ak4613 {
+	/*
+	 * (A) CPU0 <-> ak4613
+	 */
+	#sound-dai-cells = <0>;
+};
+
+&rcar_sound {
+	#sound-dai-cells = <1>;
+
+	rcar_sound,dai {
+		/*
+		 * (A) CPU0 <-> ak4613
+		 */
+		dai0 {
+			playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
+			capture  = <&ssi1 &src0 &dvc1>;
+		};
+		dai1 {
+			playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index d8b0b07404ca..377fe6891c57 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -496,12 +496,14 @@ &usb2_phy1 {
 	status = "okay";
 };
 
+
 /*
  * For sound-test.
  *
  * We can switch Audio Card for testing
  *
  * #include "ulcb-simple-audio-card.dtsi"
+ * #include "ulcb-simple-audio-card-mix+split.dtsi"
  * #include "ulcb-audio-graph-card.dtsi"
  * #include "ulcb-audio-graph-card-mix+split.dtsi"
  * #include "ulcb-audio-graph-card2-mix+split.dtsi"
-- 
2.25.1


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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
                   ` (7 preceding siblings ...)
  2022-12-14  1:48 ` [PATCH 8/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card " Kuninori Morimoto
@ 2023-01-10 23:46 ` Kuninori Morimoto
  2023-01-11 14:45   ` Geert Uytterhoeven
  9 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-10 23:46 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


Hi Geert

> ALSA SoC is now supporting generic Sound Card driver such as
> Simple-Card / Audio-Graph-Card/Card2, and it supports
> "normal connection" and "special connections".
> I'm its maintainer, thus I need/want to test these.
> 
> I have been tested these by using my local patches to switching card,
> but maintenance it locally is not useful for me, and users who want to
> know the sample DT settings.
> 
> And I have noticed that some local patch had bug, but no one noticed
> about it (of course :)
> 
> ULCB/KF is very good board to test these.
> So, I want to upstream these.
> 
> One note here is that this patch *should not* have effect to
> existing normal users, but useful for test user.
> So, this patch-set adds "3 card" x "2 use case" dtsi file,
> and ulcb/ulcb-kf "include" one of them which doesn't change anything.
> test user can switch to other card or other use case by changing
> "include" dtsi.
> 
> [1/8][2/8] are small tidyup patches for all SoC sound.
> 
> Kuninori Morimoto (8):
>   ARM: dts: renesas: #sound-dai-cells is used when simple-card
>   arm64: dts: renesas: #sound-dai-cells is used when simple-card
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
>   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
>   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi

Are these rejected ? or can I post these again ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
  2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
@ 2023-01-11 14:45   ` Geert Uytterhoeven
  2022-12-14  1:48 ` [PATCH 2/8] arm64: " Kuninori Morimoto
                     ` (8 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-11 14:45 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Linux-Renesas, Rob Herring, Krzysztof Kozlowski, Mark Brown,
	Liam Girdwood,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart

Hi Morimoto-san,

CC DT/ASoC

On Wed, Dec 14, 2022 at 2:47 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> ALSA SoC is now supporting generic Sound Card driver such as
> Simple-Card / Audio-Graph-Card/Card2, and it supports
> "normal connection" and "special connections".
> I'm its maintainer, thus I need/want to test these.
>
> I have been tested these by using my local patches to switching card,
> but maintenance it locally is not useful for me, and users who want to
> know the sample DT settings.
>
> And I have noticed that some local patch had bug, but no one noticed
> about it (of course :)
>
> ULCB/KF is very good board to test these.
> So, I want to upstream these.
>
> One note here is that this patch *should not* have effect to
> existing normal users, but useful for test user.
> So, this patch-set adds "3 card" x "2 use case" dtsi file,
> and ulcb/ulcb-kf "include" one of them which doesn't change anything.
> test user can switch to other card or other use case by changing
> "include" dtsi.
>
> [1/8][2/8] are small tidyup patches for all SoC sound.

Thanks for your series!

I really wanted to review this earlier, but I am held back by my lack
of understanding of the audio subsystem and the audio bindings.
It is also not clear to me what really is hardware description
(i.e. to be described in DT), and what is software policy (i.e. not
to be described in DT)...
Hence I have lots of questions ("A fool can ask more questions in a
minute than a wise man can answer in an hour." ;-)

What is the difference between "Simple Audio Card", "Audio Graph Card",
and "Audio Graph Card2"?  Why do we need to support all three of them?

How come we can have no #sound-dai-cells, #sound-dai-cells = <0>,
and #sound-dai-cells = <1>, for the same hardware?
What is the real difference between Single DAI and Multi DAI?
Why do we need to support both?

> Kuninori Morimoto (8):
>   ARM: dts: renesas: #sound-dai-cells is used when simple-card
>   arm64: dts: renesas: #sound-dai-cells is used when simple-card
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
>   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi

The above three all describe the same hardware configuration?

>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
>   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi

Is MIX and TDM Split a different hardware configuration, or software
policy?

Thanks!

>  arch/arm/boot/dts/r8a7742.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7743.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7744.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7745.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7778.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7790.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7791.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7793.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7794.dtsi                |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774a1.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774b1.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774c0.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774e1.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77951.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77960.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77961.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77965.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77990.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77995.dtsi     |   2 +-
>  .../boot/dts/renesas/salvator-common.dtsi     |   3 -
>  .../ulcb-audio-graph-card-mix+split.dtsi      |  89 +++++++++
>  .../dts/renesas/ulcb-audio-graph-card.dtsi    |  85 +++++++++
>  .../ulcb-audio-graph-card2-mix+split.dtsi     | 111 +++++++++++
>  .../dts/renesas/ulcb-audio-graph-card2.dtsi   |  26 +++
>  .../ulcb-kf-audio-graph-card-mix+split.dtsi   | 162 ++++++++++++++++
>  .../dts/renesas/ulcb-kf-audio-graph-card.dtsi |  88 +++++++++
>  .../ulcb-kf-audio-graph-card2-mix+split.dtsi  | 177 ++++++++++++++++++
>  .../renesas/ulcb-kf-audio-graph-card2.dtsi    |  30 +++
>  .../ulcb-kf-simple-audio-card-mix+split.dtsi  | 137 ++++++++++++++
>  .../renesas/ulcb-kf-simple-audio-card.dtsi    |  85 +++++++++
>  arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |  66 ++-----
>  .../ulcb-simple-audio-card-mix+split.dtsi     |  86 +++++++++
>  .../dts/renesas/ulcb-simple-audio-card.dtsi   |  89 +++++++++
>  arch/arm64/boot/dts/renesas/ulcb.dtsi         |  60 ++----
>  34 files changed, 1212 insertions(+), 120 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi

Gr{oetje,eeting}s,

                        Geert

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

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

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
@ 2023-01-11 14:45   ` Geert Uytterhoeven
  0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-11 14:45 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart, Liam Girdwood,
	Rob Herring, Linux-Renesas, Mark Brown, Krzysztof Kozlowski

Hi Morimoto-san,

CC DT/ASoC

On Wed, Dec 14, 2022 at 2:47 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> ALSA SoC is now supporting generic Sound Card driver such as
> Simple-Card / Audio-Graph-Card/Card2, and it supports
> "normal connection" and "special connections".
> I'm its maintainer, thus I need/want to test these.
>
> I have been tested these by using my local patches to switching card,
> but maintenance it locally is not useful for me, and users who want to
> know the sample DT settings.
>
> And I have noticed that some local patch had bug, but no one noticed
> about it (of course :)
>
> ULCB/KF is very good board to test these.
> So, I want to upstream these.
>
> One note here is that this patch *should not* have effect to
> existing normal users, but useful for test user.
> So, this patch-set adds "3 card" x "2 use case" dtsi file,
> and ulcb/ulcb-kf "include" one of them which doesn't change anything.
> test user can switch to other card or other use case by changing
> "include" dtsi.
>
> [1/8][2/8] are small tidyup patches for all SoC sound.

Thanks for your series!

I really wanted to review this earlier, but I am held back by my lack
of understanding of the audio subsystem and the audio bindings.
It is also not clear to me what really is hardware description
(i.e. to be described in DT), and what is software policy (i.e. not
to be described in DT)...
Hence I have lots of questions ("A fool can ask more questions in a
minute than a wise man can answer in an hour." ;-)

What is the difference between "Simple Audio Card", "Audio Graph Card",
and "Audio Graph Card2"?  Why do we need to support all three of them?

How come we can have no #sound-dai-cells, #sound-dai-cells = <0>,
and #sound-dai-cells = <1>, for the same hardware?
What is the real difference between Single DAI and Multi DAI?
Why do we need to support both?

> Kuninori Morimoto (8):
>   ARM: dts: renesas: #sound-dai-cells is used when simple-card
>   arm64: dts: renesas: #sound-dai-cells is used when simple-card
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
>   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi

The above three all describe the same hardware configuration?

>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
>   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
>   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi

Is MIX and TDM Split a different hardware configuration, or software
policy?

Thanks!

>  arch/arm/boot/dts/r8a7742.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7743.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7744.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7745.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7778.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7790.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7791.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7793.dtsi                |   2 +-
>  arch/arm/boot/dts/r8a7794.dtsi                |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774a1.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774b1.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774c0.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a774e1.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77951.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77960.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77961.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77965.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77990.dtsi     |   2 +-
>  arch/arm64/boot/dts/renesas/r8a77995.dtsi     |   2 +-
>  .../boot/dts/renesas/salvator-common.dtsi     |   3 -
>  .../ulcb-audio-graph-card-mix+split.dtsi      |  89 +++++++++
>  .../dts/renesas/ulcb-audio-graph-card.dtsi    |  85 +++++++++
>  .../ulcb-audio-graph-card2-mix+split.dtsi     | 111 +++++++++++
>  .../dts/renesas/ulcb-audio-graph-card2.dtsi   |  26 +++
>  .../ulcb-kf-audio-graph-card-mix+split.dtsi   | 162 ++++++++++++++++
>  .../dts/renesas/ulcb-kf-audio-graph-card.dtsi |  88 +++++++++
>  .../ulcb-kf-audio-graph-card2-mix+split.dtsi  | 177 ++++++++++++++++++
>  .../renesas/ulcb-kf-audio-graph-card2.dtsi    |  30 +++
>  .../ulcb-kf-simple-audio-card-mix+split.dtsi  | 137 ++++++++++++++
>  .../renesas/ulcb-kf-simple-audio-card.dtsi    |  85 +++++++++
>  arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |  66 ++-----
>  .../ulcb-simple-audio-card-mix+split.dtsi     |  86 +++++++++
>  .../dts/renesas/ulcb-simple-audio-card.dtsi   |  89 +++++++++
>  arch/arm64/boot/dts/renesas/ulcb.dtsi         |  60 ++----
>  34 files changed, 1212 insertions(+), 120 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi
>  create mode 100644 arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi

Gr{oetje,eeting}s,

                        Geert

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

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

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
  2023-01-11 14:45   ` Geert Uytterhoeven
@ 2023-01-12  0:17     ` Kuninori Morimoto
  -1 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-12  0:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux-Renesas, Rob Herring, Krzysztof Kozlowski, Mark Brown,
	Liam Girdwood,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart


Hi Geert

> I really wanted to review this earlier, but I am held back by my lack
> of understanding of the audio subsystem and the audio bindings.
> It is also not clear to me what really is hardware description
> (i.e. to be described in DT), and what is software policy (i.e. not
> to be described in DT)...

OK, I will try to answer your question, here.

> Hence I have lots of questions ("A fool can ask more questions in a
> minute than a wise man can answer in an hour." ;-)

No problem, your are very wise man :)

> What is the difference between "Simple Audio Card", "Audio Graph Card",
> and "Audio Graph Card2"?  Why do we need to support all three of them?

The answer is because of "history" and "compatibility".

"Simple Audio Card" was created before DT support, now it is supporting DT too.
But it is for very simple sound connection. It is using own DT style.

"Audio Graph Card" is almost same as "Simple Audio Card", but it is
using "Of Graph" style. It is needed for HDMI support (= Sound with Video).
"Audio Graph Card" was created because it is difficult to keep compatibility
for both "Of Graph style" and "own style" on "Simple Audio Card".

"Audio Graph Card2" is expand version of "Audio Graph Card",
but it is supporting more complex connections.
Because of this complex connection, it is difficult to keep compatibility
with "Audio Graph Card".

For normal user case, selecting one of them is very enough.
But for me, I need to test all of them, thus I want to switch these easily.
And ULCB is good board for testing.

Basically, people don't need to care about this patch-set.
It separates DT file, but nothing change.
It is just easy for testing.

> How come we can have no #sound-dai-cells, #sound-dai-cells = <0>,
> and #sound-dai-cells = <1>, for the same hardware?
> What is the real difference between Single DAI and Multi DAI?
> Why do we need to support both?

It is used on "Simple Audio Card".
We  need <0> if the board is using SSI x 1,
and need <1> if the board is using SSI x N.
It is not mandatory if the board is using "Audio Graph Card/Card2".

> > Kuninori Morimoto (8):
> >   ARM: dts: renesas: #sound-dai-cells is used when simple-card
> >   arm64: dts: renesas: #sound-dai-cells is used when simple-card
> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
> 
> The above three all describe the same hardware configuration?

Yes, same hardware, but is using different connection style (= driver).

> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi
> 
> Is MIX and TDM Split a different hardware configuration, or software
> policy?

Same hardware, but different connection (= mixing, split).


Hmm, it is difficult to explain via text...
But this patch-set has no effect for users, but expand to easy to switch
driver for testing for me.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
@ 2023-01-12  0:17     ` Kuninori Morimoto
  0 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-12  0:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart, Liam Girdwood,
	Rob Herring, Linux-Renesas, Mark Brown, Krzysztof Kozlowski


Hi Geert

> I really wanted to review this earlier, but I am held back by my lack
> of understanding of the audio subsystem and the audio bindings.
> It is also not clear to me what really is hardware description
> (i.e. to be described in DT), and what is software policy (i.e. not
> to be described in DT)...

OK, I will try to answer your question, here.

> Hence I have lots of questions ("A fool can ask more questions in a
> minute than a wise man can answer in an hour." ;-)

No problem, your are very wise man :)

> What is the difference between "Simple Audio Card", "Audio Graph Card",
> and "Audio Graph Card2"?  Why do we need to support all three of them?

The answer is because of "history" and "compatibility".

"Simple Audio Card" was created before DT support, now it is supporting DT too.
But it is for very simple sound connection. It is using own DT style.

"Audio Graph Card" is almost same as "Simple Audio Card", but it is
using "Of Graph" style. It is needed for HDMI support (= Sound with Video).
"Audio Graph Card" was created because it is difficult to keep compatibility
for both "Of Graph style" and "own style" on "Simple Audio Card".

"Audio Graph Card2" is expand version of "Audio Graph Card",
but it is supporting more complex connections.
Because of this complex connection, it is difficult to keep compatibility
with "Audio Graph Card".

For normal user case, selecting one of them is very enough.
But for me, I need to test all of them, thus I want to switch these easily.
And ULCB is good board for testing.

Basically, people don't need to care about this patch-set.
It separates DT file, but nothing change.
It is just easy for testing.

> How come we can have no #sound-dai-cells, #sound-dai-cells = <0>,
> and #sound-dai-cells = <1>, for the same hardware?
> What is the real difference between Single DAI and Multi DAI?
> Why do we need to support both?

It is used on "Simple Audio Card".
We  need <0> if the board is using SSI x 1,
and need <1> if the board is using SSI x N.
It is not mandatory if the board is using "Audio Graph Card/Card2".

> > Kuninori Morimoto (8):
> >   ARM: dts: renesas: #sound-dai-cells is used when simple-card
> >   arm64: dts: renesas: #sound-dai-cells is used when simple-card
> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
> 
> The above three all describe the same hardware configuration?

Yes, same hardware, but is using different connection style (= driver).

> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
> >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi
> 
> Is MIX and TDM Split a different hardware configuration, or software
> policy?

Same hardware, but different connection (= mixing, split).


Hmm, it is difficult to explain via text...
But this patch-set has no effect for users, but expand to easy to switch
driver for testing for me.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
  2023-01-12  0:17     ` Kuninori Morimoto
@ 2023-01-12 10:59       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-12 10:59 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart, Liam Girdwood,
	Rob Herring, Linux-Renesas, Mark Brown, Krzysztof Kozlowski

Hi Morimoto-san,

On Thu, Jan 12, 2023 at 1:17 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> > What is the difference between "Simple Audio Card", "Audio Graph Card",
> > and "Audio Graph Card2"?  Why do we need to support all three of them?
>
> The answer is because of "history" and "compatibility".
>
> "Simple Audio Card" was created before DT support, now it is supporting DT too.
> But it is for very simple sound connection. It is using own DT style.
>
> "Audio Graph Card" is almost same as "Simple Audio Card", but it is
> using "Of Graph" style. It is needed for HDMI support (= Sound with Video).
> "Audio Graph Card" was created because it is difficult to keep compatibility
> for both "Of Graph style" and "own style" on "Simple Audio Card".
>
> "Audio Graph Card2" is expand version of "Audio Graph Card",
> but it is supporting more complex connections.
> Because of this complex connection, it is difficult to keep compatibility
> with "Audio Graph Card".

So they are different ways (generations) of representing the audio
topology on the board? Like "operating-points" and "operating-points-v2"
for cpufreq?

Hence these are orthogonal to (and independent of) the underlying audio
hardware in the SoC?

> For normal user case, selecting one of them is very enough.
> But for me, I need to test all of them, thus I want to switch these easily.
> And ULCB is good board for testing.
>
> Basically, people don't need to care about this patch-set.
> It separates DT file, but nothing change.
> It is just easy for testing.

OK. And I guess you intend to use them as examples to point people
to, too?

> > How come we can have no #sound-dai-cells, #sound-dai-cells = <0>,
> > and #sound-dai-cells = <1>, for the same hardware?
> > What is the real difference between Single DAI and Multi DAI?
> > Why do we need to support both?
>
> It is used on "Simple Audio Card".
> We  need <0> if the board is using SSI x 1,
> and need <1> if the board is using SSI x N.
> It is not mandatory if the board is using "Audio Graph Card/Card2".

So #sound-dai-cells should be in the board DTS, and never in the
SoC .dtsi? Hence it should be moved out of
arch/arm/boot/dts/{r8a7740,sh73a0}.dtsi and
arch/arm64/boot/dts/renesas/r9a07g0{43,44,54}.dtsi?

> > > Kuninori Morimoto (8):
> > >   ARM: dts: renesas: #sound-dai-cells is used when simple-card
> > >   arm64: dts: renesas: #sound-dai-cells is used when simple-card
> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
> >
> > The above three all describe the same hardware configuration?
>
> Yes, same hardware, but is using different connection style (= driver).

OK.

> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi
> >
> > Is MIX and TDM Split a different hardware configuration, or software
> > policy?
>
> Same hardware, but different connection (= mixing, split).
>
> Hmm, it is difficult to explain via text...

IC, this is more complicated...

Thanks!

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
@ 2023-01-12 10:59       ` Geert Uytterhoeven
  0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-12 10:59 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Linux-Renesas, Rob Herring, Krzysztof Kozlowski, Mark Brown,
	Liam Girdwood,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart

Hi Morimoto-san,

On Thu, Jan 12, 2023 at 1:17 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> > What is the difference between "Simple Audio Card", "Audio Graph Card",
> > and "Audio Graph Card2"?  Why do we need to support all three of them?
>
> The answer is because of "history" and "compatibility".
>
> "Simple Audio Card" was created before DT support, now it is supporting DT too.
> But it is for very simple sound connection. It is using own DT style.
>
> "Audio Graph Card" is almost same as "Simple Audio Card", but it is
> using "Of Graph" style. It is needed for HDMI support (= Sound with Video).
> "Audio Graph Card" was created because it is difficult to keep compatibility
> for both "Of Graph style" and "own style" on "Simple Audio Card".
>
> "Audio Graph Card2" is expand version of "Audio Graph Card",
> but it is supporting more complex connections.
> Because of this complex connection, it is difficult to keep compatibility
> with "Audio Graph Card".

So they are different ways (generations) of representing the audio
topology on the board? Like "operating-points" and "operating-points-v2"
for cpufreq?

Hence these are orthogonal to (and independent of) the underlying audio
hardware in the SoC?

> For normal user case, selecting one of them is very enough.
> But for me, I need to test all of them, thus I want to switch these easily.
> And ULCB is good board for testing.
>
> Basically, people don't need to care about this patch-set.
> It separates DT file, but nothing change.
> It is just easy for testing.

OK. And I guess you intend to use them as examples to point people
to, too?

> > How come we can have no #sound-dai-cells, #sound-dai-cells = <0>,
> > and #sound-dai-cells = <1>, for the same hardware?
> > What is the real difference between Single DAI and Multi DAI?
> > Why do we need to support both?
>
> It is used on "Simple Audio Card".
> We  need <0> if the board is using SSI x 1,
> and need <1> if the board is using SSI x N.
> It is not mandatory if the board is using "Audio Graph Card/Card2".

So #sound-dai-cells should be in the board DTS, and never in the
SoC .dtsi? Hence it should be moved out of
arch/arm/boot/dts/{r8a7740,sh73a0}.dtsi and
arch/arm64/boot/dts/renesas/r9a07g0{43,44,54}.dtsi?

> > > Kuninori Morimoto (8):
> > >   ARM: dts: renesas: #sound-dai-cells is used when simple-card
> > >   arm64: dts: renesas: #sound-dai-cells is used when simple-card
> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
> >
> > The above three all describe the same hardware configuration?
>
> Yes, same hardware, but is using different connection style (= driver).

OK.

> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi MIX + TDM Split dtsi
> > >   arm64: dts: renesas: add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi
> >
> > Is MIX and TDM Split a different hardware configuration, or software
> > policy?
>
> Same hardware, but different connection (= mixing, split).
>
> Hmm, it is difficult to explain via text...

IC, this is more complicated...

Thanks!

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

* Re: [PATCH 3/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi
  2022-12-14  1:48 ` [PATCH 3/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi Kuninori Morimoto
@ 2023-01-12 11:12   ` Geert Uytterhoeven
  0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-12 11:12 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Wed, Dec 14, 2022 at 2:48 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
> Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
> to test these.
>
> Generic Audio Card driver had been requested on ALSA SoC.
> It has many type of device connection method, and historically,
> requested connection support range of generic driver have been
> upgraded.
>
> Upgrading connection support range itself was possible on generic
> driver, but could not implemented, because we need to keep compatibility
> on Device-Tree. This is one of the reason why we have many type of
> Generic Audio Card driver.
>
> ULCB/KF is good board to test these.
> Kuninori has been testing these Generic Audio Card driver by using his
> local patch to switching drivers. But it is good idea to upstream these
> from information sharing point of view, because DT setting is complex.
> It can be good sample for user. This patch is one of them.
>
> From normal user point of view who don't need to test the driver,
> it should keep as-is, nothing changed.
>
> This patch adds "Audio Graph Card" DT setting file for ULCB/KF.
> We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.
>
> Because it needs "switching driver", not "add extra feature",
> it doesn't use Device-Tree overlay.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi

> +&ak4613 {
> +       #sound-dai-cells = <0>;
> +
> +       port {
> +               /*
> +                * (A) CPU0 <-> ak4613
> +                */
> +               ak4613_endpoint: endpoint {
> +                       remote-endpoint = <&rsnd_for_ak4613>;
> +               };
> +       };
> +};
> +
> +&hdmi0 {
> +       ports {
> +               port@2 {
> +                       /*
> +                        * (B) CPU1 <-> HDMI

As this is used for playback only, "CPU1 -> HDMI"?

> +                        */
> +                       dw_hdmi0_snd_in: endpoint {
> +                               remote-endpoint = <&rsnd_for_hdmi>;
> +                       };
> +               };
> +       };
> +};
> +
> +&rcar_sound {
> +       ports {
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               rsnd_port0: port@0 {
> +                       /*
> +                        * (A) CPU0 <-> ak4613
> +                        */
> +                       reg = <0>;
> +                       rsnd_for_ak4613: endpoint {
> +                               remote-endpoint = <&ak4613_endpoint>;
> +                               bitclock-master;
> +                               frame-master;
> +                               playback = <&ssi0>, <&src0>, <&dvc0>;
> +                               capture  = <&ssi1>, <&src1>, <&dvc1>;
> +                       };
> +               };
> +               rsnd_port1: port@1 {
> +                       /*
> +                        * (B) CPU1 <-> HDMI

CPU1 -> HDMI

> +                        */
> +                       reg = <1>;
> +                       rsnd_for_hdmi: endpoint {
> +                               remote-endpoint = <&dw_hdmi0_snd_in>;
> +                               bitclock-master;
> +                               frame-master;
> +                               playback = <&ssi2>;
> +                       };
> +               };
> +       };
> +};

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi

> +&pcm3168a {
> +       ports {
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               mclk-fs = <512>;
> +               /*
> +                * (C) CPU2 <-> PCM3168A-p

CPU2 -> PCM3168A-p

> +                */
> +               port@0 {
> +                       reg = <0>;
> +                       pcm3168a_endpoint_p: endpoint {
> +                               remote-endpoint = <&rsnd_for_pcm3168a_play>;
> +                               clocks = <&clksndsel>;
> +                       };
> +               };
> +               /*
> +                * (D) CPU3 <-> PCM3168A-c

As this is used for capture only, "CPU3 <- PCM3168A-c"?

> +                */
> +               port@1 {
> +                       reg = <1>;
> +                       pcm3168a_endpoint_c: endpoint {
> +                               remote-endpoint = <&rsnd_for_pcm3168a_capture>;
> +                               clocks = <&clksndsel>;
> +                       };
> +               };
> +       };
> +};
> +
> +&rcar_sound {
> +       ports {
> +               /* rsnd_port0/1 are defined in ulcb.dtsi */
> +               /*
> +                * (C) CPU2 <-> PCM3168A-p

CPU2 -> PCM3168A-p

> +                */
> +               rsnd_port2: port@2 {
> +                       reg = <2>;
> +                       rsnd_for_pcm3168a_play: endpoint {
> +                               remote-endpoint = <&pcm3168a_endpoint_p>;
> +                               bitclock-master;
> +                               frame-master;
> +                               dai-tdm-slot-num = <8>;
> +                               playback = <&ssi3>;
> +                       };
> +               };
> +               /*
> +                * (D) CPU3 <-> PCM3168A-c

CPU3 <- PCM3168A-c

> +                */
> +               rsnd_port3: port@3 {
> +                       reg = <3>;
> +                       rsnd_for_pcm3168a_capture: endpoint {
> +                               remote-endpoint = <&pcm3168a_endpoint_c>;
> +                               bitclock-master;
> +                               frame-master;
> +                               dai-tdm-slot-num = <6>;
> +                               capture = <&ssi4>;
> +                       };
> +               };
> +       };
> +};

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

* Re: [PATCH 4/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi
  2022-12-14  1:48 ` [PATCH 4/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi Kuninori Morimoto
@ 2023-01-12 11:14   ` Geert Uytterhoeven
  0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-12 11:14 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Wed, Dec 14, 2022 at 2:48 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
> Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
> to test these.
>
> Generic Audio Card driver had been requested on ALSA SoC.
> It has many type of device connection method, and historically,
> requested connection support range of generic driver have been
> upgraded.
>
> Upgrading connection support range itself was possible on generic
> driver, but could not implemented, because we need to keep compatibility
> on Device-Tree. This is one of the reason why we have many type of
> Generic Audio Card driver.
>
> ULCB/KF is good board to test these.
> Kuninori has been testing these Generic Audio Card driver by using his
> local patch to switching drivers. But it is good idea to upstream these
> from information sharing point of view, because DT setting is complex.
> It can be good sample for user. This patch is one of them.
>
> From normal user point of view who don't need to test the driver,
> it should keep as-is, nothing changed.
>
> This patch adds "Audio Graph Card2" DT setting file for ULCB/KF,
> and switch to use it. We can switch to other Generic Audio Graph driver
> if ulcb.dtsi / ulcb-kf.dtsi were updated.
>
> Because it needs "switching driver", not "add extra feature",
> it doesn't use Device-Tree overlay.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi
> @@ -0,0 +1,26 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree for ULCB + Audio Graph Card2
> + *
> + * Copyright (C) 2022 Renesas Electronics Corp.
> + */
> +
> +/*
> + *     (A) CPU0 ------ ak4613
> + *     (B) CPU1 ------ HDMI
> + *
> + *     (A) aplay   -D plughw:0,0 xxx.wav
> + *     (B) aplay   -D plughw:0,1 xxx.wav
> + *
> + *     (A) arecord -D plughw:0,0 xxx.wav

I think you should remove the existing aplay/arecord commands from
ulcb.dtsi (and ulcb-kf.dtsi).

Gr{oetje,eeting}s,

                        Geert

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

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

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

* Re: [PATCH 5/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi
  2022-12-14  1:48 ` [PATCH 5/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi Kuninori Morimoto
@ 2023-01-12 11:18   ` Geert Uytterhoeven
  0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-12 11:18 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Wed, Dec 14, 2022 at 2:48 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
> Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
> to test these.
>
> Generic Audio Card driver had been requested on ALSA SoC.
> It has many type of device connection method, and historically,
> requested connection support range of generic driver have been
> upgraded.
>
> Upgrading connection support range itself was possible on generic
> driver, but could not implemented, because we need to keep compatibility
> on Device-Tree. This is one of the reason why we have many type of
> Generic Audio Card driver.
>
> ULCB/KF is good board to test these.
> Kuninori has been testing these Generic Audio Card driver by using his
> local patch to switching drivers. But it is good idea to upstream these
> from information sharing point of view, because DT setting is complex.
> It can be good sample for user. This patch is one of them.
>
> From normal user point of view who don't need to test the driver,
> it should keep as-is, nothing changed.
>
> This patch adds "Simle Audio Card" DT setting file for ULCB/KF.
> We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.
>
> Because it needs "switching driver", not "add extra feature",
> it doesn't use Device-Tree overlay.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi
> @@ -0,0 +1,85 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree for ULCB + Kingfisher + Simple Audio Card
> + *
> + * Copyright (C) 2022 Renesas Electronics Corp.
> + */
> +
> +/*
> + *     (A) CPU0 ------ ak4613
> + *     (B) CPU1 ------ HDMI
> + *     (C) CPU2 ------ PCM3168A-p
> + *     (D) CPU3 ------ PCM3168A-c
> + *
> + *     (A) aplay   -D plughw:0,0 xxx.wav
> + *     (B) aplay   -D plughw:0,1 xxx.wav
> + *     (C) aplay   -D plughw:0,2 xxx.wav
> + *
> + *     (A) arecord -D plughw:0,0 xxx.wav
> + *     (D) arecord -D plughw:0,3 xxx.wav
> + */
> +
> +&sound_card {
> +       /* dai-link@0/1 are defined in ulcb.dtsi */
> +
> +       /*
> +        * (C) CPU2 <-> PCM3168A-p

"->", as this is used for playback only (everywhere, in all patches).

> +&rcar_sound {
> +
> +       /* dai0-1 are defined in ulcb.dtsi */

I think this comment belongs under "rcar_sound,dai" below.

> +
> +       rcar_sound,dai {
> +               /*
> +                * (C) CPU2 <-> PCM3168A-p
> +                */
> +               dai2 {
> +                       playback = <&ssi3>;
> +               };
> +               /*
> +                * (D) CPU3 <-> PCM3168A-c
> +                */
> +               dai3 {
> +                       capture = <&ssi4>;
> +               };
> +       };
> +};

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

* Re: [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
  2022-12-14  1:48 ` [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi Kuninori Morimoto
@ 2023-01-12 11:28   ` Geert Uytterhoeven
  2023-01-12 23:30     ` Kuninori Morimoto
  0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-12 11:28 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Wed, Dec 14, 2022 at 2:48 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> ALSA SoC has many type of Generic Audio Card driver (Simple Audio Card,
> Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori Morimoto want
> to test these.
>
> Generic Audio Card driver had been requested on ALSA SoC.
> It has many type of device connection method, and historically,
> requested connection support range of generic driver have been
> upgraded.
>
> Upgrading connection support range itself was possible on generic
> driver, but could not implemented, because we need to keep compatibility
> on Device-Tree. This is one of the reason why we have many type of
> Generic Audio Card driver.
>
> ULCB/KF is good board to test these.
> Kuninori has been testing these Generic Audio Card driver by using his
> local patch to switching drivers. But it is good idea to upstream these
> from information sharing point of view, because DT setting is complex.
> It can be good sample for user. This patch is one of them.
>
> From normal user point of view who don't need to test the driver,
> it should keep as-is, nothing changed.
>
> This patch adds "Audio Graph Card2 + MIXer + TDM Split" DT setting file
> for ULCB/KF. Because it reach to subdevice maximum, it ignore HDMI.
> We can switch to use it if ulcb.dtsi / ulcb-kf.dtsi were updated.
>
> Because it needs "switching driver", not "add extra feature",
> it doesn't use Device-Tree overlay.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi
> @@ -0,0 +1,111 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree for ULCB + Audio Graph Card2 (MIX + TDM Split)
> + *
> + * Copyright (C) 2022 Renesas Electronics Corp.
> + */
> +
> +/*
> + * Note:
> + * Because there is subdevice maximum, it will ignore HDMI output
> + *
> + *     (A) CPU0 (2ch) ------ (2ch) (X) ak4613  (MIX-0)
> + *     (B) CPU1 (2ch) --/                      (MIX-1)
> + *
> + *     (A) aplay   -D plughw:0,0 xxx.wav
> + *     (B) aplay   -D plughw:0,1 xxx.wav
> + *
> + *     (A) arecord -D plughw:0,0 xxx.wav
> + */
> +/ {
> +       sound_card: sound {
> +               compatible = "audio-graph-card2";
> +               label = "rcar-sound";
> +
> +               routing = "ak4613 Playback", "DAI0 Playback",
> +               "ak4613 Playback", "DAI1 Playback",
> +               "DAI0 Capture",    "ak4613 Capture";
> +
> +               /delete-property/ dais;
> +               links = <&fe_a          /* (A) CPU0   */
> +                        &fe_b          /* (B) CPU1   */
> +                        &be_x          /* (X) ak4613 */
> +               >;
> +
> +               dpcm {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +
> +                       ports@0 {
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               reg = <0>;
> +                               /*
> +                                * FE

FE = Front End?

> +                                * (A) CPU0 (MIX-0)
> +                                * (B) CPU1 (MIX-1)
> +                                */
> +                       fe_a:   port@0 { reg = <0>; fe_a_ep: endpoint { remote-endpoint = <&rsnd_a_ep>; }; };
> +                       fe_b:   port@1 { reg = <1>; fe_b_ep: endpoint { remote-endpoint = <&rsnd_b_ep>; }; };

Please preserve alignment (i.e. insert TAB before fe_[ab] labels).

> +                       };
> +
> +                       ports@1 {
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               reg = <1>;
> +                               /*
> +                                * BE

Back End? (I guess not Big Endian ;-)

> +                                * (X) ak4613
> +                                */
> +                       be_x:   port@0 { reg = <0>; be_x_ep: endpoint { remote-endpoint = <&ak4613_x_ep>; }; };

Likewise

> +                       };
> +               };
> +       };
> +};
> +
> +&ak4613 {
> +       port {
> +               /*
> +                * (X) ak4613

Perhaps add an arrow, and a target, like in the other patches?
(everywhere)

> +                */
> +               prefix = "ak4613";
> +               convert-rate = <48000>;
> +
> +               ak4613_x_ep: endpoint {
> +                       remote-endpoint = <&be_x_ep>;
> +               };
> +       };
> +};

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
  2023-01-12 10:59       ` Geert Uytterhoeven
@ 2023-01-12 23:07         ` Kuninori Morimoto
  -1 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-12 23:07 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux-Renesas, Rob Herring, Krzysztof Kozlowski, Mark Brown,
	Liam Girdwood,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart


Hi Geert

> > It is used on "Simple Audio Card".
> > We  need <0> if the board is using SSI x 1,
> > and need <1> if the board is using SSI x N.
> > It is not mandatory if the board is using "Audio Graph Card/Card2".
> 
> So #sound-dai-cells should be in the board DTS, and never in the
> SoC .dtsi? Hence it should be moved out of
> arch/arm/boot/dts/{r8a7740,sh73a0}.dtsi and
> arch/arm64/boot/dts/renesas/r9a07g0{43,44,54}.dtsi?

Hmm, it is difficult to explain via text...

On rsnd case, how many DAIs exist is based on the board,
and its connection (= R-Car SoC).
But FSI has fixed DAIs (= SH), thus having #sound-dai-cells
on SoC is not strange (= r8a7740/sh73a0).

And I'm not sure how it works on r9a07g0xx,
it is not my drivers.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF
@ 2023-01-12 23:07         ` Kuninori Morimoto
  0 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-12 23:07 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	ALSA Development Mailing List, Laurent Pinchart, Liam Girdwood,
	Rob Herring, Linux-Renesas, Mark Brown, Krzysztof Kozlowski


Hi Geert

> > It is used on "Simple Audio Card".
> > We  need <0> if the board is using SSI x 1,
> > and need <1> if the board is using SSI x N.
> > It is not mandatory if the board is using "Audio Graph Card/Card2".
> 
> So #sound-dai-cells should be in the board DTS, and never in the
> SoC .dtsi? Hence it should be moved out of
> arch/arm/boot/dts/{r8a7740,sh73a0}.dtsi and
> arch/arm64/boot/dts/renesas/r9a07g0{43,44,54}.dtsi?

Hmm, it is difficult to explain via text...

On rsnd case, how many DAIs exist is based on the board,
and its connection (= R-Car SoC).
But FSI has fixed DAIs (= SH), thus having #sound-dai-cells
on SoC is not strange (= r8a7740/sh73a0).

And I'm not sure how it works on r9a07g0xx,
it is not my drivers.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
  2023-01-12 11:28   ` Geert Uytterhoeven
@ 2023-01-12 23:30     ` Kuninori Morimoto
  2023-01-13  9:14       ` Geert Uytterhoeven
  0 siblings, 1 reply; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-12 23:30 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


Hi Geert


> FE = Front End?
(snip)
> Back End? (I guess not Big Endian ;-)

Yes

> > +               /*
> > +                * (X) ak4613
> 
> Perhaps add an arrow, and a target, like in the other patches?
> (everywhere)

It is difficult to explain via text, but on normal connection case,
SoC <-> Codec are connected, thus the comment like
"CPU0 <-> ak4613" is correct.

But On MIX+Split case, it is using DPCM which connects
"FE" and "BE" at runtime.
So there are no connection between (FE)SoC <-> (BE)Codec
at this time. So the above comment (= no arrow) is correct.


Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
  2023-01-12 23:30     ` Kuninori Morimoto
@ 2023-01-13  9:14       ` Geert Uytterhoeven
  2023-01-15 22:52         ` Kuninori Morimoto
  0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2023-01-13  9:14 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-Renesas

Hi Morimoto-san,

On Fri, Jan 13, 2023 at 12:30 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> > > +               /*
> > > +                * (X) ak4613
> >
> > Perhaps add an arrow, and a target, like in the other patches?
> > (everywhere)
>
> It is difficult to explain via text, but on normal connection case,
> SoC <-> Codec are connected, thus the comment like
> "CPU0 <-> ak4613" is correct.
>
> But On MIX+Split case, it is using DPCM which connects
> "FE" and "BE" at runtime.
> So there are no connection between (FE)SoC <-> (BE)Codec
> at this time. So the above comment (= no arrow) is correct.

So this is software policy, not hardware description?
Does it belong in DTS?

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

* Re: [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi
  2023-01-13  9:14       ` Geert Uytterhoeven
@ 2023-01-15 22:52         ` Kuninori Morimoto
  0 siblings, 0 replies; 25+ messages in thread
From: Kuninori Morimoto @ 2023-01-15 22:52 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas


Hi Geert

> > It is difficult to explain via text, but on normal connection case,
> > SoC <-> Codec are connected, thus the comment like
> > "CPU0 <-> ak4613" is correct.
> >
> > But On MIX+Split case, it is using DPCM which connects
> > "FE" and "BE" at runtime.
> > So there are no connection between (FE)SoC <-> (BE)Codec
> > at this time. So the above comment (= no arrow) is correct.
> 
> So this is software policy, not hardware description?
> Does it belong in DTS?

I'm not sure how to answer to it.
It is the description to indicate switchable hardware connection.


Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

end of thread, other threads:[~2023-01-15 22:52 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14  1:47 [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
2022-12-14  1:48 ` [PATCH 1/8] ARM: dts: renesas: #sound-dai-cells is used when simple-card Kuninori Morimoto
2022-12-14  1:48 ` [PATCH 2/8] arm64: " Kuninori Morimoto
2022-12-14  1:48 ` [PATCH 3/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card dtsi Kuninori Morimoto
2023-01-12 11:12   ` Geert Uytterhoeven
2022-12-14  1:48 ` [PATCH 4/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi Kuninori Morimoto
2023-01-12 11:14   ` Geert Uytterhoeven
2022-12-14  1:48 ` [PATCH 5/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card dtsi Kuninori Morimoto
2023-01-12 11:18   ` Geert Uytterhoeven
2022-12-14  1:48 ` [PATCH 6/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card2 dtsi MIX + TDM Split dtsi Kuninori Morimoto
2023-01-12 11:28   ` Geert Uytterhoeven
2023-01-12 23:30     ` Kuninori Morimoto
2023-01-13  9:14       ` Geert Uytterhoeven
2023-01-15 22:52         ` Kuninori Morimoto
2022-12-14  1:48 ` [PATCH 7/8] arm64: dts: renesas: add ulcb{-kf} Audio Graph Card " Kuninori Morimoto
2022-12-14  1:48 ` [PATCH 8/8] arm64: dts: renesas: add ulcb{-kf} Simple Audio Card " Kuninori Morimoto
2023-01-10 23:46 ` [PATCH 0/8] arm64: dts: renesas: Simple-Card / Audio-Graph-Card/Card2 dts for ULCB/KF Kuninori Morimoto
2023-01-11 14:45 ` Geert Uytterhoeven
2023-01-11 14:45   ` Geert Uytterhoeven
2023-01-12  0:17   ` Kuninori Morimoto
2023-01-12  0:17     ` Kuninori Morimoto
2023-01-12 10:59     ` Geert Uytterhoeven
2023-01-12 10:59       ` Geert Uytterhoeven
2023-01-12 23:07       ` Kuninori Morimoto
2023-01-12 23:07         ` Kuninori Morimoto

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.