1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree for ULCB + Kingfisher + Audio Graph Card (MIX + TDM Split)
4 *
5 * Copyright (C) 2022 Renesas Electronics Corp.
6 */
7
8/*
9 * Note:
10 * The HDMI output is ignored due to the limited number of subdevices
11 *
12 *	(A) CPU0 (2ch) <----> (2ch) (X) ak4613	   (MIX-0)
13 *	(B) CPU1 (2ch)  --/			   (MIX-1)
14 *	(C) CPU2 (2ch)  ----> (8ch) (Y) PCM3168A-p (TDM-0 : 0,1ch)
15 *	(D) CPU3 (2ch)  --/			   (TDM-1 : 2,3ch)
16 *	(E) CPU4 (2ch)  --/			   (TDM-2 : 4,5ch)
17 *	(F) CPU5 (2ch)  --/			   (TDM-3 : 6,7ch)
18 *	(G) CPU6 (6ch) <----  (6ch) (Z) PCM3168A-c
19 *
20 *	(A) aplay   -D plughw:0,0 xxx.wav (MIX-0)
21 *	(B) aplay   -D plughw:0,1 xxx.wav (MIX-1)
22 *	(C) aplay   -D plughw:0,2 xxx.wav (TDM-0)
23 *	(D) aplay   -D plughw:0,3 xxx.wav (TDM-1)
24 *	(E) aplay   -D plughw:0,4 xxx.wav (TDM-2)
25 *	(F) aplay   -D plughw:0,5 xxx.wav (TDM-3)
26 *
27 *	(A) arecord -D plughw:0,0 xxx.wav
28 *	(G) arecord -D plughw:0,6 xxx.wav
29 */
30
31&sound_card {
32	routing = "ak4613 Playback",   "DAI0 Playback",
33		  "ak4613 Playback",   "DAI1 Playback",
34		  "DAI0 Capture",      "ak4613 Capture",
35		  "pcm3168a Playback", "DAI2 Playback",
36		  "pcm3168a Playback", "DAI3 Playback",
37		  "pcm3168a Playback", "DAI4 Playback",
38		  "pcm3168a Playback", "DAI5 Playback";
39
40	dais = <&rsnd_port0 /* (A) CPU0 */
41		&rsnd_port1 /* (B) CPU1 */
42		&rsnd_port2 /* (C) CPU2 */
43		&rsnd_port3 /* (D) CPU3 */
44		&rsnd_port4 /* (E) CPU4 */
45		&rsnd_port5 /* (F) CPU5 */
46		&rsnd_port6 /* (G) GPU6 */
47	>;
48};
49
50&pcm3168a {
51	ports {
52		#address-cells = <1>;
53		#size-cells = <0>;
54		mclk-fs = <512>;
55
56		/*
57		 * (Y) PCM3168A-p
58		 */
59		port@0 {
60			#address-cells = <1>;
61			#size-cells = <0>;
62			reg = <0>;
63			prefix = "pcm3168a";
64			convert-channels = <8>; /* to 8ch TDM */
65
66			/* (C) CPU2 -> (Y) PCM3168A-p */
67			pcm3168a_endpoint_p1: endpoint@0 {
68				reg = <0>;
69				remote-endpoint = <&rsnd_for_pcm3168a_play1>;
70				clocks = <&clksndsel>;
71			};
72			/* (D) CPU3 -> (Y) PCM3168A-p */
73			pcm3168a_endpoint_p2: endpoint@1 {
74				reg = <1>;
75				remote-endpoint = <&rsnd_for_pcm3168a_play2>;
76				clocks = <&clksndsel>;
77			};
78			/* (E) CPU4 -> (Y) PCM3168A-p */
79			pcm3168a_endpoint_p3: endpoint@2 {
80				reg = <2>;
81				remote-endpoint = <&rsnd_for_pcm3168a_play3>;
82				clocks = <&clksndsel>;
83			};
84			/* (F) CPU5 -> (Y) PCM3168A-p */
85			pcm3168a_endpoint_p4: endpoint@3 {
86				reg = <3>;
87				remote-endpoint = <&rsnd_for_pcm3168a_play4>;
88				clocks = <&clksndsel>;
89			};
90		};
91		/*
92		 * (Z) PCM3168A-c
93		 */
94		port@1 {
95			reg = <1>;
96			/* (G) CPU6 <- PCM3168A-c */
97			pcm3168a_endpoint_c: endpoint {
98				remote-endpoint = <&rsnd_for_pcm3168a_capture>;
99				clocks = <&clksndsel>;
100			};
101		};
102	};
103};
104
105&rcar_sound {
106	ports {
107		/* rsnd_port0-1 are defined in ulcb.dtsi */
108
109		/*
110		 * (C) CPU2
111		 */
112		rsnd_port2: port@2 {
113			reg = <2>;
114			rsnd_for_pcm3168a_play1: endpoint {
115				remote-endpoint = <&pcm3168a_endpoint_p1>;
116				bitclock-master;
117				frame-master;
118				playback = <&ssiu30 &ssi3>;
119			};
120		};
121		/*
122		 * (D) CPU3
123		 */
124		rsnd_port3: port@3 {
125			reg = <3>;
126			rsnd_for_pcm3168a_play2: endpoint {
127				remote-endpoint = <&pcm3168a_endpoint_p2>;
128				bitclock-master;
129				frame-master;
130				playback = <&ssiu31 &ssi3>;
131			};
132		};
133		/*
134		 * (E) CPU4
135		 */
136		rsnd_port4: port@4 {
137			reg = <4>;
138			rsnd_for_pcm3168a_play3: endpoint {
139				remote-endpoint = <&pcm3168a_endpoint_p3>;
140				bitclock-master;
141				frame-master;
142				playback = <&ssiu32 &ssi3>;
143			};
144		};
145		/*
146		 * (F) CPU5
147		 */
148		rsnd_port5: port@5 {
149			reg = <5>;
150			rsnd_for_pcm3168a_play4: endpoint {
151				remote-endpoint = <&pcm3168a_endpoint_p4>;
152				bitclock-master;
153				frame-master;
154				playback = <&ssiu33 &ssi3>;
155			};
156		};
157		/*
158		 * (G) CPU6
159		 */
160		rsnd_port6: port@6 {
161			reg = <6>;
162			rsnd_for_pcm3168a_capture: endpoint {
163				remote-endpoint = <&pcm3168a_endpoint_c>;
164				bitclock-master;
165				frame-master;
166				dai-tdm-slot-num = <6>;
167				capture  = <&ssi4>;
168			};
169		};
170	};
171};
172