Path: blob/master/sound/soc/intel/common/soc-acpi-intel-byt-match.c
26493 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* soc-acpi-intel-byt-match.c - tables and support for BYT 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 byt_machine_id;1213#define BYT_RT5672 114#define BYT_POV_P1006W 21516static int byt_rt5672_quirk_cb(const struct dmi_system_id *id)17{18byt_machine_id = BYT_RT5672;19return 1;20}2122static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id)23{24byt_machine_id = BYT_POV_P1006W;25return 1;26}2728static const struct dmi_system_id byt_table[] = {29{30.callback = byt_rt5672_quirk_cb,31.matches = {32DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),33DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"),34},35},36{37.callback = byt_rt5672_quirk_cb,38.matches = {39DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),40DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),41},42},43{44.callback = byt_rt5672_quirk_cb,45.matches = {46DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),47DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),48},49},50{51.callback = byt_rt5672_quirk_cb,52.matches = {53DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),54DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),55},56},57{58/* Point of View mobii wintab p1006w (v1.0) */59.callback = byt_pov_p1006w_quirk_cb,60.matches = {61DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),62DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),63/* Note 105b is Foxcon's USB/PCI vendor id */64DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),65DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),66},67},68{69/* Aegex 10 tablet (RU2) */70.callback = byt_rt5672_quirk_cb,71.matches = {72DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),73DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),74},75},76{77/* Dell Venue 10 Pro 5055 */78.callback = byt_rt5672_quirk_cb,79.matches = {80DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),81DMI_MATCH(DMI_PRODUCT_NAME, "Venue 10 Pro 5055"),82},83},84{ }85};8687/* Various devices use an ACPI id of 10EC5640 while using a rt5672 codec */88static struct snd_soc_acpi_mach byt_rt5672 = {89.id = "10EC5640",90.drv_name = "cht-bsw-rt5672",91.fw_filename = "intel/fw_sst_0f28.bin",92.board = "cht-bsw",93.sof_tplg_filename = "sof-byt-rt5670.tplg",94};9596static struct snd_soc_acpi_mach byt_pov_p1006w = {97.id = "10EC5640",98.drv_name = "bytcr_rt5651",99.fw_filename = "intel/fw_sst_0f28.bin",100.board = "bytcr_rt5651",101.sof_tplg_filename = "sof-byt-rt5651.tplg",102};103104static struct snd_soc_acpi_mach *byt_quirk(void *arg)105{106struct snd_soc_acpi_mach *mach = arg;107108dmi_check_system(byt_table);109110switch (byt_machine_id) {111case BYT_RT5672:112return &byt_rt5672;113case BYT_POV_P1006W:114return &byt_pov_p1006w;115default:116return mach;117}118}119120static const struct snd_soc_acpi_codecs rt5640_comp_ids = {121.num_codecs = 3,122.codecs = { "10EC5640", "10EC5642", "INTCCFFD"},123};124125static const struct snd_soc_acpi_codecs wm5102_comp_ids = {126.num_codecs = 3,127.codecs = { "10WM5102", "WM510204", "WM510205"},128};129130static const struct snd_soc_acpi_codecs da7213_comp_ids = {131.num_codecs = 2,132.codecs = { "DGLS7212", "DGLS7213"},133};134135static const struct snd_soc_acpi_codecs rt5645_comp_ids = {136.num_codecs = 2,137.codecs = { "10EC5645", "10EC5648"},138};139140struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[] = {141{142.comp_ids = &rt5640_comp_ids,143.drv_name = "bytcr_rt5640",144.fw_filename = "intel/fw_sst_0f28.bin",145.board = "bytcr_rt5640",146.machine_quirk = byt_quirk,147.sof_tplg_filename = "sof-byt-rt5640.tplg",148},149{150.id = "10EC5651",151.drv_name = "bytcr_rt5651",152.fw_filename = "intel/fw_sst_0f28.bin",153.board = "bytcr_rt5651",154.sof_tplg_filename = "sof-byt-rt5651.tplg",155},156{157.comp_ids = &wm5102_comp_ids,158.drv_name = "bytcr_wm5102",159.fw_filename = "intel/fw_sst_0f28.bin",160.board = "bytcr_wm5102",161.sof_tplg_filename = "sof-byt-wm5102.tplg",162},163{164.comp_ids = &da7213_comp_ids,165.drv_name = "bytcht_da7213",166.fw_filename = "intel/fw_sst_0f28.bin",167.board = "bytcht_da7213",168.sof_tplg_filename = "sof-byt-da7213.tplg",169},170{171.id = "ESSX8316",172.drv_name = "bytcht_es8316",173.fw_filename = "intel/fw_sst_0f28.bin",174.board = "bytcht_es8316",175.sof_tplg_filename = "sof-byt-es8316.tplg",176},177{178.id = "10EC5682",179.drv_name = "sof_rt5682",180.sof_tplg_filename = "sof-byt-rt5682.tplg",181},182/* some Baytrail platforms rely on RT5645, use CHT machine driver */183{184.comp_ids = &rt5645_comp_ids,185.drv_name = "cht-bsw-rt5645",186.fw_filename = "intel/fw_sst_0f28.bin",187.board = "cht-bsw",188.sof_tplg_filename = "sof-byt-rt5645.tplg",189},190/* use CHT driver to Baytrail Chromebooks */191{192.id = "193C9890",193.drv_name = "cht-bsw-max98090",194.fw_filename = "intel/fw_sst_0f28.bin",195.board = "cht-bsw",196.sof_tplg_filename = "sof-byt-max98090.tplg",197},198{199.id = "14F10720",200.drv_name = "bytcht_cx2072x",201.fw_filename = "intel/fw_sst_0f28.bin",202.board = "bytcht_cx2072x",203.sof_tplg_filename = "sof-byt-cx2072x.tplg",204},205#if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)206/*207* This is always last in the table so that it is selected only when208* enabled explicitly and there is no codec-related information in SSDT209*/210{211.id = "80860F28",212.drv_name = "bytcht_nocodec",213.fw_filename = "intel/fw_sst_0f28.bin",214.board = "bytcht_nocodec",215},216#endif217{},218};219EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_machines);220221222