Skip to content

Commit

Permalink
ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk
Browse files Browse the repository at this point in the history
[ Upstream commit 2cb5478 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jwrdegoede authored and gregkh committed Nov 28, 2023
1 parent cbf304d commit a70cb0d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-cht-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,39 @@ static struct snd_soc_acpi_mach *cht_ess8316_quirk(void *arg)
return arg;
}

/*
* The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS has a buggy DSDT
* with the coded not being listed at all.
*/
static const struct dmi_system_id lenovo_yoga_tab3_x90[] = {
{
/* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
},
},
{ }
};

static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach = {
.id = "10WM5102",
.drv_name = "bytcr_wm5102",
.fw_filename = "intel/fw_sst_22a8.bin",
.board = "bytcr_wm5102",
.sof_tplg_filename = "sof-cht-wm5102.tplg",
};

static struct snd_soc_acpi_mach *lenovo_yt3_x90_quirk(void *arg)
{
if (dmi_check_system(lenovo_yoga_tab3_x90))
return &cht_lenovo_yoga_tab3_x90_mach;

/* Skip wildcard match snd_soc_acpi_intel_cherrytrail_machines[] entry */
return NULL;
}

static const struct snd_soc_acpi_codecs rt5640_comp_ids = {
.num_codecs = 2,
.codecs = { "10EC5640", "10EC3276" },
Expand Down Expand Up @@ -175,6 +208,16 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[] = {
.drv_name = "sof_pcm512x",
.sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg",
},
/*
* Special case for the Lenovo Yoga Tab 3 Pro YT3-X90 where the DSDT
* misses the codec. Match on the SST id instead, lenovo_yt3_x90_quirk()
* will return a YT3 specific mach or NULL when called on other hw,
* skipping this entry.
*/
{
.id = "808622A8",
.machine_quirk = lenovo_yt3_x90_quirk,
},

#if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
/*
Expand Down

0 comments on commit a70cb0d

Please sign in to comment.