arm64: dts: renesas: Add ulcb{-kf} Simple Audio Card dtsi
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 13 Jan 2023 02:04:17 +0000 (02:04 +0000)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 26 Jan 2023 15:03:04 +0000 (16:03 +0100)
ALSA SoC has many types of Generic Audio Card drivers (Simple Audio
Card, Audio Graph Card, Audio Graph Card2), and Renesas/Kuninori
Morimoto wants to test these.

The Generic Audio Card driver had been requested on ALSA SoC.
It supports many types of device connection methods, and historically,
the requested connection support range of the generic driver has been
upgraded.

Upgrading the connection support range itself could not be implemented
in the generic driver, because we need to keep compatibility with old
DTBs. This is one of the reasons why we have many types of Generic Audio
Card driver.

The ULCB/KF combo is a good board stack to test these.
Kuninori has been testing these Generic Audio Card drivers by using his
local patches to switching drivers.  But from an information sharing
point of view, it is a good idea to upstream these, because the DT
configuration is complex.  Hence this can be a good sample for the user.

Hence add a "Simple Audio Card" DT setting file for ULCB/KF.
This can be enabled by updating ulcb.dtsi / ulcb-kf.dtsi.

From a normal user point of view who doesn't need to test the driver,
everything should stay as-is, and nothing changes.

Note that because this needs "switching driver", and not "adding extra
feature", this does not use a Device Tree overlay.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/878ri7i40u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/ulcb.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 (file)
index 0000000..2010e8a
--- /dev/null
@@ -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 {
+
+       rcar_sound,dai {
+               /* dai0-1 are defined in ulcb.dtsi */
+
+               /*
+                * (C) CPU2 -> PCM3168A-p
+                */
+               dai2 {
+                       playback = <&ssi3>;
+               };
+               /*
+                * (D) CPU3 <- PCM3168A-c
+                */
+               dai3 {
+                       capture = <&ssi4>;
+               };
+       };
+};
index 1e3628eae2b5116505f03c230bb444ebfdd77cf1..4b5887952da6acfa1385384ca92f4967899499e2 100644 (file)
  * 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 (file)
index 0000000..751cfd8
--- /dev/null
@@ -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>;
+               };
+       };
+};
index bc0ed53c89f4d5d6b4607e91ef7ae845907defc2..95d9086b92fef71d9281303c6cf6315e1a6eb207 100644 (file)
  *
  * 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"