1 // SPDX-License-Identifier: GPL-2.0
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"}
23 * The order of the three entries with .id = "10EC5682" matters
24 * here, because DSDT tables expose an ACPI HID for the MAX98357A
25 * speaker amplifier which is not populated on the board.
27 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
30 .drv_name = "cml_rt1011_rt5682",
31 .machine_quirk = snd_soc_acpi_codec_list,
32 .quirk_data = &rt1011_spk_codecs,
33 .sof_fw_filename = "sof-cml.ri",
34 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
38 .drv_name = "sof_rt5682",
39 .machine_quirk = snd_soc_acpi_codec_list,
40 .quirk_data = &max98357a_spk_codecs,
41 .sof_fw_filename = "sof-cml.ri",
42 .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
46 .drv_name = "sof_rt5682",
47 .sof_fw_filename = "sof-cml.ri",
48 .sof_tplg_filename = "sof-cml-rt5682.tplg",
52 .drv_name = "cml_da7219_max98357a",
53 .machine_quirk = snd_soc_acpi_codec_list,
54 .quirk_data = &max98357a_spk_codecs,
55 .sof_fw_filename = "sof-cml.ri",
56 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
60 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);
62 static const struct snd_soc_acpi_endpoint single_endpoint = {
69 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
76 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
83 static const struct snd_soc_acpi_adr_device rt700_1_adr[] = {
85 .adr = 0x000110025D070000,
87 .endpoints = &single_endpoint,
91 static const struct snd_soc_acpi_link_adr cml_rvp[] = {
94 .num_adr = ARRAY_SIZE(rt700_1_adr),
100 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
102 .adr = 0x000010025D071100,
104 .endpoints = &single_endpoint,
108 static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
110 .adr = 0x000110025D130800,
112 .endpoints = &single_endpoint,
116 static const struct snd_soc_acpi_adr_device rt1308_2_adr[] = {
118 .adr = 0x000210025D130800,
120 .endpoints = &single_endpoint,
124 static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
126 .adr = 0x000110025D130800,
128 .endpoints = &spk_l_endpoint,
132 static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
134 .adr = 0x000210025D130800,
136 .endpoints = &spk_r_endpoint,
140 static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
142 .adr = 0x000310025D071500,
144 .endpoints = &single_endpoint,
148 static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
151 .num_adr = ARRAY_SIZE(rt711_0_adr),
152 .adr_d = rt711_0_adr,
156 .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
157 .adr_d = rt1308_1_group1_adr,
161 .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
162 .adr_d = rt1308_2_group1_adr,
166 .num_adr = ARRAY_SIZE(rt715_3_adr),
167 .adr_d = rt715_3_adr,
172 static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
175 .num_adr = ARRAY_SIZE(rt711_0_adr),
176 .adr_d = rt711_0_adr,
180 .num_adr = ARRAY_SIZE(rt1308_1_adr),
181 .adr_d = rt1308_1_adr,
185 .num_adr = ARRAY_SIZE(rt715_3_adr),
186 .adr_d = rt715_3_adr,
191 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {
193 .link_mask = 0xF, /* 4 active links required */
194 .links = cml_3_in_1_default,
195 .drv_name = "sof_sdw",
196 .sof_fw_filename = "sof-cml.ri",
197 .sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
201 * link_mask should be 0xB, but all links are enabled by BIOS.
202 * This entry will be selected if there is no rt1308 exposed
203 * on link2 since it will fail to match the above entry.
206 .links = cml_3_in_1_mono_amp,
207 .drv_name = "sof_sdw",
208 .sof_fw_filename = "sof-cml.ri",
209 .sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
212 .link_mask = 0x2, /* RT700 connected on Link1 */
214 .drv_name = "sof_sdw",
215 .sof_fw_filename = "sof-cml.ri",
216 .sof_tplg_filename = "sof-cml-rt700.tplg",
220 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);
222 MODULE_LICENSE("GPL v2");
223 MODULE_DESCRIPTION("Intel Common ACPI Match module");