Skip to content

Commit 2cb5478

Browse files
jwrdegoedebroonie
authored andcommitted
ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk
The Lenovo Yoga Tab 3 Pro YT3-X90 x86 tablet, which ships with Android with a custom kernel as factory OS, does not list the used WM5102 codec inside its DSDT. Workaround this with a new snd_soc_acpi_intel_baytrail_machines[] entry which matches on the SST id instead of the codec id like nocodec does, combined with using a machine_quirk callback which returns NULL on other machines to skip the new entry on other machines. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20231021211534.114991-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2e2a161 commit 2cb5478

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

sound/soc/intel/common/soc-acpi-intel-cht-match.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,39 @@ static struct snd_soc_acpi_mach *cht_ess8316_quirk(void *arg)
7575
return arg;
7676
}
7777

78+
/*
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.
81+
*/
82+
static const struct dmi_system_id lenovo_yoga_tab3_x90[] = {
83+
{
84+
/* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */
85+
.matches = {
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"),
89+
},
90+
},
91+
{ }
92+
};
93+
94+
static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach = {
95+
.id = "10WM5102",
96+
.drv_name = "bytcr_wm5102",
97+
.fw_filename = "intel/fw_sst_22a8.bin",
98+
.board = "bytcr_wm5102",
99+
.sof_tplg_filename = "sof-cht-wm5102.tplg",
100+
};
101+
102+
static struct snd_soc_acpi_mach *lenovo_yt3_x90_quirk(void *arg)
103+
{
104+
if (dmi_check_system(lenovo_yoga_tab3_x90))
105+
return &cht_lenovo_yoga_tab3_x90_mach;
106+
107+
/* Skip wildcard match snd_soc_acpi_intel_cherrytrail_machines[] entry */
108+
return NULL;
109+
}
110+
78111
static const struct snd_soc_acpi_codecs rt5640_comp_ids = {
79112
.num_codecs = 2,
80113
.codecs = { "10EC5640", "10EC3276" },
@@ -175,6 +208,16 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[] = {
175208
.drv_name = "sof_pcm512x",
176209
.sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg",
177210
},
211+
/*
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.
216+
*/
217+
{
218+
.id = "808622A8",
219+
.machine_quirk = lenovo_yt3_x90_quirk,
220+
},
178221

179222
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
180223
/*

0 commit comments

Comments
 (0)