Path: blob/master/sound/soc/intel/common/soc-acpi-intel-cht-match.c
26493 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* soc-acpi-intel-cht-match.c - tables and support for CHT ACPI enumeration.3*4* Copyright (c) 2017, Intel Corporation.5*/67#include <linux/dmi.h>8#include <sound/soc-acpi.h>9#include <sound/soc-acpi-intel-match.h>1011static unsigned long cht_machine_id;1213#define CHT_SURFACE_MACH 11415static int cht_surface_quirk_cb(const struct dmi_system_id *id)16{17cht_machine_id = CHT_SURFACE_MACH;18return 1;19}2021static const struct dmi_system_id cht_table[] = {22{23.callback = cht_surface_quirk_cb,24.matches = {25DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),26DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),27},28},29{ }30};3132static struct snd_soc_acpi_mach cht_surface_mach = {33.id = "10EC5640",34.drv_name = "cht-bsw-rt5645",35.fw_filename = "intel/fw_sst_22a8.bin",36.board = "cht-bsw",37.sof_tplg_filename = "sof-cht-rt5645.tplg",38};3940static struct snd_soc_acpi_mach *cht_quirk(void *arg)41{42struct snd_soc_acpi_mach *mach = arg;4344dmi_check_system(cht_table);4546if (cht_machine_id == CHT_SURFACE_MACH)47return &cht_surface_mach;48else49return mach;50}5152/*53* Some tablets with Android factory OS have buggy DSDTs with an ESSX8316 device54* in the ACPI tables. While they are not using an ESS8316 codec. These DSDTs55* also have an ACPI device for the correct codec, ignore the ESSX8316.56*/57static const struct dmi_system_id cht_ess8316_not_present_table[] = {58{59/* Nextbook Ares 8A */60.matches = {61DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),62DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),63DMI_MATCH(DMI_BIOS_VERSION, "M882"),64},65},66{ }67};6869static struct snd_soc_acpi_mach *cht_ess8316_quirk(void *arg)70{71if (dmi_check_system(cht_ess8316_not_present_table))72return NULL;7374return arg;75}7677/*78* The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS has a buggy DSDT79* with the coded not being listed at all.80*/81static const struct dmi_system_id lenovo_yoga_tab3_x90[] = {82{83/* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */84.matches = {85DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),86DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),87},88},89{ }90};9192static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach = {93.id = "10WM5102",94.drv_name = "bytcr_wm5102",95.fw_filename = "intel/fw_sst_22a8.bin",96.board = "bytcr_wm5102",97.sof_tplg_filename = "sof-cht-wm5102.tplg",98};99100static struct snd_soc_acpi_mach *lenovo_yt3_x90_quirk(void *arg)101{102if (dmi_check_system(lenovo_yoga_tab3_x90))103return &cht_lenovo_yoga_tab3_x90_mach;104105/* Skip wildcard match snd_soc_acpi_intel_cherrytrail_machines[] entry */106return NULL;107}108109static const struct snd_soc_acpi_codecs rt5640_comp_ids = {110.num_codecs = 2,111.codecs = { "10EC5640", "10EC3276" },112};113114static const struct snd_soc_acpi_codecs rt5670_comp_ids = {115.num_codecs = 2,116.codecs = { "10EC5670", "10EC5672" },117};118119static const struct snd_soc_acpi_codecs rt5645_comp_ids = {120.num_codecs = 3,121.codecs = { "10EC5645", "10EC5650", "10EC3270" },122};123124static const struct snd_soc_acpi_codecs da7213_comp_ids = {125.num_codecs = 2,126.codecs = { "DGLS7212", "DGLS7213"},127128};129130/* Cherryview-based platforms: CherryTrail and Braswell */131struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[] = {132{133.comp_ids = &rt5670_comp_ids,134.drv_name = "cht-bsw-rt5672",135.fw_filename = "intel/fw_sst_22a8.bin",136.board = "cht-bsw",137.sof_tplg_filename = "sof-cht-rt5670.tplg",138},139{140.comp_ids = &rt5645_comp_ids,141.drv_name = "cht-bsw-rt5645",142.fw_filename = "intel/fw_sst_22a8.bin",143.board = "cht-bsw",144.sof_tplg_filename = "sof-cht-rt5645.tplg",145},146{147.id = "193C9890",148.drv_name = "cht-bsw-max98090",149.fw_filename = "intel/fw_sst_22a8.bin",150.board = "cht-bsw",151.sof_tplg_filename = "sof-cht-max98090.tplg",152},153{154.id = "10508824",155.drv_name = "cht-bsw-nau8824",156.fw_filename = "intel/fw_sst_22a8.bin",157.board = "cht-bsw",158.sof_tplg_filename = "sof-cht-nau8824.tplg",159},160{161.comp_ids = &da7213_comp_ids,162.drv_name = "bytcht_da7213",163.fw_filename = "intel/fw_sst_22a8.bin",164.board = "bytcht_da7213",165.sof_tplg_filename = "sof-cht-da7213.tplg",166},167{168.id = "ESSX8316",169.drv_name = "bytcht_es8316",170.fw_filename = "intel/fw_sst_22a8.bin",171.board = "bytcht_es8316",172.machine_quirk = cht_ess8316_quirk,173.sof_tplg_filename = "sof-cht-es8316.tplg",174},175/* some CHT-T platforms rely on RT5640, use Baytrail machine driver */176{177.comp_ids = &rt5640_comp_ids,178.drv_name = "bytcr_rt5640",179.fw_filename = "intel/fw_sst_22a8.bin",180.board = "bytcr_rt5640",181.machine_quirk = cht_quirk,182.sof_tplg_filename = "sof-cht-rt5640.tplg",183},184{185.id = "10EC5682",186.drv_name = "sof_rt5682",187.sof_tplg_filename = "sof-cht-rt5682.tplg",188},189/* some CHT-T platforms rely on RT5651, use Baytrail machine driver */190{191.id = "10EC5651",192.drv_name = "bytcr_rt5651",193.fw_filename = "intel/fw_sst_22a8.bin",194.board = "bytcr_rt5651",195.sof_tplg_filename = "sof-cht-rt5651.tplg",196},197{198.id = "14F10720",199.drv_name = "bytcht_cx2072x",200.fw_filename = "intel/fw_sst_22a8.bin",201.board = "bytcht_cx2072x",202.sof_tplg_filename = "sof-cht-cx2072x.tplg",203},204{205.id = "104C5122",206.drv_name = "sof_pcm512x",207.sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg",208},209/*210* Special case for the Lenovo Yoga Tab 3 Pro YT3-X90 where the DSDT211* misses the codec. Match on the SST id instead, lenovo_yt3_x90_quirk()212* will return a YT3 specific mach or NULL when called on other hw,213* skipping this entry.214*/215{216.id = "808622A8",217.machine_quirk = lenovo_yt3_x90_quirk,218},219220#if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)221/*222* This is always last in the table so that it is selected only when223* enabled explicitly and there is no codec-related information in SSDT224*/225{226.id = "808622A8",227.drv_name = "bytcht_nocodec",228.fw_filename = "intel/fw_sst_22a8.bin",229.board = "bytcht_nocodec",230},231#endif232{},233};234EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cherrytrail_machines);235236237