blob: f32bcb2b2e094c0c82127d982ed9951b22be00d4 [file] [log] [blame]
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +02001// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * soc-apci-intel-adl-match.c - tables and support for ADL ACPI enumeration.
4 *
5 * Copyright (c) 2020, Intel Corporation.
6 */
7
8#include <sound/soc-acpi.h>
9#include <sound/soc-acpi-intel-match.h>
10
11static const struct snd_soc_acpi_endpoint single_endpoint = {
12 .num = 0,
13 .aggregated = 0,
14 .group_position = 0,
15 .group_id = 0,
16};
17
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050018static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
19 .num = 0,
20 .aggregated = 1,
21 .group_position = 0,
22 .group_id = 1,
23};
24
25static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
26 .num = 0,
27 .aggregated = 1,
28 .group_position = 1,
29 .group_id = 1,
30};
31
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +020032static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
33 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050034 .adr = 0x000020025D071100ull,
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +020035 .num_endpoints = 1,
36 .endpoints = &single_endpoint,
37 .name_prefix = "rt711"
38 }
39};
40
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050041static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
42 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050043 .adr = 0x000120025D130800ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050044 .num_endpoints = 1,
45 .endpoints = &spk_l_endpoint,
46 .name_prefix = "rt1308-1"
47 }
48};
49
50static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
51 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050052 .adr = 0x000220025D130800ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050053 .num_endpoints = 1,
54 .endpoints = &spk_r_endpoint,
55 .name_prefix = "rt1308-2"
56 }
57};
58
59static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
60 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050061 .adr = 0x000320025D071500ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050062 .num_endpoints = 1,
63 .endpoints = &single_endpoint,
64 .name_prefix = "rt715"
65 }
66};
67
68static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
69 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050070 .adr = 0x000030025D071101ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050071 .num_endpoints = 1,
72 .endpoints = &single_endpoint,
73 .name_prefix = "rt711"
74 }
75};
76
Gongjun Song359ace22021-11-05 10:26:45 +080077static const struct snd_soc_acpi_adr_device rt711_sdca_2_adr[] = {
78 {
79 .adr = 0x000230025D071101ull,
80 .num_endpoints = 1,
81 .endpoints = &single_endpoint,
82 .name_prefix = "rt711"
83 }
84};
85
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050086static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {
87 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050088 .adr = 0x000131025D131601ull, /* unique ID is set for some reason */
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050089 .num_endpoints = 1,
90 .endpoints = &spk_l_endpoint,
91 .name_prefix = "rt1316-1"
92 }
93};
94
95static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
96 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -050097 .adr = 0x000230025D131601ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -050098 .num_endpoints = 1,
99 .endpoints = &spk_r_endpoint,
100 .name_prefix = "rt1316-2"
101 }
102};
103
104static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
105 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -0500106 .adr = 0x000330025D131601ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -0500107 .num_endpoints = 1,
108 .endpoints = &spk_r_endpoint,
109 .name_prefix = "rt1316-2"
110 }
111};
112
Gongjun Song359ace22021-11-05 10:26:45 +0800113static const struct snd_soc_acpi_adr_device rt1316_0_group2_adr[] = {
114 {
115 .adr = 0x000031025D131601ull,
116 .num_endpoints = 1,
117 .endpoints = &spk_l_endpoint,
118 .name_prefix = "rt1316-1"
119 }
120};
121
122static const struct snd_soc_acpi_adr_device rt1316_1_group2_adr[] = {
123 {
124 .adr = 0x000130025D131601ull,
125 .num_endpoints = 1,
126 .endpoints = &spk_r_endpoint,
127 .name_prefix = "rt1316-2"
128 }
129};
130
Pierre-Louis Bossart870dc422021-04-15 12:50:06 -0500131static const struct snd_soc_acpi_adr_device rt1316_2_single_adr[] = {
132 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -0500133 .adr = 0x000230025D131601ull,
Pierre-Louis Bossart870dc422021-04-15 12:50:06 -0500134 .num_endpoints = 1,
135 .endpoints = &single_endpoint,
136 .name_prefix = "rt1316-1"
137 }
138};
139
140static const struct snd_soc_acpi_adr_device rt714_0_adr[] = {
141 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -0500142 .adr = 0x000030025D071401ull,
Pierre-Louis Bossart870dc422021-04-15 12:50:06 -0500143 .num_endpoints = 1,
144 .endpoints = &single_endpoint,
145 .name_prefix = "rt714"
146 }
147};
148
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -0500149static const struct snd_soc_acpi_adr_device rt714_2_adr[] = {
150 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -0500151 .adr = 0x000230025D071401ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -0500152 .num_endpoints = 1,
153 .endpoints = &single_endpoint,
154 .name_prefix = "rt714"
155 }
156};
157
158static const struct snd_soc_acpi_adr_device rt714_3_adr[] = {
159 {
Pierre-Louis Bossart0c52d3e2021-06-21 14:40:55 -0500160 .adr = 0x000330025D071401ull,
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -0500161 .num_endpoints = 1,
162 .endpoints = &single_endpoint,
163 .name_prefix = "rt714"
164 }
165};
166
167static const struct snd_soc_acpi_link_adr adl_default[] = {
168 {
169 .mask = BIT(0),
170 .num_adr = ARRAY_SIZE(rt711_0_adr),
171 .adr_d = rt711_0_adr,
172 },
173 {
174 .mask = BIT(1),
175 .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
176 .adr_d = rt1308_1_group1_adr,
177 },
178 {
179 .mask = BIT(2),
180 .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
181 .adr_d = rt1308_2_group1_adr,
182 },
183 {
184 .mask = BIT(3),
185 .num_adr = ARRAY_SIZE(rt715_3_adr),
186 .adr_d = rt715_3_adr,
187 },
188 {}
189};
190
191static const struct snd_soc_acpi_link_adr adl_sdca_default[] = {
192 {
193 .mask = BIT(0),
194 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
195 .adr_d = rt711_sdca_0_adr,
196 },
197 {
198 .mask = BIT(1),
199 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
200 .adr_d = rt1316_1_group1_adr,
201 },
202 {
203 .mask = BIT(2),
204 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
205 .adr_d = rt1316_2_group1_adr,
206 },
207 {
208 .mask = BIT(3),
209 .num_adr = ARRAY_SIZE(rt714_3_adr),
210 .adr_d = rt714_3_adr,
211 },
212 {}
213};
214
215static const struct snd_soc_acpi_link_adr adl_sdca_3_in_1[] = {
216 {
217 .mask = BIT(0),
218 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
219 .adr_d = rt711_sdca_0_adr,
220 },
221 {
222 .mask = BIT(1),
223 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
224 .adr_d = rt1316_1_group1_adr,
225 },
226 {
227 .mask = BIT(2),
228 .num_adr = ARRAY_SIZE(rt714_2_adr),
229 .adr_d = rt714_2_adr,
230 },
231 {
232 .mask = BIT(3),
233 .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
234 .adr_d = rt1316_3_group1_adr,
235 },
236 {}
237};
238
Gongjun Song359ace22021-11-05 10:26:45 +0800239static const struct snd_soc_acpi_link_adr adl_sdw_rt711_link2_rt1316_link01_rt714_link3[] = {
240 {
241 .mask = BIT(2),
242 .num_adr = ARRAY_SIZE(rt711_sdca_2_adr),
243 .adr_d = rt711_sdca_2_adr,
244 },
245 {
246 .mask = BIT(0),
247 .num_adr = ARRAY_SIZE(rt1316_0_group2_adr),
248 .adr_d = rt1316_0_group2_adr,
249 },
250 {
251 .mask = BIT(1),
252 .num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
253 .adr_d = rt1316_1_group2_adr,
254 },
255 {
256 .mask = BIT(3),
257 .num_adr = ARRAY_SIZE(rt714_3_adr),
258 .adr_d = rt714_3_adr,
259 },
260 {}
261};
262
Gongjun Songa1797d62021-11-05 10:26:39 +0800263static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link12_rt714_link0[] = {
264 {
265 .mask = BIT(1),
266 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
267 .adr_d = rt1316_1_group1_adr,
268 },
269 {
270 .mask = BIT(2),
271 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
272 .adr_d = rt1316_2_group1_adr,
273 },
274 {
275 .mask = BIT(0),
276 .num_adr = ARRAY_SIZE(rt714_0_adr),
277 .adr_d = rt714_0_adr,
278 },
279 {}
280};
281
Gongjun Song11e18f52021-11-05 10:26:43 +0800282static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link2_rt714_link3[] = {
283 {
284 .mask = BIT(2),
285 .num_adr = ARRAY_SIZE(rt1316_2_single_adr),
286 .adr_d = rt1316_2_single_adr,
287 },
288 {
289 .mask = BIT(3),
290 .num_adr = ARRAY_SIZE(rt714_3_adr),
291 .adr_d = rt714_3_adr,
292 },
293 {}
294};
295
Pierre-Louis Bossart870dc422021-04-15 12:50:06 -0500296static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link2_rt714_link0[] = {
297 {
298 .mask = BIT(2),
299 .num_adr = ARRAY_SIZE(rt1316_2_single_adr),
300 .adr_d = rt1316_2_single_adr,
301 },
302 {
303 .mask = BIT(0),
304 .num_adr = ARRAY_SIZE(rt714_0_adr),
305 .adr_d = rt714_0_adr,
306 },
307 {}
308};
309
Vamshi Krishna Gopalc0fbe9f2021-05-21 18:56:31 +0300310static const struct snd_soc_acpi_adr_device mx8373_2_adr[] = {
311 {
312 .adr = 0x000223019F837300ull,
313 .num_endpoints = 1,
314 .endpoints = &spk_l_endpoint,
315 .name_prefix = "Left"
316 },
317 {
318 .adr = 0x000227019F837300ull,
319 .num_endpoints = 1,
320 .endpoints = &spk_r_endpoint,
321 .name_prefix = "Right"
322 }
323};
324
325static const struct snd_soc_acpi_adr_device rt5682_0_adr[] = {
326 {
327 .adr = 0x000021025D568200ull,
328 .num_endpoints = 1,
329 .endpoints = &single_endpoint,
330 .name_prefix = "rt5682"
331 }
332};
333
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +0200334static const struct snd_soc_acpi_link_adr adl_rvp[] = {
335 {
336 .mask = BIT(0),
337 .num_adr = ARRAY_SIZE(rt711_0_adr),
338 .adr_d = rt711_0_adr,
339 },
340 {}
341};
342
Vamshi Krishna Gopalc0fbe9f2021-05-21 18:56:31 +0300343static const struct snd_soc_acpi_link_adr adl_chromebook_base[] = {
344 {
345 .mask = BIT(0),
346 .num_adr = ARRAY_SIZE(rt5682_0_adr),
347 .adr_d = rt5682_0_adr,
348 },
349 {
350 .mask = BIT(2),
351 .num_adr = ARRAY_SIZE(mx8373_2_adr),
352 .adr_d = mx8373_2_adr,
353 },
354 {}
355};
356
Vamshi Krishna Gopal2a29ff72021-05-05 11:36:54 -0500357static const struct snd_soc_acpi_codecs adl_max98373_amp = {
358 .num_codecs = 1,
359 .codecs = {"MX98373"}
360};
361
362static const struct snd_soc_acpi_codecs adl_max98357a_amp = {
363 .num_codecs = 1,
364 .codecs = {"MX98357A"}
365};
366
Malik_Hsu9c892542021-10-01 23:03:16 +0800367static const struct snd_soc_acpi_codecs adl_max98360a_amp = {
368 .num_codecs = 1,
369 .codecs = {"MX98360A"}
370};
371
Brent Lud4f3fdc2021-10-30 01:14:06 +0800372static const struct snd_soc_acpi_codecs adl_rt5682_rt5682s_hp = {
373 .num_codecs = 2,
374 .codecs = {"10EC5682", "RTL5682"},
375};
376
Mac Chiang8d0872f2021-11-09 08:38:08 -0500377static const struct snd_soc_acpi_codecs adl_rt1019p_amp = {
378 .num_codecs = 1,
379 .codecs = {"RTL1019"}
380};
381
Mac Chiangf316c9d2021-11-24 22:04:53 -0500382static const struct snd_soc_acpi_codecs adl_max98390_amp = {
383 .num_codecs = 1,
384 .codecs = {"MX98390"}
385};
386
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +0200387struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
Vamshi Krishna Gopal2a29ff72021-05-05 11:36:54 -0500388 {
Brent Lud4f3fdc2021-10-30 01:14:06 +0800389 .comp_ids = &adl_rt5682_rt5682s_hp,
Pierre-Louis Bossart590cfb02021-06-21 14:40:50 -0500390 .drv_name = "adl_mx98373_rt5682",
Vamshi Krishna Gopal2a29ff72021-05-05 11:36:54 -0500391 .machine_quirk = snd_soc_acpi_codec_list,
392 .quirk_data = &adl_max98373_amp,
393 .sof_fw_filename = "sof-adl.ri",
394 .sof_tplg_filename = "sof-adl-max98373-rt5682.tplg",
395 },
396 {
Brent Lud4f3fdc2021-10-30 01:14:06 +0800397 .comp_ids = &adl_rt5682_rt5682s_hp,
Brent Lu3c561a02021-09-27 22:32:49 +0800398 .drv_name = "adl_mx98357_rt5682",
Vamshi Krishna Gopal2a29ff72021-05-05 11:36:54 -0500399 .machine_quirk = snd_soc_acpi_codec_list,
400 .quirk_data = &adl_max98357a_amp,
401 .sof_fw_filename = "sof-adl.ri",
402 .sof_tplg_filename = "sof-adl-max98357a-rt5682.tplg",
403 },
Malik_Hsu9c892542021-10-01 23:03:16 +0800404 {
Brent Lud4f3fdc2021-10-30 01:14:06 +0800405 .comp_ids = &adl_rt5682_rt5682s_hp,
Malik_Hsu9c892542021-10-01 23:03:16 +0800406 .drv_name = "adl_mx98360_rt5682",
407 .machine_quirk = snd_soc_acpi_codec_list,
408 .quirk_data = &adl_max98360a_amp,
409 .sof_fw_filename = "sof-adl.ri",
410 .sof_tplg_filename = "sof-adl-max98360a-rt5682.tplg",
411 },
Mac Chiang8d0872f2021-11-09 08:38:08 -0500412 {
413 .id = "10508825",
414 .drv_name = "adl_rt1019p_nau8825",
415 .machine_quirk = snd_soc_acpi_codec_list,
416 .quirk_data = &adl_rt1019p_amp,
417 .sof_fw_filename = "sof-adl.ri",
418 .sof_tplg_filename = "sof-adl-rt1019-nau8825.tplg",
419 },
420 {
421 .id = "10508825",
422 .drv_name = "adl_max98373_nau8825",
423 .machine_quirk = snd_soc_acpi_codec_list,
424 .quirk_data = &adl_max98373_amp,
425 .sof_fw_filename = "sof-adl.ri",
426 .sof_tplg_filename = "sof-adl-max98373-nau8825.tplg",
427 },
428 {
429 .id = "10508825",
430 .drv_name = "adl_mx98360a_nau8825",
431 .machine_quirk = snd_soc_acpi_codec_list,
432 .quirk_data = &adl_max98360a_amp,
433 .sof_fw_filename = "sof-adl.ri",
434 .sof_tplg_filename = "sof-adl-mx98360a-nau8825.tplg",
435 },
436 {
437 .id = "10508825",
438 .drv_name = "sof_nau8825",
439 .sof_fw_filename = "sof-adl.ri",
440 .sof_tplg_filename = "sof-adl-nau8825.tplg",
441 },
Mac Chiangf316c9d2021-11-24 22:04:53 -0500442 {
443 .comp_ids = &adl_rt5682_rt5682s_hp,
444 .drv_name = "adl_max98390_rt5682",
445 .machine_quirk = snd_soc_acpi_codec_list,
446 .quirk_data = &adl_max98390_amp,
447 .sof_fw_filename = "sof-adl.ri",
448 .sof_tplg_filename = "sof-adl-max98390-rt5682.tplg",
449 },
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +0200450 {},
451};
452EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_machines);
453
454/* this table is used when there is no I2S codec present */
455struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[] = {
456 {
Pierre-Louis Bossart093b9dc2021-04-15 12:50:05 -0500457 .link_mask = 0xF, /* 4 active links required */
458 .links = adl_default,
459 .drv_name = "sof_sdw",
460 .sof_tplg_filename = "sof-adl-rt711-l0-rt1308-l12-rt715-l3.tplg",
461 },
462 {
463 .link_mask = 0xF, /* 4 active links required */
464 .links = adl_sdca_default,
465 .drv_name = "sof_sdw",
466 .sof_tplg_filename = "sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg",
467 },
468 {
469 .link_mask = 0xF, /* 4 active links required */
470 .links = adl_sdca_3_in_1,
471 .drv_name = "sof_sdw",
472 .sof_tplg_filename = "sof-adl-rt711-l0-rt1316-l13-rt714-l2.tplg",
473 },
474 {
Gongjun Song359ace22021-11-05 10:26:45 +0800475 .link_mask = 0xF, /* 4 active links required */
476 .links = adl_sdw_rt711_link2_rt1316_link01_rt714_link3,
477 .drv_name = "sof_sdw",
478 .sof_fw_filename = "sof-adl.ri",
479 .sof_tplg_filename = "sof-adl-rt711-l2-rt1316-l01-rt714-l3.tplg",
480 },
481 {
Gongjun Song11e18f52021-11-05 10:26:43 +0800482 .link_mask = 0xC, /* rt1316 on link2 & rt714 on link3 */
483 .links = adl_sdw_rt1316_link2_rt714_link3,
484 .drv_name = "sof_sdw",
485 .sof_fw_filename = "sof-adl.ri",
486 .sof_tplg_filename = "sof-adl-rt1316-l2-mono-rt714-l3.tplg",
487 },
488 {
Gongjun Songa1797d62021-11-05 10:26:39 +0800489 .link_mask = 0x7, /* rt714 on link0 & two rt1316s on link1 and link2 */
490 .links = adl_sdw_rt1316_link12_rt714_link0,
491 .drv_name = "sof_sdw",
492 .sof_fw_filename = "sof-adl.ri",
493 .sof_tplg_filename = "sof-adl-rt1316-l12-rt714-l0.tplg",
494 },
495 {
Pierre-Louis Bossart870dc422021-04-15 12:50:06 -0500496 .link_mask = 0x5, /* 2 active links required */
497 .links = adl_sdw_rt1316_link2_rt714_link0,
498 .drv_name = "sof_sdw",
499 .sof_tplg_filename = "sof-adl-rt1316-l2-mono-rt714-l0.tplg",
500 },
501 {
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +0200502 .link_mask = 0x1, /* link0 required */
503 .links = adl_rvp,
504 .drv_name = "sof_sdw",
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +0200505 .sof_tplg_filename = "sof-adl-rt711.tplg",
506 },
Vamshi Krishna Gopalc0fbe9f2021-05-21 18:56:31 +0300507 {
508 .link_mask = 0x5, /* rt5682 on link0 & 2xmax98373 on link 2 */
509 .links = adl_chromebook_base,
510 .drv_name = "sof_sdw",
511 .sof_fw_filename = "sof-adl.ri",
512 .sof_tplg_filename = "sof-adl-sdw-max98373-rt5682.tplg",
513 },
Kai Vehmanen4c8a4ca2020-12-09 17:31:01 +0200514 {},
515};
516EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_sdw_machines);