1 // SPDX-License-Identifier: GPL-2.0-only
3 * soc-acpi-intel-cht-match.c - tables and support for CHT ACPI enumeration.
5 * Copyright (c) 2017, Intel Corporation.
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
12 static unsigned long cht_machine_id;
14 #define CHT_SURFACE_MACH 1
16 static int cht_surface_quirk_cb(const struct dmi_system_id *id)
18 cht_machine_id = CHT_SURFACE_MACH;
22 static const struct dmi_system_id cht_table[] = {
24 .callback = cht_surface_quirk_cb,
26 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
27 DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
33 static struct snd_soc_acpi_mach cht_surface_mach = {
35 .drv_name = "cht-bsw-rt5645",
36 .fw_filename = "/*(DEBLOBBED)*/",
38 .sof_tplg_filename = "sof-cht-rt5645.tplg",
41 static struct snd_soc_acpi_mach *cht_quirk(void *arg)
43 struct snd_soc_acpi_mach *mach = arg;
45 dmi_check_system(cht_table);
47 if (cht_machine_id == CHT_SURFACE_MACH)
48 return &cht_surface_mach;
54 * Some tablets with Android factory OS have buggy DSDTs with an ESSX8316 device
55 * in the ACPI tables. While they are not using an ESS8316 codec. These DSDTs
56 * also have an ACPI device for the correct codec, ignore the ESSX8316.
58 static const struct dmi_system_id cht_ess8316_not_present_table[] = {
60 /* Nextbook Ares 8A */
62 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
63 DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
64 DMI_MATCH(DMI_BIOS_VERSION, "M882"),
70 static struct snd_soc_acpi_mach *cht_ess8316_quirk(void *arg)
72 if (dmi_check_system(cht_ess8316_not_present_table))
79 * The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS has a buggy DSDT
80 * with the coded not being listed at all.
82 static const struct dmi_system_id lenovo_yoga_tab3_x90[] = {
84 /* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */
86 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
87 DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
88 DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
94 static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach = {
96 .drv_name = "bytcr_wm5102",
97 .fw_filename = "/*(DEBLOBBED)*/",
98 .board = "bytcr_wm5102",
99 .sof_tplg_filename = "sof-cht-wm5102.tplg",
102 static struct snd_soc_acpi_mach *lenovo_yt3_x90_quirk(void *arg)
104 if (dmi_check_system(lenovo_yoga_tab3_x90))
105 return &cht_lenovo_yoga_tab3_x90_mach;
107 /* Skip wildcard match snd_soc_acpi_intel_cherrytrail_machines[] entry */
111 static const struct snd_soc_acpi_codecs rt5640_comp_ids = {
113 .codecs = { "10EC5640", "10EC3276" },
116 static const struct snd_soc_acpi_codecs rt5670_comp_ids = {
118 .codecs = { "10EC5670", "10EC5672" },
121 static const struct snd_soc_acpi_codecs rt5645_comp_ids = {
123 .codecs = { "10EC5645", "10EC5650", "10EC3270" },
126 static const struct snd_soc_acpi_codecs da7213_comp_ids = {
128 .codecs = { "DGLS7212", "DGLS7213"},
132 /* Cherryview-based platforms: CherryTrail and Braswell */
133 struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[] = {
135 .comp_ids = &rt5670_comp_ids,
136 .drv_name = "cht-bsw-rt5672",
137 .fw_filename = "/*(DEBLOBBED)*/",
139 .sof_tplg_filename = "sof-cht-rt5670.tplg",
142 .comp_ids = &rt5645_comp_ids,
143 .drv_name = "cht-bsw-rt5645",
144 .fw_filename = "/*(DEBLOBBED)*/",
146 .sof_tplg_filename = "sof-cht-rt5645.tplg",
150 .drv_name = "cht-bsw-max98090",
151 .fw_filename = "/*(DEBLOBBED)*/",
153 .sof_tplg_filename = "sof-cht-max98090.tplg",
157 .drv_name = "cht-bsw-nau8824",
158 .fw_filename = "/*(DEBLOBBED)*/",
160 .sof_tplg_filename = "sof-cht-nau8824.tplg",
163 .comp_ids = &da7213_comp_ids,
164 .drv_name = "bytcht_da7213",
165 .fw_filename = "/*(DEBLOBBED)*/",
166 .board = "bytcht_da7213",
167 .sof_tplg_filename = "sof-cht-da7213.tplg",
171 .drv_name = "bytcht_es8316",
172 .fw_filename = "/*(DEBLOBBED)*/",
173 .board = "bytcht_es8316",
174 .machine_quirk = cht_ess8316_quirk,
175 .sof_tplg_filename = "sof-cht-es8316.tplg",
177 /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */
179 .comp_ids = &rt5640_comp_ids,
180 .drv_name = "bytcr_rt5640",
181 .fw_filename = "/*(DEBLOBBED)*/",
182 .board = "bytcr_rt5640",
183 .machine_quirk = cht_quirk,
184 .sof_tplg_filename = "sof-cht-rt5640.tplg",
188 .drv_name = "sof_rt5682",
189 .sof_tplg_filename = "sof-cht-rt5682.tplg",
191 /* some CHT-T platforms rely on RT5651, use Baytrail machine driver */
194 .drv_name = "bytcr_rt5651",
195 .fw_filename = "/*(DEBLOBBED)*/",
196 .board = "bytcr_rt5651",
197 .sof_tplg_filename = "sof-cht-rt5651.tplg",
201 .drv_name = "bytcht_cx2072x",
202 .fw_filename = "/*(DEBLOBBED)*/",
203 .board = "bytcht_cx2072x",
204 .sof_tplg_filename = "sof-cht-cx2072x.tplg",
208 .drv_name = "sof_pcm512x",
209 .sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg",
212 * Special case for the Lenovo Yoga Tab 3 Pro YT3-X90 where the DSDT
213 * misses the codec. Match on the SST id instead, lenovo_yt3_x90_quirk()
214 * will return a YT3 specific mach or NULL when called on other hw,
215 * skipping this entry.
219 .machine_quirk = lenovo_yt3_x90_quirk,
222 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
224 * This is always last in the table so that it is selected only when
225 * enabled explicitly and there is no codec-related information in SSDT
229 .drv_name = "bytcht_nocodec",
230 .fw_filename = "/*(DEBLOBBED)*/",
231 .board = "bytcht_nocodec",
236 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cherrytrail_machines);