Skip to content

Commit 109cb21

Browse files
jwrdegoedebroonie
authored andcommitted
ASoC: Intel: bytcr_wm5102: Add support for Lenovo Yoga Tab 3 Pro YT3-X90
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. So acpi_dev_get_first_match_dev() is going to fail on this board. Fallback to using "spi-$(mach->id)" as codec device name in this case to allow bytcr_wm5102 to work on these tablets. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20231021211534.114991-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2cb5478 commit 109cb21

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

sound/soc/intel/boards/bytcr_wm5102.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,15 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
413413
*/
414414
mach = dev->platform_data;
415415
adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);
416-
if (!adev) {
417-
dev_err(dev, "Error cannot find acpi-dev for codec\n");
418-
return -ENOENT;
416+
if (adev) {
417+
snprintf(codec_name, sizeof(codec_name), "spi-%s", acpi_dev_name(adev));
418+
acpi_dev_put(adev);
419+
} else {
420+
/* Special case for when the codec is missing from the DSTD */
421+
strscpy(codec_name, "spi1.0", sizeof(codec_name));
419422
}
420-
snprintf(codec_name, sizeof(codec_name), "spi-%s", acpi_dev_name(adev));
421423

422424
codec_dev = bus_find_device_by_name(&spi_bus_type, NULL, codec_name);
423-
acpi_dev_put(adev);
424425
if (!codec_dev)
425426
return -EPROBE_DEFER;
426427

0 commit comments

Comments
 (0)