1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * soc-apci-intel-bxt-match.c - tables and support for BXT ACPI enumeration.
4  *
5  * Copyright (c) 2018, Intel Corporation.
6  *
7  */
8 
9 #include <linux/dmi.h>
10 #include <sound/soc-acpi.h>
11 #include <sound/soc-acpi-intel-match.h>
12 
13 enum {
14 	APL_RVP,
15 };
16 
17 static const struct dmi_system_id apl_table[] = {
18 	{
19 		.matches = {
20 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
21 			DMI_MATCH(DMI_BOARD_NAME, "Apollolake RVP1A"),
22 		},
23 		.driver_data = (void *)(APL_RVP),
24 	},
25 	{}
26 };
27 
28 static struct snd_soc_acpi_mach *apl_quirk(void *arg)
29 {
30 	struct snd_soc_acpi_mach *mach = arg;
31 	const struct dmi_system_id *dmi_id;
32 	unsigned long apl_machine_id;
33 
34 	dmi_id = dmi_first_match(apl_table);
35 	if (dmi_id) {
36 		apl_machine_id = (unsigned long)dmi_id->driver_data;
37 		if (apl_machine_id == APL_RVP)
38 			return NULL;
39 	}
40 
41 	return mach;
42 }
43 
44 static struct snd_soc_acpi_codecs bxt_codecs = {
45 	.num_codecs = 1,
46 	.codecs = {"MX98357A"}
47 };
48 
49 struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = {
50 	{
51 		.id = "INT343A",
52 		.drv_name = "bxt_alc298s_i2s",
53 		.fw_filename = "intel/dsp_fw_bxtn.bin",
54 		.sof_fw_filename = "intel/sof-apl.ri",
55 		.sof_tplg_filename = "intel/sof-apl-rt298.tplg",
56 		.asoc_plat_name = "0000:00:0e.0",
57 	},
58 	{
59 		.id = "DLGS7219",
60 		.drv_name = "bxt_da7219_max98357a",
61 		.fw_filename = "intel/dsp_fw_bxtn.bin",
62 		.machine_quirk = snd_soc_acpi_codec_list,
63 		.quirk_data = &bxt_codecs,
64 		.sof_fw_filename = "intel/sof-apl.ri",
65 		.sof_tplg_filename = "intel/sof-apl-da7219.tplg",
66 		.asoc_plat_name = "0000:00:0e.0",
67 	},
68 	{
69 		.id = "104C5122",
70 		.drv_name = "bxt-pcm512x",
71 		.sof_fw_filename = "intel/sof-apl.ri",
72 		.sof_tplg_filename = "intel/sof-apl-pcm512x.tplg",
73 		.asoc_plat_name = "0000:00:0e.0",
74 	},
75 	{
76 		.id = "1AEC8804",
77 		.drv_name = "bxt-wm8804",
78 		.sof_fw_filename = "intel/sof-apl.ri",
79 		.sof_tplg_filename = "intel/sof-apl-wm8804.tplg",
80 		.asoc_plat_name = "0000:00:0e.0",
81 	},
82 	{
83 		.id = "INT34C3",
84 		.drv_name = "bxt_tdf8532",
85 		.machine_quirk = apl_quirk,
86 		.sof_fw_filename = "intel/sof-apl.ri",
87 		.sof_tplg_filename = "intel/sof-apl-tdf8532.tplg",
88 		.asoc_plat_name = "0000:00:0e.0",
89 	},
90 	{},
91 };
92 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_bxt_machines);
93 
94 MODULE_LICENSE("GPL v2");
95 MODULE_DESCRIPTION("Intel Common ACPI Match module");
96