linux/arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi

// SPDX-License-Identifier: GPL-2.0
/*
 * Device Tree for ULCB + Kingfisher + Audio Graph 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) CPU2 (2ch)  ----> (8ch) (Y) PCM3168A-p (TDM-0 : 0,1ch)
 *	(D) CPU3 (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:1,0 xxx.wav (TDM-0)
 *	(D) aplay   -D plughw:1,1 xxx.wav (TDM-1)
 *	(E) aplay   -D plughw:1,2 xxx.wav (TDM-2)
 *	(F) aplay   -D plughw:1,3 xxx.wav (TDM-3)
 *
 *	(A) arecord -D plughw:0,0 xxx.wav
 *	(G) arecord -D plughw:1,4 xxx.wav
 */
/ {
	sound_card_kf: expand-sound {
		compatible = "audio-graph-scu-card";
		label = "snd-kf-split";

		routing = "pcm3168a Playback", "DAI2 Playback",
			  "pcm3168a Playback", "DAI3 Playback",
			  "pcm3168a Playback", "DAI4 Playback",
			  "pcm3168a Playback", "DAI5 Playback";

		dais = <&snd_kf1 /* (C) CPU2 */
			&snd_kf2 /* (D) CPU3 */
			&snd_kf3 /* (E) CPU4 */
			&snd_kf4 /* (F) CPU5 */
			&snd_kf5 /* (G) GPU6 */
		>;
	};
};

&pcm3168a {
	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		mclk-fs = <512>;

		/*
		 * (Y) PCM3168A-p
		 */
		port@0 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;
			prefix = "pcm3168a";
			convert-channels = <8>; /* to 8ch TDM */

			/* (C) CPU2 -> (Y) PCM3168A-p */
			pcm3168a_endpoint_p1: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&rsnd_for_pcm3168a_play1>;
				clocks = <&clksndsel>;
			};
			/* (D) CPU3 -> (Y) PCM3168A-p */
			pcm3168a_endpoint_p2: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&rsnd_for_pcm3168a_play2>;
				clocks = <&clksndsel>;
			};
			/* (E) CPU4 -> (Y) PCM3168A-p */
			pcm3168a_endpoint_p3: endpoint@2 {
				reg = <2>;
				remote-endpoint = <&rsnd_for_pcm3168a_play3>;
				clocks = <&clksndsel>;
			};
			/* (F) CPU5 -> (Y) PCM3168A-p */
			pcm3168a_endpoint_p4: endpoint@3 {
				reg = <3>;
				remote-endpoint = <&rsnd_for_pcm3168a_play4>;
				clocks = <&clksndsel>;
			};
		};
		/*
		 * (Z) PCM3168A-c
		 */
		port@1 {
			reg = <1>;
			/* (G) CPU6 <- PCM3168A-c */
			pcm3168a_endpoint_c: endpoint {
				remote-endpoint = <&rsnd_for_pcm3168a_capture>;
				clocks = <&clksndsel>;
			};
		};
	};
};

&rcar_sound {
	ports@1 {
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <1>;

		/*
		 * (C) CPU2
		 */
		snd_kf1: port@2 {
			reg = <2>;
			rsnd_for_pcm3168a_play1: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p1>;
				bitclock-master;
				frame-master;
				playback = <&ssiu30 &ssi3>;
			};
		};
		/*
		 * (D) CPU3
		 */
		snd_kf2: port@3 {
			reg = <3>;
			rsnd_for_pcm3168a_play2: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p2>;
				bitclock-master;
				frame-master;
				playback = <&ssiu31 &ssi3>;
			};
		};
		/*
		 * (E) CPU4
		 */
		snd_kf3: port@4 {
			reg = <4>;
			rsnd_for_pcm3168a_play3: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p3>;
				bitclock-master;
				frame-master;
				playback = <&ssiu32 &ssi3>;
			};
		};
		/*
		 * (F) CPU5
		 */
		snd_kf4: port@5 {
			reg = <5>;
			rsnd_for_pcm3168a_play4: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p4>;
				bitclock-master;
				frame-master;
				playback = <&ssiu33 &ssi3>;
			};
		};
		/*
		 * (G) CPU6
		 */
		snd_kf5: port@6 {
			reg = <6>;
			rsnd_for_pcm3168a_capture: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_c>;
				bitclock-master;
				frame-master;
				dai-tdm-slot-num = <6>;
				capture  = <&ssi4>;
			};
		};
	};
};