xref: /linux/sound/soc/intel/common/soc-acpi-intel-mtl-match.c (revision 6537cfb395f352782918d8ee7b7f10ba2cc3cbf2)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * soc-acpi-intel-mtl-match.c - tables and support for MTL ACPI enumeration.
4  *
5  * Copyright (c) 2022, Intel Corporation.
6  *
7  */
8 
9 #include <linux/soundwire/sdw_intel.h>
10 #include <sound/sdca.h>
11 #include <sound/soc-acpi.h>
12 #include <sound/soc-acpi-intel-match.h>
13 #include <sound/soc-acpi-intel-ssp-common.h>
14 #include "soc-acpi-intel-sdca-quirks.h"
15 #include "soc-acpi-intel-sdw-mockup-match.h"
16 
17 static const struct snd_soc_acpi_codecs mtl_rt5682_rt5682s_hp = {
18 	.num_codecs = 2,
19 	.codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID},
20 };
21 
22 static const struct snd_soc_acpi_codecs mtl_essx_83x6 = {
23 	.num_codecs = 3,
24 	.codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
25 };
26 
27 static const struct snd_soc_acpi_codecs mtl_lt6911_hdmi = {
28 	.num_codecs = 1,
29 	.codecs = {"INTC10B0"}
30 };
31 
32 struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = {
33 	{
34 		.comp_ids = &mtl_essx_83x6,
35 		.drv_name = "mtl_es83x6_c1_h02",
36 		.machine_quirk = snd_soc_acpi_codec_list,
37 		.quirk_data = &mtl_lt6911_hdmi,
38 		.sof_tplg_filename = "sof-mtl-es83x6-ssp1-hdmi-ssp02.tplg",
39 	},
40 	{
41 		.comp_ids = &mtl_essx_83x6,
42 		.drv_name = "sof-essx8336",
43 		.sof_tplg_filename = "sof-mtl-es8336", /* the tplg suffix is added at run time */
44 		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
45 					SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
46 					SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
47 	},
48 	{
49 		.comp_ids = &mtl_rt5682_rt5682s_hp,
50 		.drv_name = "mtl_rt5682_c1_h02",
51 		.machine_quirk = snd_soc_acpi_codec_list,
52 		.quirk_data = &mtl_lt6911_hdmi,
53 		.sof_tplg_filename = "sof-mtl-rt5682-ssp1-hdmi-ssp02.tplg",
54 	},
55 	/* place boards for each headphone codec: sof driver will complete the
56 	 * tplg name and machine driver will detect the amp type
57 	 */
58 	{
59 		.id = CS42L42_ACPI_HID,
60 		.drv_name = "mtl_cs42l42_def",
61 		.sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
62 		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
63 					SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
64 	},
65 	{
66 		.id = DA7219_ACPI_HID,
67 		.drv_name = "mtl_da7219_def",
68 		.sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
69 		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
70 					SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
71 	},
72 	{
73 		.id = NAU8825_ACPI_HID,
74 		.drv_name = "mtl_nau8825_def",
75 		.sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
76 		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
77 					SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
78 	},
79 	{
80 		.id = RT5650_ACPI_HID,
81 		.drv_name = "mtl_rt5682_def",
82 		.sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
83 		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
84 					SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
85 	},
86 	{
87 		.comp_ids = &mtl_rt5682_rt5682s_hp,
88 		.drv_name = "mtl_rt5682_def",
89 		.sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
90 		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
91 					SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
92 	},
93 	/* place amp-only boards in the end of table */
94 	{
95 		.id = "INTC10B0",
96 		.drv_name = "mtl_lt6911_hdmi_ssp",
97 		.sof_tplg_filename = "sof-mtl-hdmi-ssp02.tplg",
98 	},
99 	{},
100 };
101 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_machines);
102 
103 static const struct snd_soc_acpi_endpoint single_endpoint = {
104 	.num = 0,
105 	.aggregated = 0,
106 	.group_position = 0,
107 	.group_id = 0,
108 };
109 
110 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
111 	.num = 0,
112 	.aggregated = 1,
113 	.group_position = 0,
114 	.group_id = 1,
115 };
116 
117 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
118 	.num = 0,
119 	.aggregated = 1,
120 	.group_position = 1,
121 	.group_id = 1,
122 };
123 
124 static const struct snd_soc_acpi_endpoint rt712_endpoints[] = {
125 	{
126 		.num = 0,
127 		.aggregated = 0,
128 		.group_position = 0,
129 		.group_id = 0,
130 	},
131 	{
132 		.num = 1,
133 		.aggregated = 0,
134 		.group_position = 0,
135 		.group_id = 0,
136 	},
137 };
138 
139 static const struct snd_soc_acpi_endpoint rt712_vb_endpoints[] = {
140 	{
141 		.num = 0,
142 		.aggregated = 0,
143 		.group_position = 0,
144 		.group_id = 0,
145 	},
146 	{
147 		.num = 1,
148 		.aggregated = 0,
149 		.group_position = 0,
150 		.group_id = 0,
151 	},
152 	{
153 		.num = 2,
154 		.aggregated = 0,
155 		.group_position = 0,
156 		.group_id = 0,
157 	},
158 };
159 
160 /*
161  * RT722 is a multi-function codec, three endpoints are created for
162  * its headset, amp and dmic functions.
163  */
164 static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {
165 	{
166 		.num = 0,
167 		.aggregated = 0,
168 		.group_position = 0,
169 		.group_id = 0,
170 	},
171 	{
172 		.num = 1,
173 		.aggregated = 0,
174 		.group_position = 0,
175 		.group_id = 0,
176 	},
177 	{
178 		.num = 2,
179 		.aggregated = 0,
180 		.group_position = 0,
181 		.group_id = 0,
182 	},
183 };
184 
185 static const struct snd_soc_acpi_endpoint spk_2_endpoint = {
186 	.num = 0,
187 	.aggregated = 1,
188 	.group_position = 2,
189 	.group_id = 1,
190 };
191 
192 static const struct snd_soc_acpi_endpoint spk_3_endpoint = {
193 	.num = 0,
194 	.aggregated = 1,
195 	.group_position = 3,
196 	.group_id = 1,
197 };
198 
199 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
200 	{
201 		.adr = 0x000030025D071101ull,
202 		.num_endpoints = 1,
203 		.endpoints = &single_endpoint,
204 		.name_prefix = "rt711"
205 	}
206 };
207 
208 static const struct snd_soc_acpi_adr_device rt712_0_single_adr[] = {
209 	{
210 		.adr = 0x000030025D071201ull,
211 		.num_endpoints = ARRAY_SIZE(rt712_endpoints),
212 		.endpoints = rt712_endpoints,
213 		.name_prefix = "rt712"
214 	}
215 };
216 
217 static const struct snd_soc_acpi_adr_device rt712_vb_0_single_adr[] = {
218 	{
219 		.adr = 0x000030025D071201ull,
220 		.num_endpoints = ARRAY_SIZE(rt712_vb_endpoints),
221 		.endpoints = rt712_vb_endpoints,
222 		.name_prefix = "rt712"
223 	}
224 };
225 
226 static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = {
227 	{
228 		.adr = 0x000330025D171201ull,
229 		.num_endpoints = 1,
230 		.endpoints = &single_endpoint,
231 		.name_prefix = "rt712-dmic"
232 	}
233 };
234 
235 static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
236 	{
237 		.adr = 0x000030025d072201ull,
238 		.num_endpoints = ARRAY_SIZE(rt722_endpoints),
239 		.endpoints = rt722_endpoints,
240 		.name_prefix = "rt722"
241 	}
242 };
243 
244 static const struct snd_soc_acpi_adr_device rt713_0_single_adr[] = {
245 	{
246 		.adr = 0x000031025D071301ull,
247 		.num_endpoints = 1,
248 		.endpoints = &single_endpoint,
249 		.name_prefix = "rt713"
250 	}
251 };
252 
253 static const struct snd_soc_acpi_adr_device rt1713_3_single_adr[] = {
254 	{
255 		.adr = 0x000331025D171301ull,
256 		.num_endpoints = 1,
257 		.endpoints = &single_endpoint,
258 		.name_prefix = "rt713-dmic"
259 	}
260 };
261 
262 static const struct snd_soc_acpi_adr_device mx8373_0_adr[] = {
263 	{
264 		.adr = 0x000023019F837300ull,
265 		.num_endpoints = 1,
266 		.endpoints = &spk_l_endpoint,
267 		.name_prefix = "Left"
268 	},
269 	{
270 		.adr = 0x000027019F837300ull,
271 		.num_endpoints = 1,
272 		.endpoints = &spk_r_endpoint,
273 		.name_prefix = "Right"
274 	}
275 };
276 
277 static const struct snd_soc_acpi_adr_device rt5682_2_adr[] = {
278 	{
279 		.adr = 0x000221025D568200ull,
280 		.num_endpoints = 1,
281 		.endpoints = &single_endpoint,
282 		.name_prefix = "rt5682"
283 	}
284 };
285 
286 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
287 	{
288 		.adr = 0x000230025D131601ull,
289 		.num_endpoints = 1,
290 		.endpoints = &spk_l_endpoint,
291 		.name_prefix = "rt1316-1"
292 	}
293 };
294 
295 static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
296 	{
297 		.adr = 0x000331025D131601ull,
298 		.num_endpoints = 1,
299 		.endpoints = &spk_r_endpoint,
300 		.name_prefix = "rt1316-2"
301 	}
302 };
303 
304 static const struct snd_soc_acpi_adr_device rt1316_1_group2_adr[] = {
305 	{
306 		.adr = 0x000131025D131601ull,
307 		.num_endpoints = 1,
308 		.endpoints = &spk_l_endpoint,
309 		.name_prefix = "rt1316-1"
310 	}
311 };
312 
313 static const struct snd_soc_acpi_adr_device rt1316_2_group2_adr[] = {
314 	{
315 		.adr = 0x000230025D131601ull,
316 		.num_endpoints = 1,
317 		.endpoints = &spk_r_endpoint,
318 		.name_prefix = "rt1316-2"
319 	}
320 };
321 
322 static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {
323 	{
324 		.adr = 0x000330025D131601ull,
325 		.num_endpoints = 1,
326 		.endpoints = &single_endpoint,
327 		.name_prefix = "rt1316-1"
328 	}
329 };
330 
331 static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = {
332 	{
333 		.adr = 0x000130025D131801ull,
334 		.num_endpoints = 1,
335 		.endpoints = &single_endpoint,
336 		.name_prefix = "rt1318-1"
337 	}
338 };
339 
340 static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
341 	{
342 		.adr = 0x000130025D131801ull,
343 		.num_endpoints = 1,
344 		.endpoints = &spk_l_endpoint,
345 		.name_prefix = "rt1318-1"
346 	}
347 };
348 
349 static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = {
350 	{
351 		.adr = 0x000232025D131801ull,
352 		.num_endpoints = 1,
353 		.endpoints = &spk_r_endpoint,
354 		.name_prefix = "rt1318-2"
355 	}
356 };
357 
358 static const struct snd_soc_acpi_adr_device rt714_0_adr[] = {
359 	{
360 		.adr = 0x000030025D071401ull,
361 		.num_endpoints = 1,
362 		.endpoints = &single_endpoint,
363 		.name_prefix = "rt714"
364 	}
365 };
366 
367 static const struct snd_soc_acpi_adr_device rt714_1_adr[] = {
368 	{
369 		.adr = 0x000130025D071401ull,
370 		.num_endpoints = 1,
371 		.endpoints = &single_endpoint,
372 		.name_prefix = "rt714"
373 	}
374 };
375 
376 static const struct snd_soc_acpi_link_adr mtl_712_l0_1712_l3[] = {
377 	{
378 		.mask = BIT(0),
379 		.num_adr = ARRAY_SIZE(rt712_0_single_adr),
380 		.adr_d = rt712_0_single_adr,
381 	},
382 	{
383 		.mask = BIT(3),
384 		.num_adr = ARRAY_SIZE(rt1712_3_single_adr),
385 		.adr_d = rt1712_3_single_adr,
386 	},
387 	{}
388 };
389 
390 static const struct snd_soc_acpi_link_adr mtl_712_l0[] = {
391 	{
392 		.mask = BIT(0),
393 		.num_adr = ARRAY_SIZE(rt712_0_single_adr),
394 		.adr_d = rt712_0_single_adr,
395 	},
396 	{}
397 };
398 
399 static const struct snd_soc_acpi_link_adr mtl_712_vb_l0[] = {
400 	{
401 		.mask = BIT(0),
402 		.num_adr = ARRAY_SIZE(rt712_vb_0_single_adr),
403 		.adr_d = rt712_vb_0_single_adr,
404 	},
405 	{}
406 };
407 
408 static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {
409 	{ /* Jack Playback Endpoint */
410 		.num = 0,
411 		.aggregated = 0,
412 		.group_position = 0,
413 		.group_id = 0,
414 	},
415 	{ /* DMIC Capture Endpoint */
416 		.num = 1,
417 		.aggregated = 0,
418 		.group_position = 0,
419 		.group_id = 0,
420 	},
421 	{ /* Jack Capture Endpoint */
422 		.num = 2,
423 		.aggregated = 0,
424 		.group_position = 0,
425 		.group_id = 0,
426 	},
427 	{ /* Speaker Playback Endpoint */
428 		.num = 3,
429 		.aggregated = 0,
430 		.group_position = 0,
431 		.group_id = 0,
432 	},
433 };
434 
435 static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {
436 	{
437 		.adr = 0x00003001FA424301ull,
438 		.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
439 		.endpoints = cs42l43_endpoints,
440 		.name_prefix = "cs42l43"
441 	}
442 };
443 
444 /* CS42L43 - speaker DAI aggregated with 4 amps */
445 static const struct snd_soc_acpi_endpoint cs42l43_4amp_spkagg_endpoints[] = {
446 	{ /* Jack Playback Endpoint */
447 		.num = 0,
448 		.aggregated = 0,
449 		.group_position = 0,
450 		.group_id = 0,
451 	},
452 	{ /* DMIC Capture Endpoint */
453 		.num = 1,
454 		.aggregated = 0,
455 		.group_position = 0,
456 		.group_id = 0,
457 	},
458 	{ /* Jack Capture Endpoint */
459 		.num = 2,
460 		.aggregated = 0,
461 		.group_position = 0,
462 		.group_id = 0,
463 	},
464 	{ /* Speaker Playback Endpoint */
465 		.num = 3,
466 		.aggregated = 1,
467 		.group_position = 4,
468 		.group_id = 1,
469 	},
470 };
471 
472 /* CS42L43 on link3 aggregated with 4 amps */
473 static const struct snd_soc_acpi_adr_device cs42l43_l3_4amp_spkagg_adr[] = {
474 	{
475 		.adr = 0x00033001FA424301ull,
476 		.num_endpoints = ARRAY_SIZE(cs42l43_4amp_spkagg_endpoints),
477 		.endpoints = cs42l43_4amp_spkagg_endpoints,
478 		.name_prefix = "cs42l43"
479 	}
480 };
481 
482 static const struct snd_soc_acpi_endpoint cs35l56_l_fb_endpoints[] = {
483 	{ /* Speaker Playback Endpoint */
484 		.num = 0,
485 		.aggregated = 1,
486 		.group_position = 0,
487 		.group_id = 1,
488 	},
489 	{ /* Feedback Capture Endpoint */
490 		.num = 1,
491 		.aggregated = 1,
492 		.group_position = 0,
493 		.group_id = 2,
494 	},
495 };
496 
497 static const struct snd_soc_acpi_endpoint cs35l56_r_fb_endpoints[] = {
498 	{ /* Speaker Playback Endpoint */
499 		.num = 0,
500 		.aggregated = 1,
501 		.group_position = 1,
502 		.group_id = 1,
503 	},
504 	{ /* Feedback Capture Endpoint */
505 		.num = 1,
506 		.aggregated = 1,
507 		.group_position = 1,
508 		.group_id = 2,
509 	},
510 };
511 
512 static const struct snd_soc_acpi_endpoint cs35l56_2_fb_endpoints[] = {
513 	{ /* Speaker Playback Endpoint */
514 		.num = 0,
515 		.aggregated = 1,
516 		.group_position = 2,
517 		.group_id = 1,
518 	},
519 	{ /* Feedback Capture Endpoint */
520 		.num = 1,
521 		.aggregated = 1,
522 		.group_position = 2,
523 		.group_id = 2,
524 	},
525 };
526 
527 static const struct snd_soc_acpi_endpoint cs35l56_3_fb_endpoints[] = {
528 	{ /* Speaker Playback Endpoint */
529 		.num = 0,
530 		.aggregated = 1,
531 		.group_position = 3,
532 		.group_id = 1,
533 	},
534 	{ /* Feedback Capture Endpoint */
535 		.num = 1,
536 		.aggregated = 1,
537 		.group_position = 3,
538 		.group_id = 2,
539 	},
540 };
541 
542 static const struct snd_soc_acpi_endpoint cs35l56_4_fb_endpoints[] = {
543 	{ /* Speaker Playback Endpoint */
544 		.num = 0,
545 		.aggregated = 1,
546 		.group_position = 4,
547 		.group_id = 1,
548 	},
549 	{ /* Feedback Capture Endpoint */
550 		.num = 1,
551 		.aggregated = 1,
552 		.group_position = 4,
553 		.group_id = 2,
554 	},
555 };
556 
557 static const struct snd_soc_acpi_endpoint cs35l56_5_fb_endpoints[] = {
558 	{ /* Speaker Playback Endpoint */
559 		.num = 0,
560 		.aggregated = 1,
561 		.group_position = 5,
562 		.group_id = 1,
563 	},
564 	{ /* Feedback Capture Endpoint */
565 		.num = 1,
566 		.aggregated = 1,
567 		.group_position = 5,
568 		.group_id = 2,
569 	},
570 };
571 
572 static const struct snd_soc_acpi_endpoint cs35l56_6_fb_endpoints[] = {
573 	{ /* Speaker Playback Endpoint */
574 		.num = 0,
575 		.aggregated = 1,
576 		.group_position = 6,
577 		.group_id = 1,
578 	},
579 	{ /* Feedback Capture Endpoint */
580 		.num = 1,
581 		.aggregated = 1,
582 		.group_position = 6,
583 		.group_id = 2,
584 	},
585 };
586 
587 static const struct snd_soc_acpi_endpoint cs35l56_7_fb_endpoints[] = {
588 	{ /* Speaker Playback Endpoint */
589 		.num = 0,
590 		.aggregated = 1,
591 		.group_position = 7,
592 		.group_id = 1,
593 	},
594 	{ /* Feedback Capture Endpoint */
595 		.num = 1,
596 		.aggregated = 1,
597 		.group_position = 7,
598 		.group_id = 2,
599 	},
600 };
601 
602 static const struct snd_soc_acpi_adr_device cs35l56_0_adr[] = {
603 	{
604 		.adr = 0x00003301FA355601ull,
605 		.num_endpoints = 1,
606 		.endpoints = &spk_l_endpoint,
607 		.name_prefix = "AMP1"
608 	},
609 	{
610 		.adr = 0x00003201FA355601ull,
611 		.num_endpoints = 1,
612 		.endpoints = &spk_2_endpoint,
613 		.name_prefix = "AMP2"
614 	}
615 };
616 
617 static const struct snd_soc_acpi_adr_device cs35l56_1_adr[] = {
618 	{
619 		.adr = 0x00013701FA355601ull,
620 		.num_endpoints = 1,
621 		.endpoints = &spk_r_endpoint,
622 		.name_prefix = "AMP3"
623 	},
624 	{
625 		.adr = 0x00013601FA355601ull,
626 		.num_endpoints = 1,
627 		.endpoints = &spk_3_endpoint,
628 		.name_prefix = "AMP4"
629 	}
630 };
631 
632 static const struct snd_soc_acpi_adr_device cs35l56_2_adr[] = {
633 	{
634 		.adr = 0x00023301FA355601ull,
635 		.num_endpoints = 1,
636 		.endpoints = &spk_l_endpoint,
637 		.name_prefix = "AMP1"
638 	},
639 	{
640 		.adr = 0x00023201FA355601ull,
641 		.num_endpoints = 1,
642 		.endpoints = &spk_2_endpoint,
643 		.name_prefix = "AMP2"
644 	}
645 };
646 
647 static const struct snd_soc_acpi_adr_device cs35l56_0_fb_adr[] = {
648 	{
649 		.adr = 0x00003301FA355601ull,
650 		.num_endpoints = ARRAY_SIZE(cs35l56_l_fb_endpoints),
651 		.endpoints = cs35l56_l_fb_endpoints,
652 		.name_prefix = "AMP1"
653 	},
654 	{
655 		.adr = 0x00003201FA355601ull,
656 		.num_endpoints = ARRAY_SIZE(cs35l56_2_fb_endpoints),
657 		.endpoints = cs35l56_2_fb_endpoints,
658 		.name_prefix = "AMP2"
659 	},
660 	{
661 		.adr = 0x00003101FA355601ull,
662 		.num_endpoints = ARRAY_SIZE(cs35l56_4_fb_endpoints),
663 		.endpoints = cs35l56_4_fb_endpoints,
664 		.name_prefix = "AMP3"
665 	},
666 	{
667 		.adr = 0x00003001FA355601ull,
668 		.num_endpoints = ARRAY_SIZE(cs35l56_6_fb_endpoints),
669 		.endpoints = cs35l56_6_fb_endpoints,
670 		.name_prefix = "AMP4"
671 	},
672 };
673 
674 static const struct snd_soc_acpi_adr_device cs35l56_1_fb_adr[] = {
675 	{
676 		.adr = 0x00013701FA355601ull,
677 		.num_endpoints = ARRAY_SIZE(cs35l56_r_fb_endpoints),
678 		.endpoints = cs35l56_r_fb_endpoints,
679 		.name_prefix = "AMP8"
680 	},
681 	{
682 		.adr = 0x00013601FA355601ull,
683 		.num_endpoints = ARRAY_SIZE(cs35l56_3_fb_endpoints),
684 		.endpoints = cs35l56_3_fb_endpoints,
685 		.name_prefix = "AMP7"
686 	},
687 	{
688 		.adr = 0x00013501FA355601ull,
689 		.num_endpoints = ARRAY_SIZE(cs35l56_5_fb_endpoints),
690 		.endpoints = cs35l56_5_fb_endpoints,
691 		.name_prefix = "AMP6"
692 	},
693 	{
694 		.adr = 0x00013401FA355601ull,
695 		.num_endpoints = ARRAY_SIZE(cs35l56_7_fb_endpoints),
696 		.endpoints = cs35l56_7_fb_endpoints,
697 		.name_prefix = "AMP5"
698 	},
699 };
700 
701 static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = {
702 	{
703 		.adr = 0x00023201FA355601ull,
704 		.num_endpoints = ARRAY_SIZE(cs35l56_r_fb_endpoints),
705 		.endpoints = cs35l56_r_fb_endpoints,
706 		.name_prefix = "AMP3"
707 	},
708 	{
709 		.adr = 0x00023301FA355601ull,
710 		.num_endpoints = ARRAY_SIZE(cs35l56_3_fb_endpoints),
711 		.endpoints = cs35l56_3_fb_endpoints,
712 		.name_prefix = "AMP4"
713 	}
714 
715 };
716 
717 static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = {
718 	{
719 		.adr = 0x00033001fa355601ull,
720 		.num_endpoints = ARRAY_SIZE(cs35l56_l_fb_endpoints),
721 		.endpoints = cs35l56_l_fb_endpoints,
722 		.name_prefix = "AMP1"
723 	},
724 	{
725 		.adr = 0x00033101fa355601ull,
726 		.num_endpoints = ARRAY_SIZE(cs35l56_2_fb_endpoints),
727 		.endpoints = cs35l56_2_fb_endpoints,
728 		.name_prefix = "AMP2"
729 	}
730 };
731 
732 static const struct snd_soc_acpi_link_adr rt5682_link2_max98373_link0[] = {
733 	/* Expected order: jack -> amp */
734 	{
735 		.mask = BIT(2),
736 		.num_adr = ARRAY_SIZE(rt5682_2_adr),
737 		.adr_d = rt5682_2_adr,
738 	},
739 	{
740 		.mask = BIT(0),
741 		.num_adr = ARRAY_SIZE(mx8373_0_adr),
742 		.adr_d = mx8373_0_adr,
743 	},
744 	{}
745 };
746 
747 static const struct snd_soc_acpi_link_adr mtl_rvp[] = {
748 	{
749 		.mask = BIT(0),
750 		.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
751 		.adr_d = rt711_sdca_0_adr,
752 	},
753 	{}
754 };
755 
756 static const struct snd_soc_acpi_link_adr mtl_rt722_only[] = {
757 	{
758 		.mask = BIT(0),
759 		.num_adr = ARRAY_SIZE(rt722_0_single_adr),
760 		.adr_d = rt722_0_single_adr,
761 	},
762 	{}
763 };
764 
765 static const struct snd_soc_acpi_link_adr mtl_3_in_1_sdca[] = {
766 	{
767 		.mask = BIT(0),
768 		.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
769 		.adr_d = rt711_sdca_0_adr,
770 	},
771 	{
772 		.mask = BIT(2),
773 		.num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
774 		.adr_d = rt1316_2_group1_adr,
775 	},
776 	{
777 		.mask = BIT(3),
778 		.num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
779 		.adr_d = rt1316_3_group1_adr,
780 	},
781 	{
782 		.mask = BIT(1),
783 		.num_adr = ARRAY_SIZE(rt714_1_adr),
784 		.adr_d = rt714_1_adr,
785 	},
786 	{}
787 };
788 
789 static const struct snd_soc_acpi_link_adr mtl_sdw_rt1318_l12_rt714_l0[] = {
790 	{
791 		.mask = BIT(1),
792 		.num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
793 		.adr_d = rt1318_1_group1_adr,
794 	},
795 	{
796 		.mask = BIT(2),
797 		.num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
798 		.adr_d = rt1318_2_group1_adr,
799 	},
800 	{
801 		.mask = BIT(0),
802 		.num_adr = ARRAY_SIZE(rt714_0_adr),
803 		.adr_d = rt714_0_adr,
804 	},
805 	{}
806 };
807 
808 static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12_rt1713_l3[] = {
809 	{
810 		.mask = BIT(0),
811 		.num_adr = ARRAY_SIZE(rt713_0_single_adr),
812 		.adr_d = rt713_0_single_adr,
813 	},
814 	{
815 		.mask = BIT(1),
816 		.num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
817 		.adr_d = rt1316_1_group2_adr,
818 	},
819 	{
820 		.mask = BIT(2),
821 		.num_adr = ARRAY_SIZE(rt1316_2_group2_adr),
822 		.adr_d = rt1316_2_group2_adr,
823 	},
824 	{
825 		.mask = BIT(3),
826 		.num_adr = ARRAY_SIZE(rt1713_3_single_adr),
827 		.adr_d = rt1713_3_single_adr,
828 	},
829 	{}
830 };
831 
832 static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1318_l1_rt1713_l3[] = {
833 	{
834 		.mask = BIT(0),
835 		.num_adr = ARRAY_SIZE(rt713_0_single_adr),
836 		.adr_d = rt713_0_single_adr,
837 	},
838 	{
839 		.mask = BIT(1),
840 		.num_adr = ARRAY_SIZE(rt1318_1_single_adr),
841 		.adr_d = rt1318_1_single_adr,
842 	},
843 	{
844 		.mask = BIT(3),
845 		.num_adr = ARRAY_SIZE(rt1713_3_single_adr),
846 		.adr_d = rt1713_3_single_adr,
847 	},
848 	{}
849 };
850 
851 static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1318_l12_rt1713_l3[] = {
852 	{
853 		.mask = BIT(0),
854 		.num_adr = ARRAY_SIZE(rt713_0_single_adr),
855 		.adr_d = rt713_0_single_adr,
856 	},
857 	{
858 		.mask = BIT(1),
859 		.num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
860 		.adr_d = rt1318_1_group1_adr,
861 	},
862 	{
863 		.mask = BIT(2),
864 		.num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
865 		.adr_d = rt1318_2_group1_adr,
866 	},
867 	{
868 		.mask = BIT(3),
869 		.num_adr = ARRAY_SIZE(rt1713_3_single_adr),
870 		.adr_d = rt1713_3_single_adr,
871 	},
872 	{}
873 };
874 
875 static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12[] = {
876 	{
877 		.mask = BIT(0),
878 		.num_adr = ARRAY_SIZE(rt713_0_single_adr),
879 		.adr_d = rt713_0_single_adr,
880 	},
881 	{
882 		.mask = BIT(1),
883 		.num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
884 		.adr_d = rt1316_1_group2_adr,
885 	},
886 	{
887 		.mask = BIT(2),
888 		.num_adr = ARRAY_SIZE(rt1316_2_group2_adr),
889 		.adr_d = rt1316_2_group2_adr,
890 	},
891 	{}
892 };
893 
894 static const struct snd_soc_acpi_link_adr mtl_rt711_l0_rt1316_l3[] = {
895 	{
896 		.mask = BIT(0),
897 		.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
898 		.adr_d = rt711_sdca_0_adr,
899 	},
900 	{
901 		.mask = BIT(3),
902 		.num_adr = ARRAY_SIZE(rt1316_3_single_adr),
903 		.adr_d = rt1316_3_single_adr,
904 	},
905 	{}
906 };
907 
908 static const struct snd_soc_acpi_adr_device mx8363_2_adr[] = {
909 	{
910 		.adr = 0x000230019F836300ull,
911 		.num_endpoints = 1,
912 		.endpoints = &spk_l_endpoint,
913 		.name_prefix = "Left"
914 	},
915 	{
916 		.adr = 0x000231019F836300ull,
917 		.num_endpoints = 1,
918 		.endpoints = &spk_r_endpoint,
919 		.name_prefix = "Right"
920 	}
921 };
922 
923 static const struct snd_soc_acpi_adr_device cs42l42_0_adr[] = {
924 	{
925 		.adr = 0x00001001FA424200ull,
926 		.num_endpoints = 1,
927 		.endpoints = &single_endpoint,
928 		.name_prefix = "cs42l42"
929 	}
930 };
931 
932 static const struct snd_soc_acpi_link_adr cs42l42_link0_max98363_link2[] = {
933 	/* Expected order: jack -> amp */
934 	{
935 		.mask = BIT(0),
936 		.num_adr = ARRAY_SIZE(cs42l42_0_adr),
937 		.adr_d = cs42l42_0_adr,
938 	},
939 	{
940 		.mask = BIT(2),
941 		.num_adr = ARRAY_SIZE(mx8363_2_adr),
942 		.adr_d = mx8363_2_adr,
943 	},
944 	{}
945 };
946 
947 static const struct snd_soc_acpi_link_adr mtl_cs42l43_l0[] = {
948 	{
949 		.mask = BIT(0),
950 		.num_adr = ARRAY_SIZE(cs42l43_0_adr),
951 		.adr_d = cs42l43_0_adr,
952 	},
953 	{}
954 };
955 
956 static const struct snd_soc_acpi_link_adr mtl_cs42l43_cs35l56[] = {
957 	{
958 		.mask = BIT(0),
959 		.num_adr = ARRAY_SIZE(cs42l43_0_adr),
960 		.adr_d = cs42l43_0_adr,
961 	},
962 	{
963 		.mask = BIT(1),
964 		.num_adr = ARRAY_SIZE(cs35l56_1_adr),
965 		.adr_d = cs35l56_1_adr,
966 	},
967 	{
968 		.mask = BIT(2),
969 		.num_adr = ARRAY_SIZE(cs35l56_2_adr),
970 		.adr_d = cs35l56_2_adr,
971 	},
972 	{}
973 };
974 
975 static const struct snd_soc_acpi_link_adr cs42l43_link0_cs35l56_link2_link3[] = {
976 	/* Expected order: jack -> amp */
977 	{
978 		.mask = BIT(0),
979 		.num_adr = ARRAY_SIZE(cs42l43_0_adr),
980 		.adr_d = cs42l43_0_adr,
981 	},
982 	{
983 		.mask = BIT(2),
984 		.num_adr = ARRAY_SIZE(cs35l56_2_r_adr),
985 		.adr_d = cs35l56_2_r_adr,
986 	},
987 	{
988 		.mask = BIT(3),
989 		.num_adr = ARRAY_SIZE(cs35l56_3_l_adr),
990 		.adr_d = cs35l56_3_l_adr,
991 	},
992 	{}
993 };
994 
995 static const struct snd_soc_acpi_link_adr cs42l43_link3_cs35l56_x4_link0_link1_spkagg[] = {
996 	/* Expected order: jack -> amp */
997 	{
998 		.mask = BIT(3),
999 		.num_adr = ARRAY_SIZE(cs42l43_l3_4amp_spkagg_adr),
1000 		.adr_d = cs42l43_l3_4amp_spkagg_adr,
1001 	},
1002 	{
1003 		.mask = BIT(1),
1004 		.num_adr = 2,
1005 		.adr_d = cs35l56_1_adr,
1006 	},
1007 	{
1008 		.mask = BIT(0),
1009 		.num_adr = 2,
1010 		.adr_d = cs35l56_0_adr,
1011 	},
1012 	{}
1013 };
1014 
1015 static const struct snd_soc_acpi_link_adr mtl_cs35l56_x8_link0_link1_fb[] = {
1016 	{
1017 		.mask = BIT(1),
1018 		.num_adr = ARRAY_SIZE(cs35l56_1_fb_adr),
1019 		.adr_d = cs35l56_1_fb_adr,
1020 	},
1021 	{
1022 		.mask = BIT(0),
1023 		.num_adr = ARRAY_SIZE(cs35l56_0_fb_adr),
1024 		.adr_d = cs35l56_0_fb_adr,
1025 	},
1026 	{}
1027 };
1028 
1029 /* this table is used when there is no I2S codec present */
1030 struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {
1031 	/* mockup tests need to be first */
1032 	{
1033 		.link_mask = GENMASK(3, 0),
1034 		.links = sdw_mockup_headset_2amps_mic,
1035 		.drv_name = "sof_sdw",
1036 		.sof_tplg_filename = "sof-mtl-rt711-rt1308-rt715.tplg",
1037 	},
1038 	{
1039 		.link_mask = BIT(0) | BIT(1) | BIT(3),
1040 		.links = sdw_mockup_headset_1amp_mic,
1041 		.drv_name = "sof_sdw",
1042 		.sof_tplg_filename = "sof-mtl-rt711-rt1308-mono-rt715.tplg",
1043 	},
1044 	{
1045 		.link_mask = GENMASK(2, 0),
1046 		.links = sdw_mockup_mic_headset_1amp,
1047 		.drv_name = "sof_sdw",
1048 		.sof_tplg_filename = "sof-mtl-rt715-rt711-rt1308-mono.tplg",
1049 	},
1050 	{
1051 		.link_mask = GENMASK(3, 0),
1052 		.links = mtl_rt713_l0_rt1316_l12_rt1713_l3,
1053 		.drv_name = "sof_sdw",
1054 		.sof_tplg_filename = "sof-mtl-rt713-l0-rt1316-l12-rt1713-l3.tplg",
1055 	},
1056 	{
1057 		.link_mask = GENMASK(3, 0),
1058 		.links = mtl_rt713_l0_rt1318_l12_rt1713_l3,
1059 		.drv_name = "sof_sdw",
1060 		.sof_tplg_filename = "sof-mtl-rt713-l0-rt1318-l12-rt1713-l3.tplg",
1061 	},
1062 	{
1063 		.link_mask = BIT(0) | BIT(1) | BIT(3),
1064 		.links = mtl_rt713_l0_rt1318_l1_rt1713_l3,
1065 		.drv_name = "sof_sdw",
1066 		.sof_tplg_filename = "sof-mtl-rt713-l0-rt1318-l1-rt1713-l3.tplg",
1067 	},
1068 	{
1069 		.link_mask = GENMASK(2, 0),
1070 		.links = mtl_rt713_l0_rt1316_l12,
1071 		.drv_name = "sof_sdw",
1072 		.sof_tplg_filename = "sof-mtl-rt713-l0-rt1316-l12.tplg",
1073 	},
1074 	{
1075 		.link_mask = BIT(3) | BIT(0),
1076 		.links = mtl_712_l0_1712_l3,
1077 		.drv_name = "sof_sdw",
1078 		.sof_tplg_filename = "sof-mtl-rt712-l0-rt1712-l3.tplg",
1079 	},
1080 	{
1081 		.link_mask = BIT(0),
1082 		.links = mtl_712_vb_l0,
1083 		.drv_name = "sof_sdw",
1084 		.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
1085 		.sof_tplg_filename = "sof-mtl-rt712-vb-l0.tplg",
1086 	},
1087 	{
1088 		.link_mask = BIT(0),
1089 		.links = mtl_712_l0,
1090 		.drv_name = "sof_sdw",
1091 		.sof_tplg_filename = "sof-mtl-rt712-l0.tplg",
1092 	},
1093 	{
1094 		.link_mask = GENMASK(2, 0),
1095 		.links = mtl_sdw_rt1318_l12_rt714_l0,
1096 		.drv_name = "sof_sdw",
1097 		.sof_tplg_filename = "sof-mtl-rt1318-l12-rt714-l0.tplg"
1098 	},
1099 	{
1100 		.link_mask = BIT(0) | BIT(2) | BIT(3),
1101 		.links = cs42l43_link0_cs35l56_link2_link3,
1102 		.drv_name = "sof_sdw",
1103 		.sof_tplg_filename = "sof-mtl-cs42l43-l0-cs35l56-l23.tplg",
1104 	},
1105 	{
1106 		.link_mask = BIT(0) | BIT(1) | BIT(3),
1107 		.links = cs42l43_link3_cs35l56_x4_link0_link1_spkagg,
1108 		.drv_name = "sof_sdw",
1109 		.sof_tplg_filename = "sof-mtl-cs42l43-l3-cs35l56-l01-spkagg.tplg",
1110 	},
1111 	{
1112 		.link_mask = GENMASK(2, 0),
1113 		.links = mtl_cs42l43_cs35l56,
1114 		.drv_name = "sof_sdw",
1115 		.sof_tplg_filename = "sof-mtl-cs42l43-l0-cs35l56-l12.tplg",
1116 	},
1117 	{
1118 		.link_mask = BIT(0) | BIT(1),
1119 		.links = mtl_cs35l56_x8_link0_link1_fb,
1120 		.drv_name = "sof_sdw",
1121 		.sof_tplg_filename = "sof-mtl-cs35l56-l01-fb8.tplg"
1122 	},
1123 	{
1124 		.link_mask = BIT(0),
1125 		.links = mtl_cs42l43_l0,
1126 		.drv_name = "sof_sdw",
1127 		.sof_tplg_filename = "sof-mtl-cs42l43-l0.tplg",
1128 	},
1129 	{
1130 		.link_mask = GENMASK(3, 0),
1131 		.links = mtl_3_in_1_sdca,
1132 		.drv_name = "sof_sdw",
1133 		.sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg",
1134 	},
1135 	{
1136 		.link_mask = 0x9, /* 2 active links required */
1137 		.links = mtl_rt711_l0_rt1316_l3,
1138 		.drv_name = "sof_sdw",
1139 		.sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l3.tplg",
1140 	},
1141 	{
1142 		.link_mask = BIT(0),
1143 		.links = mtl_rt722_only,
1144 		.drv_name = "sof_sdw",
1145 		.sof_tplg_filename = "sof-mtl-rt722-l0.tplg",
1146 	},
1147 	{
1148 		.link_mask = BIT(0),
1149 		.links = mtl_rvp,
1150 		.drv_name = "sof_sdw",
1151 		.sof_tplg_filename = "sof-mtl-rt711.tplg",
1152 	},
1153 	{
1154 		.link_mask = BIT(0) | BIT(2),
1155 		.links = rt5682_link2_max98373_link0,
1156 		.drv_name = "sof_sdw",
1157 		.sof_tplg_filename = "sof-mtl-sdw-rt5682-l2-max98373-l0.tplg",
1158 	},
1159 	{
1160 		.link_mask = BIT(0) | BIT(2),
1161 		.links = cs42l42_link0_max98363_link2,
1162 		.drv_name = "sof_sdw",
1163 		.sof_tplg_filename = "sof-mtl-sdw-cs42l42-l0-max98363-l2.tplg",
1164 	},
1165 	{},
1166 };
1167 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_sdw_machines);
1168 
1169 MODULE_IMPORT_NS("SND_SOC_ACPI_INTEL_SDCA_QUIRKS");
1170