From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx> 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@xxxxxxxxxxx> --- .../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