1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
3 // This file is provided under a dual BSD/GPLv2 license. When using or
4 // redistributing this file, you may do so under either license.
6 // Copyright(c) 2021 Advanced Micro Devices, Inc.
8 // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
11 /* ACP machine configuration module */
13 #include <linux/acpi.h>
14 #include <linux/bits.h>
15 #include <linux/dmi.h>
16 #include <linux/module.h>
17 #include <linux/pci.h>
19 #include "../sof/amd/acp.h"
20 #include "mach-config.h"
22 static int acp_quirk_data;
24 static const struct config_entry config_table[] = {
26 .flags = FLAG_AMD_SOF,
27 .device = ACP_PCI_DEV_ID,
28 .dmi_table = (const struct dmi_system_id []) {
31 DMI_MATCH(DMI_SYS_VENDOR, "AMD"),
32 DMI_MATCH(DMI_PRODUCT_NAME, "Majolica-CZN"),
39 .flags = FLAG_AMD_SOF,
40 .device = ACP_PCI_DEV_ID,
41 .dmi_table = (const struct dmi_system_id []) {
44 DMI_MATCH(DMI_SYS_VENDOR, "Google"),
51 .flags = FLAG_AMD_SOF,
52 .device = ACP_PCI_DEV_ID,
53 .dmi_table = (const struct dmi_system_id []) {
56 DMI_MATCH(DMI_SYS_VENDOR, "Valve"),
57 DMI_MATCH(DMI_PRODUCT_NAME, "Galileo"),
58 DMI_MATCH(DMI_PRODUCT_FAMILY, "Sephiroth"),
66 int snd_amd_acp_find_config(struct pci_dev *pci)
68 const struct config_entry *table = config_table;
69 u16 device = pci->device;
72 /* Do not enable FLAGS on older platforms with Rev id zero */
76 for (i = 0; i < ARRAY_SIZE(config_table); i++, table++) {
77 if (table->device != device)
79 if (table->dmi_table && !dmi_check_system(table->dmi_table))
81 acp_quirk_data = table->flags;
87 EXPORT_SYMBOL(snd_amd_acp_find_config);
89 static struct snd_soc_acpi_codecs amp_rt1019 = {
91 .codecs = {"10EC1019"}
94 static struct snd_soc_acpi_codecs amp_max = {
96 .codecs = {"MX98360A"}
99 static struct snd_soc_acpi_codecs amp_max98388 = {
101 .codecs = {"ADS8388"}
104 struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = {
107 .drv_name = "rt5682-rt1019",
108 .pdata = (void *)&acp_quirk_data,
109 .machine_quirk = snd_soc_acpi_codec_list,
110 .quirk_data = &_rt1019,
111 .fw_filename = "sof-rn.ri",
112 .sof_tplg_filename = "sof-rn-rt5682-rt1019.tplg",
116 .drv_name = "rt5682-max",
117 .pdata = (void *)&acp_quirk_data,
118 .machine_quirk = snd_soc_acpi_codec_list,
119 .quirk_data = &_max,
120 .fw_filename = "sof-rn.ri",
121 .sof_tplg_filename = "sof-rn-rt5682-max98360.tplg",
125 .drv_name = "rt5682s-max",
126 .pdata = (void *)&acp_quirk_data,
127 .machine_quirk = snd_soc_acpi_codec_list,
128 .quirk_data = &_max,
129 .fw_filename = "sof-rn.ri",
130 .sof_tplg_filename = "sof-rn-rt5682-max98360.tplg",
134 .drv_name = "rt5682s-rt1019",
135 .pdata = (void *)&acp_quirk_data,
136 .machine_quirk = snd_soc_acpi_codec_list,
137 .quirk_data = &_rt1019,
138 .fw_filename = "sof-rn.ri",
139 .sof_tplg_filename = "sof-rn-rt5682-rt1019.tplg",
143 .drv_name = "renoir-dsp",
144 .pdata = (void *)&acp_quirk_data,
145 .fw_filename = "sof-rn.ri",
146 .sof_tplg_filename = "sof-acp.tplg",
150 EXPORT_SYMBOL(snd_soc_acpi_amd_sof_machines);
152 struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[] = {
155 .drv_name = "nau8821-max",
156 .pdata = &acp_quirk_data,
157 .machine_quirk = snd_soc_acpi_codec_list,
158 .quirk_data = &_max98388,
159 .fw_filename = "sof-vangogh.ri",
160 .sof_tplg_filename = "sof-vangogh-nau8821-max.tplg",
164 EXPORT_SYMBOL(snd_soc_acpi_amd_vangogh_sof_machines);
166 struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = {
169 .drv_name = "rmb-dsp",
170 .pdata = &acp_quirk_data,
171 .fw_filename = "sof-rmb.ri",
172 .sof_tplg_filename = "sof-acp-rmb.tplg",
176 .drv_name = "nau8825-max",
177 .pdata = &acp_quirk_data,
178 .machine_quirk = snd_soc_acpi_codec_list,
179 .quirk_data = &_max,
180 .fw_filename = "sof-rmb.ri",
181 .sof_tplg_filename = "sof-rmb-nau8825-max98360.tplg",
185 .drv_name = "rt5682s-hs-rt1019",
186 .pdata = &acp_quirk_data,
187 .machine_quirk = snd_soc_acpi_codec_list,
188 .quirk_data = &_rt1019,
189 .fw_filename = "sof-rmb.ri",
190 .sof_tplg_filename = "sof-rmb-rt5682s-rt1019.tplg",
194 EXPORT_SYMBOL(snd_soc_acpi_amd_rmb_sof_machines);
196 MODULE_LICENSE("Dual BSD/GPL");