1 // SPDX-License-Identifier: GPL-2.0-only
3 * soc-apci-intel-rpl-match.c - tables and support for RPL ACPI enumeration.
5 * Copyright (c) 2022 Intel Corporation.
8 #include <sound/soc-acpi.h>
9 #include <sound/soc-acpi-intel-match.h>
11 static const struct snd_soc_acpi_endpoint single_endpoint = {
18 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
25 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
32 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
34 .adr = 0x000020025D071100ull,
36 .endpoints = &single_endpoint,
37 .name_prefix = "rt711"
41 static const struct snd_soc_acpi_link_adr rpl_rvp[] = {
44 .num_adr = ARRAY_SIZE(rt711_0_adr),
50 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
52 .adr = 0x000030025D071101ull,
54 .endpoints = &single_endpoint,
55 .name_prefix = "rt711"
59 static const struct snd_soc_acpi_adr_device rt711_sdca_2_adr[] = {
61 .adr = 0x000230025D071101ull,
63 .endpoints = &single_endpoint,
64 .name_prefix = "rt711"
68 static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {
70 .adr = 0x000131025D131601ull, /* unique ID is set for some reason */
72 .endpoints = &spk_l_endpoint,
73 .name_prefix = "rt1316-1"
77 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
79 .adr = 0x000230025D131601ull,
81 .endpoints = &spk_r_endpoint,
82 .name_prefix = "rt1316-2"
86 static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
88 .adr = 0x000330025D131601ull,
90 .endpoints = &spk_r_endpoint,
91 .name_prefix = "rt1316-2"
95 static const struct snd_soc_acpi_adr_device rt1316_0_group2_adr[] = {
97 .adr = 0x000030025D131601ull,
99 .endpoints = &spk_l_endpoint,
100 .name_prefix = "rt1316-1"
104 static const struct snd_soc_acpi_adr_device rt1316_1_group2_adr[] = {
106 .adr = 0x000131025D131601ull,
108 .endpoints = &spk_r_endpoint,
109 .name_prefix = "rt1316-2"
113 static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
115 .adr = 0x000132025D131801ull,
117 .endpoints = &spk_l_endpoint,
118 .name_prefix = "rt1318-1"
122 static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = {
124 .adr = 0x000230025D131801ull,
126 .endpoints = &spk_r_endpoint,
127 .name_prefix = "rt1318-2"
131 static const struct snd_soc_acpi_adr_device rt714_0_adr[] = {
133 .adr = 0x000030025D071401ull,
135 .endpoints = &single_endpoint,
136 .name_prefix = "rt714"
140 static const struct snd_soc_acpi_adr_device rt714_2_adr[] = {
142 .adr = 0x000230025D071401ull,
144 .endpoints = &single_endpoint,
145 .name_prefix = "rt714"
149 static const struct snd_soc_acpi_adr_device rt714_3_adr[] = {
151 .adr = 0x000330025D071401ull,
153 .endpoints = &single_endpoint,
154 .name_prefix = "rt714"
158 static const struct snd_soc_acpi_link_adr rpl_sdca_3_in_1[] = {
161 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
162 .adr_d = rt711_sdca_0_adr,
166 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
167 .adr_d = rt1316_1_group1_adr,
171 .num_adr = ARRAY_SIZE(rt714_2_adr),
172 .adr_d = rt714_2_adr,
176 .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
177 .adr_d = rt1316_3_group1_adr,
182 static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link0_rt1316_link12_rt714_link3[] = {
185 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
186 .adr_d = rt711_sdca_0_adr,
190 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
191 .adr_d = rt1316_1_group1_adr,
195 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
196 .adr_d = rt1316_2_group1_adr,
200 .num_adr = ARRAY_SIZE(rt714_3_adr),
201 .adr_d = rt714_3_adr,
206 static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link2_rt1316_link01_rt714_link3[] = {
209 .num_adr = ARRAY_SIZE(rt711_sdca_2_adr),
210 .adr_d = rt711_sdca_2_adr,
214 .num_adr = ARRAY_SIZE(rt1316_0_group2_adr),
215 .adr_d = rt1316_0_group2_adr,
219 .num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
220 .adr_d = rt1316_1_group2_adr,
224 .num_adr = ARRAY_SIZE(rt714_3_adr),
225 .adr_d = rt714_3_adr,
230 static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link2_rt1316_link01[] = {
233 .num_adr = ARRAY_SIZE(rt711_sdca_2_adr),
234 .adr_d = rt711_sdca_2_adr,
238 .num_adr = ARRAY_SIZE(rt1316_0_group2_adr),
239 .adr_d = rt1316_0_group2_adr,
243 .num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
244 .adr_d = rt1316_1_group2_adr,
249 static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link0_rt1318_link12_rt714_link3[] = {
252 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
253 .adr_d = rt711_sdca_0_adr,
257 .num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
258 .adr_d = rt1318_1_group1_adr,
262 .num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
263 .adr_d = rt1318_2_group1_adr,
267 .num_adr = ARRAY_SIZE(rt714_3_adr),
268 .adr_d = rt714_3_adr,
273 static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link0_rt1318_link12[] = {
276 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
277 .adr_d = rt711_sdca_0_adr,
281 .num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
282 .adr_d = rt1318_1_group1_adr,
286 .num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
287 .adr_d = rt1318_2_group1_adr,
292 static const struct snd_soc_acpi_link_adr rpl_sdw_rt1316_link12_rt714_link0[] = {
295 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
296 .adr_d = rt1316_1_group1_adr,
300 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
301 .adr_d = rt1316_2_group1_adr,
305 .num_adr = ARRAY_SIZE(rt714_0_adr),
306 .adr_d = rt714_0_adr,
311 static const struct snd_soc_acpi_link_adr rpl_sdca_rvp[] = {
314 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
315 .adr_d = rt711_sdca_0_adr,
320 static const struct snd_soc_acpi_link_adr rplp_crb[] = {
323 .num_adr = ARRAY_SIZE(rt711_sdca_2_adr),
324 .adr_d = rt711_sdca_2_adr,
329 static const struct snd_soc_acpi_codecs rpl_rt5682_hp = {
331 .codecs = {"10EC5682", "RTL5682"},
334 static const struct snd_soc_acpi_codecs rpl_essx_83x6 = {
336 .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
339 static const struct snd_soc_acpi_codecs rpl_max98357a_amp = {
341 .codecs = {"MX98357A"}
344 static const struct snd_soc_acpi_codecs rpl_max98360a_amp = {
346 .codecs = {"MX98360A"},
349 static const struct snd_soc_acpi_codecs rpl_max98373_amp = {
351 .codecs = {"MX98373"}
354 static const struct snd_soc_acpi_codecs rpl_lt6911_hdmi = {
356 .codecs = {"INTC10B0"}
359 static const struct snd_soc_acpi_codecs rpl_nau8318_amp = {
361 .codecs = {"NVTN2012"}
364 static const struct snd_soc_acpi_codecs rpl_rt1019p_amp = {
366 .codecs = {"RTL1019"}
369 struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = {
371 .comp_ids = &rpl_rt5682_hp,
372 .drv_name = "rpl_mx98357_rt5682",
373 .machine_quirk = snd_soc_acpi_codec_list,
374 .quirk_data = &rpl_max98357a_amp,
375 .sof_tplg_filename = "sof-rpl-max98357a-rt5682.tplg",
378 .comp_ids = &rpl_rt5682_hp,
379 .drv_name = "rpl_mx98360_rt5682",
380 .machine_quirk = snd_soc_acpi_codec_list,
381 .quirk_data = &rpl_max98360a_amp,
382 .sof_tplg_filename = "sof-rpl-max98360a-rt5682.tplg",
386 .drv_name = "rpl_max98373_8825",
387 .machine_quirk = snd_soc_acpi_codec_list,
388 .quirk_data = &rpl_max98373_amp,
389 .sof_tplg_filename = "sof-rpl-max98373-nau8825.tplg",
393 .drv_name = "rpl_nau8318_8825",
394 .machine_quirk = snd_soc_acpi_codec_list,
395 .quirk_data = &rpl_nau8318_amp,
396 .sof_tplg_filename = "sof-rpl-nau8318-nau8825.tplg",
399 .comp_ids = &rpl_rt5682_hp,
400 .drv_name = "rpl_rt1019_rt5682",
401 .machine_quirk = snd_soc_acpi_codec_list,
402 .quirk_data = &rpl_rt1019p_amp,
403 .sof_tplg_filename = "sof-rpl-rt1019-rt5682.tplg",
406 .comp_ids = &rpl_essx_83x6,
407 .drv_name = "rpl_es83x6_c1_h02",
408 .machine_quirk = snd_soc_acpi_codec_list,
409 .quirk_data = &rpl_lt6911_hdmi,
410 .sof_tplg_filename = "sof-rpl-es83x6-ssp1-hdmi-ssp02.tplg",
413 .comp_ids = &rpl_essx_83x6,
414 .drv_name = "sof-essx8336",
415 .sof_tplg_filename = "sof-rpl-es83x6", /* the tplg suffix is added at run time */
416 .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
417 SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
418 SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
422 .drv_name = "rpl_lt6911_hdmi_ssp",
423 .sof_tplg_filename = "sof-rpl-nocodec-hdmi-ssp02.tplg"
427 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_machines);
429 /* this table is used when there is no I2S codec present */
430 struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = {
432 .link_mask = 0xF, /* 4 active links required */
433 .links = rpl_sdca_3_in_1,
434 .drv_name = "sof_sdw",
435 .sof_tplg_filename = "sof-rpl-rt711-l0-rt1316-l13-rt714-l2.tplg",
438 .link_mask = 0xF, /* 4 active links required */
439 .links = rpl_sdw_rt711_link2_rt1316_link01_rt714_link3,
440 .drv_name = "sof_sdw",
441 .sof_tplg_filename = "sof-rpl-rt711-l2-rt1316-l01-rt714-l3.tplg",
444 .link_mask = 0xF, /* 4 active links required */
445 .links = rpl_sdw_rt711_link0_rt1316_link12_rt714_link3,
446 .drv_name = "sof_sdw",
447 .sof_tplg_filename = "sof-rpl-rt711-l0-rt1316-l12-rt714-l3.tplg",
450 .link_mask = 0xF, /* 4 active links required */
451 .links = rpl_sdw_rt711_link0_rt1318_link12_rt714_link3,
452 .drv_name = "sof_sdw",
453 .sof_tplg_filename = "sof-rpl-rt711-l0-rt1318-l12-rt714-l3.tplg",
456 .link_mask = 0x7, /* rt711 on link0 & two rt1318s on link1 and link2 */
457 .links = rpl_sdw_rt711_link0_rt1318_link12,
458 .drv_name = "sof_sdw",
459 .sof_tplg_filename = "sof-rpl-rt711-l0-rt1318-l12.tplg",
462 .link_mask = 0x7, /* rt714 on link0 & two rt1316s on link1 and link2 */
463 .links = rpl_sdw_rt1316_link12_rt714_link0,
464 .drv_name = "sof_sdw",
465 .sof_tplg_filename = "sof-rpl-rt1316-l12-rt714-l0.tplg",
468 .link_mask = 0x7, /* rt711 on link2 & two rt1316s on link0 and link1 */
469 .links = rpl_sdw_rt711_link2_rt1316_link01,
470 .drv_name = "sof_sdw",
471 .sof_tplg_filename = "sof-rpl-rt711-l2-rt1316-l01.tplg",
474 .link_mask = 0x1, /* link0 required */
476 .drv_name = "sof_sdw",
477 .sof_tplg_filename = "sof-rpl-rt711-l0.tplg",
480 .link_mask = 0x1, /* link0 required */
481 .links = rpl_sdca_rvp,
482 .drv_name = "sof_sdw",
483 .sof_tplg_filename = "sof-rpl-rt711-l0.tplg",
486 .link_mask = 0x4, /* link2 required */
488 .drv_name = "sof_sdw",
489 .sof_tplg_filename = "sof-rpl-rt711-l2.tplg",
493 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_sdw_machines);