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 struct snd_soc_acpi_codecs rt1011_spk_codecs = {
14 .codecs = {"10EC1011"}
17 static struct snd_soc_acpi_codecs max98357a_spk_codecs = {
19 .codecs = {"MX98357A"}
22 static struct snd_soc_acpi_codecs max98390_spk_codecs = {
28 * The order of the three entries with .id = "10EC5682" matters
29 * here, because DSDT tables expose an ACPI HID for the MAX98357A
30 * speaker amplifier which is not populated on the board.
32 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
35 .drv_name = "cml_rt1011_rt5682",
36 .machine_quirk = snd_soc_acpi_codec_list,
37 .quirk_data = &rt1011_spk_codecs,
38 .sof_fw_filename = "sof-cml.ri",
39 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
43 .drv_name = "sof_rt5682",
44 .machine_quirk = snd_soc_acpi_codec_list,
45 .quirk_data = &max98357a_spk_codecs,
46 .sof_fw_filename = "sof-cml.ri",
47 .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
51 .drv_name = "sof_rt5682",
52 .sof_fw_filename = "sof-cml.ri",
53 .sof_tplg_filename = "sof-cml-rt5682.tplg",
57 .drv_name = "cml_da7219_max98357a",
58 .machine_quirk = snd_soc_acpi_codec_list,
59 .quirk_data = &max98357a_spk_codecs,
60 .sof_fw_filename = "sof-cml.ri",
61 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
65 .drv_name = "cml_da7219_mx98357a",
66 .machine_quirk = snd_soc_acpi_codec_list,
67 .quirk_data = &max98390_spk_codecs,
68 .sof_fw_filename = "sof-cml.ri",
69 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
73 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);
75 static const struct snd_soc_acpi_endpoint single_endpoint = {
82 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
89 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
96 static const struct snd_soc_acpi_adr_device rt700_1_adr[] = {
98 .adr = 0x000110025D070000,
100 .endpoints = &single_endpoint,
101 .name_prefix = "rt700"
105 static const struct snd_soc_acpi_link_adr cml_rvp[] = {
108 .num_adr = ARRAY_SIZE(rt700_1_adr),
109 .adr_d = rt700_1_adr,
114 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
116 .adr = 0x000020025D071100,
118 .endpoints = &single_endpoint,
119 .name_prefix = "rt711"
123 static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
125 .adr = 0x000120025D130800,
127 .endpoints = &single_endpoint,
128 .name_prefix = "rt1308-1"
132 static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
134 .adr = 0x000120025D130800,
136 .endpoints = &spk_l_endpoint,
137 .name_prefix = "rt1308-1"
141 static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
143 .adr = 0x000220025D130800,
145 .endpoints = &spk_r_endpoint,
146 .name_prefix = "rt1308-2"
150 static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
152 .adr = 0x000320025D071500,
154 .endpoints = &single_endpoint,
155 .name_prefix = "rt715"
159 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
161 .adr = 0x000030025D071101,
163 .endpoints = &single_endpoint,
164 .name_prefix = "rt711"
168 static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {
170 .adr = 0x000131025D131601, /* unique ID is set for some reason */
172 .endpoints = &spk_l_endpoint,
173 .name_prefix = "rt1316-1"
177 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
179 .adr = 0x000230025D131601,
181 .endpoints = &spk_r_endpoint,
182 .name_prefix = "rt1316-2"
186 static const struct snd_soc_acpi_adr_device rt714_3_adr[] = {
188 .adr = 0x000330025D071401,
190 .endpoints = &single_endpoint,
191 .name_prefix = "rt714"
195 static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
198 .num_adr = ARRAY_SIZE(rt711_0_adr),
199 .adr_d = rt711_0_adr,
203 .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
204 .adr_d = rt1308_1_group1_adr,
208 .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
209 .adr_d = rt1308_2_group1_adr,
213 .num_adr = ARRAY_SIZE(rt715_3_adr),
214 .adr_d = rt715_3_adr,
219 static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
222 .num_adr = ARRAY_SIZE(rt711_0_adr),
223 .adr_d = rt711_0_adr,
227 .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
228 .adr_d = rt1308_1_single_adr,
232 .num_adr = ARRAY_SIZE(rt715_3_adr),
233 .adr_d = rt715_3_adr,
238 static const struct snd_soc_acpi_link_adr cml_3_in_1_sdca[] = {
241 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
242 .adr_d = rt711_sdca_0_adr,
246 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
247 .adr_d = rt1316_1_group1_adr,
251 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
252 .adr_d = rt1316_2_group1_adr,
256 .num_adr = ARRAY_SIZE(rt714_3_adr),
257 .adr_d = rt714_3_adr,
262 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {
264 .link_mask = 0xF, /* 4 active links required */
265 .links = cml_3_in_1_default,
266 .drv_name = "sof_sdw",
267 .sof_fw_filename = "sof-cml.ri",
268 .sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
271 .link_mask = 0xF, /* 4 active links required */
272 .links = cml_3_in_1_sdca,
273 .drv_name = "sof_sdw",
274 .sof_fw_filename = "sof-cml.ri",
275 .sof_tplg_filename = "sof-cml-rt711-rt1316-rt714.tplg",
279 * link_mask should be 0xB, but all links are enabled by BIOS.
280 * This entry will be selected if there is no rt1308 exposed
281 * on link2 since it will fail to match the above entry.
284 .links = cml_3_in_1_mono_amp,
285 .drv_name = "sof_sdw",
286 .sof_fw_filename = "sof-cml.ri",
287 .sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
290 .link_mask = 0x2, /* RT700 connected on Link1 */
292 .drv_name = "sof_sdw",
293 .sof_fw_filename = "sof-cml.ri",
294 .sof_tplg_filename = "sof-cml-rt700.tplg",
298 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);
300 MODULE_LICENSE("GPL v2");
301 MODULE_DESCRIPTION("Intel Common ACPI Match module");