Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * soc-acpi-intel-bxt-match.c - tables and support for BXT ACPI enumeration.
0004  *
0005  * Copyright (c) 2018, Intel Corporation.
0006  *
0007  */
0008 
0009 #include <linux/dmi.h>
0010 #include <sound/soc-acpi.h>
0011 #include <sound/soc-acpi-intel-match.h>
0012 
0013 enum {
0014     APL_RVP,
0015 };
0016 
0017 static const struct dmi_system_id apl_table[] = {
0018     {
0019         .matches = {
0020             DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
0021             DMI_MATCH(DMI_BOARD_NAME, "Apollolake RVP1A"),
0022         },
0023         .driver_data = (void *)(APL_RVP),
0024     },
0025     {}
0026 };
0027 
0028 static struct snd_soc_acpi_mach *apl_quirk(void *arg)
0029 {
0030     struct snd_soc_acpi_mach *mach = arg;
0031     const struct dmi_system_id *dmi_id;
0032     unsigned long apl_machine_id;
0033 
0034     dmi_id = dmi_first_match(apl_table);
0035     if (dmi_id) {
0036         apl_machine_id = (unsigned long)dmi_id->driver_data;
0037         if (apl_machine_id == APL_RVP)
0038             return NULL;
0039     }
0040 
0041     return mach;
0042 }
0043 
0044 static const struct snd_soc_acpi_codecs essx_83x6 = {
0045     .num_codecs = 3,
0046     .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
0047 };
0048 
0049 static const struct snd_soc_acpi_codecs bxt_codecs = {
0050     .num_codecs = 1,
0051     .codecs = {"MX98357A"}
0052 };
0053 
0054 struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = {
0055     {
0056         .id = "INT343A",
0057         .drv_name = "bxt_alc298s_i2s",
0058         .fw_filename = "intel/dsp_fw_bxtn.bin",
0059         .sof_tplg_filename = "sof-apl-rt298.tplg",
0060     },
0061     {
0062         .id = "DLGS7219",
0063         .drv_name = "bxt_da7219_mx98357a",
0064         .fw_filename = "intel/dsp_fw_bxtn.bin",
0065         .machine_quirk = snd_soc_acpi_codec_list,
0066         .quirk_data = &bxt_codecs,
0067         .sof_tplg_filename = "sof-apl-da7219.tplg",
0068     },
0069     {
0070         .id = "104C5122",
0071         .drv_name = "sof_pcm512x",
0072         .sof_tplg_filename = "sof-apl-pcm512x.tplg",
0073     },
0074     {
0075         .id = "1AEC8804",
0076         .drv_name = "sof-wm8804",
0077         .sof_tplg_filename = "sof-apl-wm8804.tplg",
0078     },
0079     {
0080         .id = "INT34C3",
0081         .drv_name = "bxt_tdf8532",
0082         .machine_quirk = apl_quirk,
0083         .sof_tplg_filename = "sof-apl-tdf8532.tplg",
0084     },
0085     {
0086         .comp_ids = &essx_83x6,
0087         .drv_name = "sof-essx8336",
0088         .sof_tplg_filename = "sof-apl-es8336", /* the tplg suffix is added at run time */
0089         .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
0090                     SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
0091                     SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
0092     },
0093     {},
0094 };
0095 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_bxt_machines);