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 rt1015_spk_codecs
= {
19 .codecs
= {"10EC1015"}
22 static struct snd_soc_acpi_codecs max98357a_spk_codecs
= {
24 .codecs
= {"MX98357A"}
27 static struct snd_soc_acpi_codecs max98390_spk_codecs
= {
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
[] = {
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",
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",
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",
64 .drv_name
= "sof_rt5682",
65 .sof_fw_filename
= "sof-cml.ri",
66 .sof_tplg_filename
= "sof-cml-rt5682.tplg",
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",
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",
86 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines
);
88 static const struct snd_soc_acpi_endpoint single_endpoint
= {
95 static const struct snd_soc_acpi_endpoint spk_l_endpoint
= {
102 static const struct snd_soc_acpi_endpoint spk_r_endpoint
= {
109 static const struct snd_soc_acpi_adr_device rt700_1_adr
[] = {
111 .adr
= 0x000110025D070000,
113 .endpoints
= &single_endpoint
,
114 .name_prefix
= "rt700"
118 static const struct snd_soc_acpi_link_adr cml_rvp
[] = {
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,
131 .endpoints
= &single_endpoint
,
132 .name_prefix
= "rt711"
136 static const struct snd_soc_acpi_adr_device rt1308_1_single_adr
[] = {
138 .adr
= 0x000120025D130800,
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,
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,
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,
167 .endpoints
= &single_endpoint
,
168 .name_prefix
= "rt715"
172 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr
[] = {
174 .adr
= 0x000030025D071101,
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 */
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,
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,
203 .endpoints
= &single_endpoint
,
204 .name_prefix
= "rt714"
208 static const struct snd_soc_acpi_link_adr cml_3_in_1_default
[] = {
211 .num_adr
= ARRAY_SIZE(rt711_0_adr
),
212 .adr_d
= rt711_0_adr
,
216 .num_adr
= ARRAY_SIZE(rt1308_1_group1_adr
),
217 .adr_d
= rt1308_1_group1_adr
,
221 .num_adr
= ARRAY_SIZE(rt1308_2_group1_adr
),
222 .adr_d
= rt1308_2_group1_adr
,
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
[] = {
235 .num_adr
= ARRAY_SIZE(rt711_0_adr
),
236 .adr_d
= rt711_0_adr
,
240 .num_adr
= ARRAY_SIZE(rt1308_1_single_adr
),
241 .adr_d
= rt1308_1_single_adr
,
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
[] = {
254 .num_adr
= ARRAY_SIZE(rt711_sdca_0_adr
),
255 .adr_d
= rt711_sdca_0_adr
,
259 .num_adr
= ARRAY_SIZE(rt1316_1_group1_adr
),
260 .adr_d
= rt1316_1_group1_adr
,
264 .num_adr
= ARRAY_SIZE(rt1316_2_group1_adr
),
265 .adr_d
= rt1316_2_group1_adr
,
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.
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 */
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");