1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree for ULCB + Kingfisher + Simple Audio 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) CPU3 (2ch)  ----> (8ch) (Y)	PCM3168A-p (TDM-0 : 0,1ch)
15 *	(D) CPU2 (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
33	simple-audio-card,routing = "ak4613 Playback",   "DAI0 Playback",
34				    "ak4613 Playback",   "DAI1 Playback",
35				    "DAI0 Capture",      "ak4613 Capture",
36				    "pcm3168a Playback", "DAI2 Playback",
37				    "pcm3168a Playback", "DAI3 Playback",
38				    "pcm3168a Playback", "DAI4 Playback",
39				    "pcm3168a Playback", "DAI5 Playback";
40
41	/* dai-link@0 is defined in ulcb.dtsi */
42
43	simple-audio-card,dai-link@1 {
44		#address-cells = <1>;
45		#size-cells = <0>;
46		reg = <1>;
47		convert-channels = <8>; /* to 8ch TDM */
48
49		/*
50		 * (C) CPU2
51		 */
52		cpu@0 {
53			reg = <0>;
54			bitclock-master;
55			frame-master;
56			sound-dai = <&rcar_sound 2>;
57		};
58		/*
59		 * (D) CPU3
60		 */
61		cpu@1 {
62			reg = <1>;
63			sound-dai = <&rcar_sound 3>;
64		};
65		/*
66		 * (E) CPU4
67		 */
68		cpu@2 {
69			reg = <2>;
70			sound-dai = <&rcar_sound 4>;
71		};
72		/*
73		 * (F) CPU5
74		 */
75		cpu@3 {
76			reg = <3>;
77			sound-dai = <&rcar_sound 5>;
78		};
79		/*
80		 * (Y) PCM3168A-p
81		 */
82		codec {
83			prefix = "pcm3168a";
84			mclk-fs = <512>;
85			sound-dai = <&pcm3168a 0>;
86		};
87	};
88	simple-audio-card,dai-link@2 {
89		reg = <2>;
90		/*
91		 * (G) CPU6
92		 */
93		cpu {
94			bitclock-master;
95			frame-master;
96			sound-dai = <&rcar_sound 6>;
97		};
98		/*
99		 * (Z) PCM3168A-c
100		 */
101		codec {
102			prefix = "pcm3168a";
103			mclk-fs = <512>;
104			sound-dai = <&pcm3168a 1>;
105		};
106	};
107};
108
109&pcm3168a {
110	/*
111	 * (Y) PCM3168A-p
112	 * (Z) PCM3168A-c
113	 */
114	#sound-dai-cells = <1>;
115};
116
117&rcar_sound {
118	rcar_sound,dai {
119
120		/* dai0-1 are defined in ulcb.dtsi */
121
122		/*
123		 * (C) CPU2
124		 */
125		dai2 {
126			playback = <&ssiu30 &ssi3>;
127		};
128		/*
129		 * (D) CPU3
130		 */
131		dai3 {
132			playback = <&ssiu31 &ssi3>;
133		};
134		/*
135		 * (E) CPU4
136		 */
137		dai4 {
138			playback = <&ssiu32 &ssi3>;
139		};
140		/*
141		 * (F) CPU5
142		 */
143		dai5 {
144			playback = <&ssiu33 &ssi3>;
145		};
146		/*
147		 * (G) CPU6
148		 */
149		dai6 {
150			capture = <&ssi4>;
151		};
152	};
153};
154