1 // SPDX-License-Identifier: GPL-2.0-only
3 * soc-acpi-intel-cml-match.c - tables and support for CML ACPI enumeration.
5 * Copyright (c) 2019, Intel Corporation.
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
12 static const struct snd_soc_acpi_codecs essx_83x6 = {
14 .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
17 static const struct snd_soc_acpi_codecs rt1011_spk_codecs = {
19 .codecs = {"10EC1011"}
22 static const struct snd_soc_acpi_codecs rt1015_spk_codecs = {
24 .codecs = {"10EC1015"}
27 static const struct snd_soc_acpi_codecs max98357a_spk_codecs = {
29 .codecs = {"MX98357A"}
32 static const struct snd_soc_acpi_codecs max98390_spk_codecs = {
38 * The order of the three entries with .id = "10EC5682" matters
39 * here, because DSDT tables expose an ACPI HID for the MAX98357A
40 * speaker amplifier which is not populated on the board.
42 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
45 .drv_name = "cml_rt1011_rt5682",
46 .machine_quirk = snd_soc_acpi_codec_list,
47 .quirk_data = &rt1011_spk_codecs,
48 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
52 .drv_name = "cml_rt1015_rt5682",
53 .machine_quirk = snd_soc_acpi_codec_list,
54 .quirk_data = &rt1015_spk_codecs,
55 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
59 .drv_name = "sof_rt5682",
60 .machine_quirk = snd_soc_acpi_codec_list,
61 .quirk_data = &max98357a_spk_codecs,
62 .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
66 .drv_name = "sof_rt5682",
67 .sof_tplg_filename = "sof-cml-rt5682.tplg",
71 .drv_name = "cml_da7219_mx98357a",
72 .machine_quirk = snd_soc_acpi_codec_list,
73 .quirk_data = &max98357a_spk_codecs,
74 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
78 .drv_name = "cml_da7219_mx98357a",
79 .machine_quirk = snd_soc_acpi_codec_list,
80 .quirk_data = &max98390_spk_codecs,
81 .sof_tplg_filename = "sof-cml-da7219-max98390.tplg",
84 .comp_ids = &essx_83x6,
85 .drv_name = "sof-essx8336",
86 .sof_tplg_filename = "sof-cml-es8336", /* the tplg suffix is added at run time */
87 .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
88 SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
89 SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
93 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);
95 static const struct snd_soc_acpi_endpoint single_endpoint = {
102 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
109 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
116 static const struct snd_soc_acpi_adr_device rt700_1_adr[] = {
118 .adr = 0x000110025D070000ull,
120 .endpoints = &single_endpoint,
121 .name_prefix = "rt700"
125 static const struct snd_soc_acpi_link_adr cml_rvp[] = {
128 .num_adr = ARRAY_SIZE(rt700_1_adr),
129 .adr_d = rt700_1_adr,
134 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
136 .adr = 0x000020025D071100ull,
138 .endpoints = &single_endpoint,
139 .name_prefix = "rt711"
143 static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
145 .adr = 0x000120025D130800ull,
147 .endpoints = &single_endpoint,
148 .name_prefix = "rt1308-1"
152 static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
154 .adr = 0x000120025D130800ull,
156 .endpoints = &spk_l_endpoint,
157 .name_prefix = "rt1308-1"
161 static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
163 .adr = 0x000220025D130800ull,
165 .endpoints = &spk_r_endpoint,
166 .name_prefix = "rt1308-2"
170 static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
172 .adr = 0x000320025D071500ull,
174 .endpoints = &single_endpoint,
175 .name_prefix = "rt715"
179 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
181 .adr = 0x000030025D071101ull,
183 .endpoints = &single_endpoint,
184 .name_prefix = "rt711"
188 static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {
190 .adr = 0x000131025D131601ull, /* unique ID is set for some reason */
192 .endpoints = &spk_l_endpoint,
193 .name_prefix = "rt1316-1"
197 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
199 .adr = 0x000230025D131601ull,
201 .endpoints = &spk_r_endpoint,
202 .name_prefix = "rt1316-2"
206 static const struct snd_soc_acpi_adr_device rt714_3_adr[] = {
208 .adr = 0x000330025D071401ull,
210 .endpoints = &single_endpoint,
211 .name_prefix = "rt714"
215 static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
218 .num_adr = ARRAY_SIZE(rt711_0_adr),
219 .adr_d = rt711_0_adr,
223 .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
224 .adr_d = rt1308_1_group1_adr,
228 .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
229 .adr_d = rt1308_2_group1_adr,
233 .num_adr = ARRAY_SIZE(rt715_3_adr),
234 .adr_d = rt715_3_adr,
239 static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
242 .num_adr = ARRAY_SIZE(rt711_0_adr),
243 .adr_d = rt711_0_adr,
247 .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
248 .adr_d = rt1308_1_single_adr,
252 .num_adr = ARRAY_SIZE(rt715_3_adr),
253 .adr_d = rt715_3_adr,
258 static const struct snd_soc_acpi_link_adr cml_3_in_1_sdca[] = {
261 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
262 .adr_d = rt711_sdca_0_adr,
266 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
267 .adr_d = rt1316_1_group1_adr,
271 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
272 .adr_d = rt1316_2_group1_adr,
276 .num_adr = ARRAY_SIZE(rt714_3_adr),
277 .adr_d = rt714_3_adr,
282 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {
284 .link_mask = 0xF, /* 4 active links required */
285 .links = cml_3_in_1_default,
286 .drv_name = "sof_sdw",
287 .sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
290 .link_mask = 0xF, /* 4 active links required */
291 .links = cml_3_in_1_sdca,
292 .drv_name = "sof_sdw",
293 .sof_tplg_filename = "sof-cml-rt711-rt1316-rt714.tplg",
297 * link_mask should be 0xB, but all links are enabled by BIOS.
298 * This entry will be selected if there is no rt1308 exposed
299 * on link2 since it will fail to match the above entry.
302 .links = cml_3_in_1_mono_amp,
303 .drv_name = "sof_sdw",
304 .sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
307 .link_mask = 0x2, /* RT700 connected on Link1 */
309 .drv_name = "sof_sdw",
310 .sof_tplg_filename = "sof-cml-rt700.tplg",
314 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);