Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * soc-acpi-intel-cht-match.c - tables and support for CHT 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 cht_machine_id;
0013 
0014 #define CHT_SURFACE_MACH 1
0015 
0016 static int cht_surface_quirk_cb(const struct dmi_system_id *id)
0017 {
0018     cht_machine_id = CHT_SURFACE_MACH;
0019     return 1;
0020 }
0021 
0022 static const struct dmi_system_id cht_table[] = {
0023     {
0024         .callback = cht_surface_quirk_cb,
0025         .matches = {
0026             DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
0027             DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
0028         },
0029     },
0030     { }
0031 };
0032 
0033 static struct snd_soc_acpi_mach cht_surface_mach = {
0034     .id = "10EC5640",
0035     .drv_name = "cht-bsw-rt5645",
0036     .fw_filename = "intel/fw_sst_22a8.bin",
0037     .board = "cht-bsw",
0038     .sof_tplg_filename = "sof-cht-rt5645.tplg",
0039 };
0040 
0041 static struct snd_soc_acpi_mach *cht_quirk(void *arg)
0042 {
0043     struct snd_soc_acpi_mach *mach = arg;
0044 
0045     dmi_check_system(cht_table);
0046 
0047     if (cht_machine_id == CHT_SURFACE_MACH)
0048         return &cht_surface_mach;
0049     else
0050         return mach;
0051 }
0052 
0053 static const struct snd_soc_acpi_codecs rt5640_comp_ids = {
0054     .num_codecs = 2,
0055     .codecs = { "10EC5640", "10EC3276" },
0056 };
0057 
0058 static const struct snd_soc_acpi_codecs rt5670_comp_ids = {
0059     .num_codecs = 2,
0060     .codecs = { "10EC5670", "10EC5672" },
0061 };
0062 
0063 static const struct snd_soc_acpi_codecs rt5645_comp_ids = {
0064     .num_codecs = 3,
0065     .codecs = { "10EC5645", "10EC5650", "10EC3270" },
0066 };
0067 
0068 static const struct snd_soc_acpi_codecs da7213_comp_ids = {
0069     .num_codecs = 2,
0070     .codecs = { "DGLS7212", "DGLS7213"},
0071 
0072 };
0073 
0074 /* Cherryview-based platforms: CherryTrail and Braswell */
0075 struct snd_soc_acpi_mach  snd_soc_acpi_intel_cherrytrail_machines[] = {
0076     {
0077         .comp_ids = &rt5670_comp_ids,
0078         .drv_name = "cht-bsw-rt5672",
0079         .fw_filename = "intel/fw_sst_22a8.bin",
0080         .board = "cht-bsw",
0081         .sof_tplg_filename = "sof-cht-rt5670.tplg",
0082     },
0083     {
0084         .comp_ids = &rt5645_comp_ids,
0085         .drv_name = "cht-bsw-rt5645",
0086         .fw_filename = "intel/fw_sst_22a8.bin",
0087         .board = "cht-bsw",
0088         .sof_tplg_filename = "sof-cht-rt5645.tplg",
0089     },
0090     {
0091         .id = "193C9890",
0092         .drv_name = "cht-bsw-max98090",
0093         .fw_filename = "intel/fw_sst_22a8.bin",
0094         .board = "cht-bsw",
0095         .sof_tplg_filename = "sof-cht-max98090.tplg",
0096     },
0097     {
0098         .id = "10508824",
0099         .drv_name = "cht-bsw-nau8824",
0100         .fw_filename = "intel/fw_sst_22a8.bin",
0101         .board = "cht-bsw",
0102         .sof_tplg_filename = "sof-cht-nau8824.tplg",
0103     },
0104     {
0105         .comp_ids = &da7213_comp_ids,
0106         .drv_name = "bytcht_da7213",
0107         .fw_filename = "intel/fw_sst_22a8.bin",
0108         .board = "bytcht_da7213",
0109         .sof_tplg_filename = "sof-cht-da7213.tplg",
0110     },
0111     {
0112         .id = "ESSX8316",
0113         .drv_name = "bytcht_es8316",
0114         .fw_filename = "intel/fw_sst_22a8.bin",
0115         .board = "bytcht_es8316",
0116         .sof_tplg_filename = "sof-cht-es8316.tplg",
0117     },
0118     /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */
0119     {
0120         .comp_ids = &rt5640_comp_ids,
0121         .drv_name = "bytcr_rt5640",
0122         .fw_filename = "intel/fw_sst_22a8.bin",
0123         .board = "bytcr_rt5640",
0124         .machine_quirk = cht_quirk,
0125         .sof_tplg_filename = "sof-cht-rt5640.tplg",
0126     },
0127     {
0128         .id = "10EC5682",
0129         .drv_name = "sof_rt5682",
0130         .sof_tplg_filename = "sof-cht-rt5682.tplg",
0131     },
0132     /* some CHT-T platforms rely on RT5651, use Baytrail machine driver */
0133     {
0134         .id = "10EC5651",
0135         .drv_name = "bytcr_rt5651",
0136         .fw_filename = "intel/fw_sst_22a8.bin",
0137         .board = "bytcr_rt5651",
0138         .sof_tplg_filename = "sof-cht-rt5651.tplg",
0139     },
0140     {
0141         .id = "14F10720",
0142         .drv_name = "bytcht_cx2072x",
0143         .fw_filename = "intel/fw_sst_22a8.bin",
0144         .board = "bytcht_cx2072x",
0145         .sof_tplg_filename = "sof-cht-cx2072x.tplg",
0146     },
0147     {
0148         .id = "104C5122",
0149         .drv_name = "sof_pcm512x",
0150         .sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg",
0151     },
0152 
0153 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
0154     /*
0155      * This is always last in the table so that it is selected only when
0156      * enabled explicitly and there is no codec-related information in SSDT
0157      */
0158     {
0159         .id = "808622A8",
0160         .drv_name = "bytcht_nocodec",
0161         .fw_filename = "intel/fw_sst_22a8.bin",
0162         .board = "bytcht_nocodec",
0163     },
0164 #endif
0165     {},
0166 };
0167 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cherrytrail_machines);