arm64: dts: renesas: Add ulcb{-kf} Simple Audio Card MIX + TDM Split dtsi
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 13 Jan 2023 02:04:33 +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 + MIXer + TDM Split" DT setting file for
ULCB/KF.  Because of the limited number of subdevices, the HDMI output
is ignored.
This setting 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/874jsvi40e.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-mix+split.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.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-mix+split.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi
new file mode 100644 (file)
index 0000000..bc221f9
--- /dev/null
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Kingfisher + Simple Audio Card (MIX + TDM Split)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Note:
+ * The HDMI output is ignored due to the limited number of subdevices
+ *
+ *     (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 {
+
+       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 */
+
+       simple-audio-card,dai-link@1 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <1>;
+               convert-channels = <8>; /* to 8ch TDM */
+
+               /*
+                * (C) CPU2
+                */
+               cpu@0 {
+                       reg = <0>;
+                       bitclock-master;
+                       frame-master;
+                       sound-dai = <&rcar_sound 2>;
+               };
+               /*
+                * (D) CPU3
+                */
+               cpu@1 {
+                       reg = <1>;
+                       sound-dai = <&rcar_sound 3>;
+               };
+               /*
+                * (E) CPU4
+                */
+               cpu@2 {
+                       reg = <2>;
+                       sound-dai = <&rcar_sound 4>;
+               };
+               /*
+                * (F) CPU5
+                */
+               cpu@3 {
+                       reg = <3>;
+                       sound-dai = <&rcar_sound 5>;
+               };
+               /*
+                * (Y) PCM3168A-p
+                */
+               codec {
+                       prefix = "pcm3168a";
+                       mclk-fs = <512>;
+                       sound-dai = <&pcm3168a 0>;
+               };
+       };
+       simple-audio-card,dai-link@2 {
+               reg = <2>;
+               /*
+                * (G) CPU6
+                */
+               cpu {
+                       bitclock-master;
+                       frame-master;
+                       sound-dai = <&rcar_sound 6>;
+               };
+               /*
+                * (Z) PCM3168A-c
+                */
+               codec {
+                       prefix = "pcm3168a";
+                       mclk-fs = <512>;
+                       sound-dai = <&pcm3168a 1>;
+               };
+       };
+};
+
+&pcm3168a {
+       /*
+        * (Y) PCM3168A-p
+        * (Z) PCM3168A-c
+        */
+       #sound-dai-cells = <1>;
+};
+
+&rcar_sound {
+       rcar_sound,dai {
+
+               /* dai0-1 are defined in ulcb.dtsi */
+
+               /*
+                * (C) CPU2
+                */
+               dai2 {
+                       playback = <&ssiu30 &ssi3>;
+               };
+               /*
+                * (D) CPU3
+                */
+               dai3 {
+                       playback = <&ssiu31 &ssi3>;
+               };
+               /*
+                * (E) CPU4
+                */
+               dai4 {
+                       playback = <&ssiu32 &ssi3>;
+               };
+               /*
+                * (F) CPU5
+                */
+               dai5 {
+                       playback = <&ssiu33 &ssi3>;
+               };
+               /*
+                * (G) CPU6
+                */
+               dai6 {
+                       capture = <&ssi4>;
+               };
+       };
+};
index 0735769df89f8fa72df8b35b78ab43befbd251ae..efc80960380f4ca523f9a6265b7a1516394ad0f7 100644 (file)
  * 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 (file)
index 0000000..217d890
--- /dev/null
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree for ULCB + Simple Audio Card (MIXer)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+/*
+ * Note:
+ * The HDMI output is ignored due to the limited number of subdevices
+ *
+ *     (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 {
+               #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
+                        */
+                       cpu@0 {
+                               reg = <0>;
+                               bitclock-master;
+                               frame-master;
+                               sound-dai = <&rcar_sound 0>;
+                       };
+                       /*
+                        * (B) CPU1
+                        */
+                       cpu@1 {
+                               reg = <1>;
+                               sound-dai = <&rcar_sound 1>;
+                       };
+                       /*
+                        * (X) ak4613
+                        */
+                       codec {
+                               prefix = "ak4613";
+                               sound-dai = <&ak4613>;
+                       };
+               };
+       };
+};
+
+&ak4613 {
+       /*
+        * (X) ak4613
+        */
+       #sound-dai-cells = <0>;
+};
+
+&rcar_sound {
+       #sound-dai-cells = <1>;
+
+       rcar_sound,dai {
+               /*
+                * (A) CPU0
+                */
+               dai0 {
+                       playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
+                       capture  = <&ssi1 &src0 &dvc1>;
+               };
+               /*
+                * (B) CPU1
+                */
+               dai1 {
+                       playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
+               };
+       };
+};
index 172d065d70bb792f21b6b70aca67755d5a272630..d693e879b33061231dad649a2111d671dd9f99dc 100644 (file)
        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"