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_max98357a",
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,
104 static const struct snd_soc_acpi_link_adr cml_rvp[] = {
107 .num_adr = ARRAY_SIZE(rt700_1_adr),
108 .adr_d = rt700_1_adr,
113 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
115 .adr = 0x000010025D071100,
117 .endpoints = &single_endpoint,
121 static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
123 .adr = 0x000110025D130800,
125 .endpoints = &single_endpoint,
129 static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
131 .adr = 0x000110025D130800,
133 .endpoints = &spk_l_endpoint,
137 static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
139 .adr = 0x000210025D130800,
141 .endpoints = &spk_r_endpoint,
145 static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
147 .adr = 0x000310025D071500,
149 .endpoints = &single_endpoint,
153 static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
156 .num_adr = ARRAY_SIZE(rt711_0_adr),
157 .adr_d = rt711_0_adr,
161 .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
162 .adr_d = rt1308_1_group1_adr,
166 .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
167 .adr_d = rt1308_2_group1_adr,
171 .num_adr = ARRAY_SIZE(rt715_3_adr),
172 .adr_d = rt715_3_adr,
177 static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
180 .num_adr = ARRAY_SIZE(rt711_0_adr),
181 .adr_d = rt711_0_adr,
185 .num_adr = ARRAY_SIZE(rt1308_1_adr),
186 .adr_d = rt1308_1_adr,
190 .num_adr = ARRAY_SIZE(rt715_3_adr),
191 .adr_d = rt715_3_adr,
196 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {
198 .link_mask = 0xF, /* 4 active links required */
199 .links = cml_3_in_1_default,
200 .drv_name = "sof_sdw",
201 .sof_fw_filename = "sof-cml.ri",
202 .sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
206 * link_mask should be 0xB, but all links are enabled by BIOS.
207 * This entry will be selected if there is no rt1308 exposed
208 * on link2 since it will fail to match the above entry.
211 .links = cml_3_in_1_mono_amp,
212 .drv_name = "sof_sdw",
213 .sof_fw_filename = "sof-cml.ri",
214 .sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
217 .link_mask = 0x2, /* RT700 connected on Link1 */
219 .drv_name = "sof_sdw",
220 .sof_fw_filename = "sof-cml.ri",
221 .sof_tplg_filename = "sof-cml-rt700.tplg",
225 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);
227 MODULE_LICENSE("GPL v2");
228 MODULE_DESCRIPTION("Intel Common ACPI Match module");