WIP FPC-III support
[linux/fpc-iii.git] / sound / soc / intel / common / soc-acpi-intel-cml-match.c
blobadddc91918dfeb1e9c53e7fd7df0878157ba1dac
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * soc-acpi-intel-cml-match.c - tables and support for CML ACPI enumeration.
5 * Copyright (c) 2019, Intel Corporation.
7 */
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
12 static struct snd_soc_acpi_codecs rt1011_spk_codecs = {
13 .num_codecs = 1,
14 .codecs = {"10EC1011"}
17 static struct snd_soc_acpi_codecs rt1015_spk_codecs = {
18 .num_codecs = 1,
19 .codecs = {"10EC1015"}
22 static struct snd_soc_acpi_codecs max98357a_spk_codecs = {
23 .num_codecs = 1,
24 .codecs = {"MX98357A"}
27 static struct snd_soc_acpi_codecs max98390_spk_codecs = {
28 .num_codecs = 1,
29 .codecs = {"MX98390"}
33 * The order of the three entries with .id = "10EC5682" matters
34 * here, because DSDT tables expose an ACPI HID for the MAX98357A
35 * speaker amplifier which is not populated on the board.
37 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
39 .id = "10EC5682",
40 .drv_name = "cml_rt1011_rt5682",
41 .machine_quirk = snd_soc_acpi_codec_list,
42 .quirk_data = &rt1011_spk_codecs,
43 .sof_fw_filename = "sof-cml.ri",
44 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
47 .id = "10EC5682",
48 .drv_name = "cml_rt1015_rt5682",
49 .machine_quirk = snd_soc_acpi_codec_list,
50 .quirk_data = &rt1015_spk_codecs,
51 .sof_fw_filename = "sof-cml.ri",
52 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
55 .id = "10EC5682",
56 .drv_name = "sof_rt5682",
57 .machine_quirk = snd_soc_acpi_codec_list,
58 .quirk_data = &max98357a_spk_codecs,
59 .sof_fw_filename = "sof-cml.ri",
60 .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
63 .id = "10EC5682",
64 .drv_name = "sof_rt5682",
65 .sof_fw_filename = "sof-cml.ri",
66 .sof_tplg_filename = "sof-cml-rt5682.tplg",
69 .id = "DLGS7219",
70 .drv_name = "cml_da7219_max98357a",
71 .machine_quirk = snd_soc_acpi_codec_list,
72 .quirk_data = &max98357a_spk_codecs,
73 .sof_fw_filename = "sof-cml.ri",
74 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
77 .id = "DLGS7219",
78 .drv_name = "cml_da7219_max98357a",
79 .machine_quirk = snd_soc_acpi_codec_list,
80 .quirk_data = &max98390_spk_codecs,
81 .sof_fw_filename = "sof-cml.ri",
82 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
84 {},
86 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);
88 static const struct snd_soc_acpi_endpoint single_endpoint = {
89 .num = 0,
90 .aggregated = 0,
91 .group_position = 0,
92 .group_id = 0,
95 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
96 .num = 0,
97 .aggregated = 1,
98 .group_position = 0,
99 .group_id = 1,
102 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
103 .num = 0,
104 .aggregated = 1,
105 .group_position = 1,
106 .group_id = 1,
109 static const struct snd_soc_acpi_adr_device rt700_1_adr[] = {
111 .adr = 0x000110025D070000,
112 .num_endpoints = 1,
113 .endpoints = &single_endpoint,
114 .name_prefix = "rt700"
118 static const struct snd_soc_acpi_link_adr cml_rvp[] = {
120 .mask = BIT(1),
121 .num_adr = ARRAY_SIZE(rt700_1_adr),
122 .adr_d = rt700_1_adr,
127 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
129 .adr = 0x000020025D071100,
130 .num_endpoints = 1,
131 .endpoints = &single_endpoint,
132 .name_prefix = "rt711"
136 static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
138 .adr = 0x000120025D130800,
139 .num_endpoints = 1,
140 .endpoints = &single_endpoint,
141 .name_prefix = "rt1308-1"
145 static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
147 .adr = 0x000120025D130800,
148 .num_endpoints = 1,
149 .endpoints = &spk_l_endpoint,
150 .name_prefix = "rt1308-1"
154 static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
156 .adr = 0x000220025D130800,
157 .num_endpoints = 1,
158 .endpoints = &spk_r_endpoint,
159 .name_prefix = "rt1308-2"
163 static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
165 .adr = 0x000320025D071500,
166 .num_endpoints = 1,
167 .endpoints = &single_endpoint,
168 .name_prefix = "rt715"
172 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
174 .adr = 0x000030025D071101,
175 .num_endpoints = 1,
176 .endpoints = &single_endpoint,
177 .name_prefix = "rt711"
181 static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {
183 .adr = 0x000131025D131601, /* unique ID is set for some reason */
184 .num_endpoints = 1,
185 .endpoints = &spk_l_endpoint,
186 .name_prefix = "rt1316-1"
190 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
192 .adr = 0x000230025D131601,
193 .num_endpoints = 1,
194 .endpoints = &spk_r_endpoint,
195 .name_prefix = "rt1316-2"
199 static const struct snd_soc_acpi_adr_device rt714_3_adr[] = {
201 .adr = 0x000330025D071401,
202 .num_endpoints = 1,
203 .endpoints = &single_endpoint,
204 .name_prefix = "rt714"
208 static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
210 .mask = BIT(0),
211 .num_adr = ARRAY_SIZE(rt711_0_adr),
212 .adr_d = rt711_0_adr,
215 .mask = BIT(1),
216 .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
217 .adr_d = rt1308_1_group1_adr,
220 .mask = BIT(2),
221 .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
222 .adr_d = rt1308_2_group1_adr,
225 .mask = BIT(3),
226 .num_adr = ARRAY_SIZE(rt715_3_adr),
227 .adr_d = rt715_3_adr,
232 static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
234 .mask = BIT(0),
235 .num_adr = ARRAY_SIZE(rt711_0_adr),
236 .adr_d = rt711_0_adr,
239 .mask = BIT(1),
240 .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
241 .adr_d = rt1308_1_single_adr,
244 .mask = BIT(3),
245 .num_adr = ARRAY_SIZE(rt715_3_adr),
246 .adr_d = rt715_3_adr,
251 static const struct snd_soc_acpi_link_adr cml_3_in_1_sdca[] = {
253 .mask = BIT(0),
254 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
255 .adr_d = rt711_sdca_0_adr,
258 .mask = BIT(1),
259 .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
260 .adr_d = rt1316_1_group1_adr,
263 .mask = BIT(2),
264 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
265 .adr_d = rt1316_2_group1_adr,
268 .mask = BIT(3),
269 .num_adr = ARRAY_SIZE(rt714_3_adr),
270 .adr_d = rt714_3_adr,
275 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {
277 .link_mask = 0xF, /* 4 active links required */
278 .links = cml_3_in_1_default,
279 .drv_name = "sof_sdw",
280 .sof_fw_filename = "sof-cml.ri",
281 .sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
284 .link_mask = 0xF, /* 4 active links required */
285 .links = cml_3_in_1_sdca,
286 .drv_name = "sof_sdw",
287 .sof_fw_filename = "sof-cml.ri",
288 .sof_tplg_filename = "sof-cml-rt711-rt1316-rt714.tplg",
292 * link_mask should be 0xB, but all links are enabled by BIOS.
293 * This entry will be selected if there is no rt1308 exposed
294 * on link2 since it will fail to match the above entry.
296 .link_mask = 0xF,
297 .links = cml_3_in_1_mono_amp,
298 .drv_name = "sof_sdw",
299 .sof_fw_filename = "sof-cml.ri",
300 .sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
303 .link_mask = 0x2, /* RT700 connected on Link1 */
304 .links = cml_rvp,
305 .drv_name = "sof_sdw",
306 .sof_fw_filename = "sof-cml.ri",
307 .sof_tplg_filename = "sof-cml-rt700.tplg",
311 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);
313 MODULE_LICENSE("GPL v2");
314 MODULE_DESCRIPTION("Intel Common ACPI Match module");