Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * soc-acpi-intel-byt-match.c - tables and support for BYT ACPI enumeration.
0004  *
0005  * Copyright (c) 2017, Intel Corporation.
0006  */
0007 
0008 #include <linux/dmi.h>
0009 #include <sound/soc-acpi.h>
0010 #include <sound/soc-acpi-intel-match.h>
0011 
0012 static unsigned long byt_machine_id;
0013 
0014 #define BYT_RT5672       1
0015 #define BYT_POV_P1006W   2
0016 
0017 static int byt_rt5672_quirk_cb(const struct dmi_system_id *id)
0018 {
0019     byt_machine_id = BYT_RT5672;
0020     return 1;
0021 }
0022 
0023 static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
0024 {
0025     byt_machine_id = BYT_POV_P1006W;
0026     return 1;
0027 }
0028 
0029 static const struct dmi_system_id byt_table[] = {
0030     {
0031         .callback = byt_rt5672_quirk_cb,
0032         .matches = {
0033             DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
0034             DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"),
0035         },
0036     },
0037     {
0038         .callback = byt_rt5672_quirk_cb,
0039         .matches = {
0040             DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
0041             DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),
0042         },
0043     },
0044     {
0045         .callback = byt_rt5672_quirk_cb,
0046         .matches = {
0047             DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
0048             DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),
0049         },
0050     },
0051     {
0052         .callback = byt_rt5672_quirk_cb,
0053         .matches = {
0054             DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
0055             DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
0056         },
0057     },
0058     {
0059         /* Point of View mobii wintab p1006w (v1.0) */
0060         .callback = byt_pov_p1006w_quirk_cb,
0061         .matches = {
0062             DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
0063             DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
0064             /* Note 105b is Foxcon's USB/PCI vendor id */
0065             DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
0066             DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
0067         },
0068     },
0069     {
0070         /* Aegex 10 tablet (RU2) */
0071         .callback = byt_rt5672_quirk_cb,
0072         .matches = {
0073             DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
0074             DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
0075         },
0076     },
0077     {
0078         /* Dell Venue 10 Pro 5055 */
0079         .callback = byt_rt5672_quirk_cb,
0080         .matches = {
0081             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
0082             DMI_MATCH(DMI_PRODUCT_NAME, "Venue 10 Pro 5055"),
0083         },
0084     },
0085     { }
0086 };
0087 
0088 /* Various devices use an ACPI id of 10EC5640 while using a rt5672 codec */
0089 static struct snd_soc_acpi_mach byt_rt5672 = {
0090     .id = "10EC5640",
0091     .drv_name = "cht-bsw-rt5672",
0092     .fw_filename = "intel/fw_sst_0f28.bin",
0093     .board = "cht-bsw",
0094     .sof_tplg_filename = "sof-byt-rt5670.tplg",
0095 };
0096 
0097 static struct snd_soc_acpi_mach byt_pov_p1006w = {
0098     .id = "10EC5640",
0099     .drv_name = "bytcr_rt5651",
0100     .fw_filename = "intel/fw_sst_0f28.bin",
0101     .board = "bytcr_rt5651",
0102     .sof_tplg_filename = "sof-byt-rt5651.tplg",
0103 };
0104 
0105 static struct snd_soc_acpi_mach *byt_quirk(void *arg)
0106 {
0107     struct snd_soc_acpi_mach *mach = arg;
0108 
0109     dmi_check_system(byt_table);
0110 
0111     switch (byt_machine_id) {
0112     case BYT_RT5672:
0113         return &byt_rt5672;
0114     case BYT_POV_P1006W:
0115         return &byt_pov_p1006w;
0116     default:
0117         return mach;
0118     }
0119 }
0120 
0121 static const struct snd_soc_acpi_codecs rt5640_comp_ids = {
0122     .num_codecs = 3,
0123     .codecs = { "10EC5640", "10EC5642", "INTCCFFD"},
0124 };
0125 
0126 static const struct snd_soc_acpi_codecs wm5102_comp_ids = {
0127     .num_codecs = 2,
0128     .codecs = { "10WM5102", "WM510204", "WM510205"},
0129 };
0130 
0131 static const struct snd_soc_acpi_codecs da7213_comp_ids = {
0132     .num_codecs = 2,
0133     .codecs = { "DGLS7212", "DGLS7213"},
0134 };
0135 
0136 static const struct snd_soc_acpi_codecs rt5645_comp_ids = {
0137     .num_codecs = 2,
0138     .codecs = { "10EC5645", "10EC5648"},
0139 };
0140 
0141 struct snd_soc_acpi_mach  snd_soc_acpi_intel_baytrail_machines[] = {
0142     {
0143         .comp_ids = &rt5640_comp_ids,
0144         .drv_name = "bytcr_rt5640",
0145         .fw_filename = "intel/fw_sst_0f28.bin",
0146         .board = "bytcr_rt5640",
0147         .machine_quirk = byt_quirk,
0148         .sof_tplg_filename = "sof-byt-rt5640.tplg",
0149     },
0150     {
0151         .id = "10EC5651",
0152         .drv_name = "bytcr_rt5651",
0153         .fw_filename = "intel/fw_sst_0f28.bin",
0154         .board = "bytcr_rt5651",
0155         .sof_tplg_filename = "sof-byt-rt5651.tplg",
0156     },
0157     {
0158         .comp_ids = &wm5102_comp_ids,
0159         .drv_name = "bytcr_wm5102",
0160         .fw_filename = "intel/fw_sst_0f28.bin",
0161         .board = "bytcr_wm5102",
0162         .sof_tplg_filename = "sof-byt-wm5102.tplg",
0163     },
0164     {
0165         .comp_ids = &da7213_comp_ids,
0166         .drv_name = "bytcht_da7213",
0167         .fw_filename = "intel/fw_sst_0f28.bin",
0168         .board = "bytcht_da7213",
0169         .sof_tplg_filename = "sof-byt-da7213.tplg",
0170     },
0171     {
0172         .id = "ESSX8316",
0173         .drv_name = "bytcht_es8316",
0174         .fw_filename = "intel/fw_sst_0f28.bin",
0175         .board = "bytcht_es8316",
0176         .sof_tplg_filename = "sof-byt-es8316.tplg",
0177     },
0178     {
0179         .id = "10EC5682",
0180         .drv_name = "sof_rt5682",
0181         .sof_tplg_filename = "sof-byt-rt5682.tplg",
0182     },
0183     /* some Baytrail platforms rely on RT5645, use CHT machine driver */
0184     {
0185         .comp_ids = &rt5645_comp_ids,
0186         .drv_name = "cht-bsw-rt5645",
0187         .fw_filename = "intel/fw_sst_0f28.bin",
0188         .board = "cht-bsw",
0189         .sof_tplg_filename = "sof-byt-rt5645.tplg",
0190     },
0191     /* use CHT driver to Baytrail Chromebooks */
0192     {
0193         .id = "193C9890",
0194         .drv_name = "cht-bsw-max98090",
0195         .fw_filename = "intel/fw_sst_0f28.bin",
0196         .board = "cht-bsw",
0197         .sof_tplg_filename = "sof-byt-max98090.tplg",
0198     },
0199     {
0200         .id = "14F10720",
0201         .drv_name = "bytcht_cx2072x",
0202         .fw_filename = "intel/fw_sst_0f28.bin",
0203         .board = "bytcht_cx2072x",
0204         .sof_tplg_filename = "sof-byt-cx2072x.tplg",
0205     },
0206 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
0207     /*
0208      * This is always last in the table so that it is selected only when
0209      * enabled explicitly and there is no codec-related information in SSDT
0210      */
0211     {
0212         .id = "80860F28",
0213         .drv_name = "bytcht_nocodec",
0214         .fw_filename = "intel/fw_sst_0f28.bin",
0215         .board = "bytcht_nocodec",
0216     },
0217 #endif
0218     {},
0219 };
0220 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_machines);