summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2023-01-13 02:04:17 +0000
committerGeert Uytterhoeven <geert+renesas@glider.be>2023-01-26 16:03:04 +0100
commit62661f3b076e35de5d68593a2bde54e9cefdd85e (patch)
tree0ee840543ff061c309100bd4cb4412ce3895a445
parent3e2db2c2418d5373205f7214ff1ef4e70aafefe1 (diff)
arm64: dts: renesas: Add ulcb{-kf} Simple Audio Card dtsi
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>
-rw-r--r--arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi85
-rw-r--r--arch/arm64/boot/dts/renesas/ulcb-kf.dtsi1
-rw-r--r--arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi89
-rw-r--r--arch/arm64/boot/dts/renesas/ulcb.dtsi1
4 files changed, 176 insertions, 0 deletions
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..2010e8ac7fdc
--- /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 {
+
+ rcar_sound,dai {
+ /* dai0-1 are defined in ulcb.dtsi */
+
+ /*
+ * (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 1e3628eae2b5..4b5887952da6 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -447,6 +447,7 @@
* 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..751cfd8c5257
--- /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 bc0ed53c89f4..95d9086b92fe 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -493,6 +493,7 @@
*
* 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"