arm64: dts: renesas: Add ulcb{-kf} Audio Graph Card2 dtsi
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 13 Jan 2023 02:04:13 +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 an "Audio Graph Card2" DT setting file for ULCB/KF,
and switch to use it.  You can switch to a different Generic Audio Graph
driver 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/87a62ni40z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
arch/arm64/boot/dts/renesas/ulcb.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 (file)
index 0000000..5ebec12
--- /dev/null
@@ -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) CPU0 <-> ak4613 */
+                &rsnd_port1    /* (B) CPU1  -> HDMI   */
+               >;
+};
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 (file)
index 0000000..c30e056
--- /dev/null
@@ -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) CPU0 <-> ak4613 */
+                &rsnd_port1    /* (B) CPU1  -> HDMI   */
+                &rsnd_port2    /* (C) CPU2  -> PCM3168A-p */
+                &rsnd_port3    /* (D) CPU3 <-  PCM3168A-c */
+               >;
+};
index 3b27ec7f45d67e8dcc409300f3d8f5e306b84756..1e3628eae2b5116505f03c230bb444ebfdd77cf1 100644 (file)
@@ -6,12 +6,6 @@
  * Copyright (C) 2017 Cogent Embedded, Inc.
  */
 
-/*
- * SSI-PCM3168A
- *     aplay   -D plughw:0,2 xxx.wav
- *     arecord -D plughw:0,3 xxx.wav
- */
-
 / {
        aliases {
                serial1 = &hscif0;
                                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 {
        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 {
        };
 };
 
-&sound_card {
-       links = <&rsnd_port0    /* ak4613 */
-                &rsnd_port1    /* HDMI0  */
-                &rsnd_port2    /* pcm3168a playback */
-                &rsnd_port3    /* pcm3168a capture  */
-               >;
-};
-
 &ssi4 {
        shared-pin;
 };
 &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"
index 4b6562fc1bdfbe43d87e1191a486adadd518c27a..bc0ed53c89f4d5d6b4607e91ef7ae845907defc2 100644 (file)
@@ -6,14 +6,6 @@
  * Copyright (C) 2016 Cogent Embedded, Inc.
  */
 
-/*
- * SSI-AK4613
- *     aplay   -D plughw:0,0 xxx.wav
- *     arecord -D plughw:0,0 xxx.wav
- * SSI-HDMI
- *     aplay   -D plughw:0,1 xxx.wav
- */
-
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
                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";
 
                };
                port@2 {
                        reg = <2>;
-                       dw_hdmi0_snd_in: endpoint {
-                               remote-endpoint = <&rsnd_for_hdmi>;
-                       };
                };
        };
 };
 
        ak4613: codec@10 {
                compatible = "asahi-kasei,ak4613";
-               #sound-dai-cells = <0>;
                reg = <0x10>;
                clocks = <&rcar_sound 3>;
 
                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 {
                 <&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 {
 
        status = "okay";
 };
+
+/*
+ * For sound-test.
+ *
+ * We can switch Audio Card for testing
+ *
+ * #include "ulcb-audio-graph-card.dtsi"
+ */
+#include "ulcb-audio-graph-card2.dtsi"