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) 2018-2021 Intel Corporation. All rights reserved.
11 #include <linux/module.h>
12 #include <linux/pci.h>
13 #include <sound/soc-acpi.h>
14 #include <sound/soc-acpi-intel-match.h>
15 #include <sound/sof.h>
17 #include "../sof-pci-dev.h"
19 /* platform specific devices */
22 static const struct sof_dev_desc tgl_desc = {
23 .machines = snd_soc_acpi_intel_tgl_machines,
24 .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines,
25 .use_acpi_target_states = true,
26 .resindex_lpe_base = 0,
27 .resindex_pcicfg_base = -1,
28 .resindex_imr_base = -1,
29 .irqindex_host_ipc = -1,
30 .chip_info = &tgl_chip_info,
31 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
32 .ipc_default = SOF_IPC,
33 .dspless_mode_supported = true, /* Only supported for HDaudio */
35 [SOF_IPC] = "intel/sof",
36 [SOF_INTEL_IPC4] = "intel/avs/tgl",
39 [SOF_INTEL_IPC4] = "intel/avs-lib/tgl",
41 .default_tplg_path = {
42 [SOF_IPC] = "intel/sof-tplg",
43 [SOF_INTEL_IPC4] = "intel/avs-tplg",
45 .default_fw_filename = {
46 [SOF_IPC] = "sof-tgl.ri",
47 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
49 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
51 .ops_init = sof_tgl_ops_init,
52 .ops_free = hda_ops_free,
55 static const struct sof_dev_desc tglh_desc = {
56 .machines = snd_soc_acpi_intel_tgl_machines,
57 .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines,
58 .use_acpi_target_states = true,
59 .resindex_lpe_base = 0,
60 .resindex_pcicfg_base = -1,
61 .resindex_imr_base = -1,
62 .irqindex_host_ipc = -1,
63 .chip_info = &tglh_chip_info,
64 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
65 .ipc_default = SOF_IPC,
66 .dspless_mode_supported = true, /* Only supported for HDaudio */
68 [SOF_IPC] = "intel/sof",
69 [SOF_INTEL_IPC4] = "intel/avs/tgl-h",
72 [SOF_INTEL_IPC4] = "intel/avs-lib/tgl-h",
74 .default_tplg_path = {
75 [SOF_IPC] = "intel/sof-tplg",
76 [SOF_INTEL_IPC4] = "intel/avs-tplg",
78 .default_fw_filename = {
79 [SOF_IPC] = "sof-tgl-h.ri",
80 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
82 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
84 .ops_init = sof_tgl_ops_init,
85 .ops_free = hda_ops_free,
88 static const struct sof_dev_desc ehl_desc = {
89 .machines = snd_soc_acpi_intel_ehl_machines,
90 .use_acpi_target_states = true,
91 .resindex_lpe_base = 0,
92 .resindex_pcicfg_base = -1,
93 .resindex_imr_base = -1,
94 .irqindex_host_ipc = -1,
95 .chip_info = &ehl_chip_info,
96 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
97 .ipc_default = SOF_IPC,
98 .dspless_mode_supported = true, /* Only supported for HDaudio */
100 [SOF_IPC] = "intel/sof",
101 [SOF_INTEL_IPC4] = "intel/avs/ehl",
103 .default_lib_path = {
104 [SOF_INTEL_IPC4] = "intel/avs-lib/ehl",
106 .default_tplg_path = {
107 [SOF_IPC] = "intel/sof-tplg",
108 [SOF_INTEL_IPC4] = "intel/avs-tplg",
110 .default_fw_filename = {
111 [SOF_IPC] = "sof-ehl.ri",
112 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
114 .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
116 .ops_init = sof_tgl_ops_init,
117 .ops_free = hda_ops_free,
120 static const struct sof_dev_desc adls_desc = {
121 .machines = snd_soc_acpi_intel_adl_machines,
122 .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
123 .use_acpi_target_states = true,
124 .resindex_lpe_base = 0,
125 .resindex_pcicfg_base = -1,
126 .resindex_imr_base = -1,
127 .irqindex_host_ipc = -1,
128 .chip_info = &adls_chip_info,
129 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
130 .ipc_default = SOF_IPC,
131 .dspless_mode_supported = true, /* Only supported for HDaudio */
133 [SOF_IPC] = "intel/sof",
134 [SOF_INTEL_IPC4] = "intel/avs/adl-s",
136 .default_lib_path = {
137 [SOF_INTEL_IPC4] = "intel/avs-lib/adl-s",
139 .default_tplg_path = {
140 [SOF_IPC] = "intel/sof-tplg",
141 [SOF_INTEL_IPC4] = "intel/avs-tplg",
143 .default_fw_filename = {
144 [SOF_IPC] = "sof-adl-s.ri",
145 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
147 .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
149 .ops_init = sof_tgl_ops_init,
150 .ops_free = hda_ops_free,
153 static const struct sof_dev_desc adl_desc = {
154 .machines = snd_soc_acpi_intel_adl_machines,
155 .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
156 .use_acpi_target_states = true,
157 .resindex_lpe_base = 0,
158 .resindex_pcicfg_base = -1,
159 .resindex_imr_base = -1,
160 .irqindex_host_ipc = -1,
161 .chip_info = &tgl_chip_info,
162 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
163 .ipc_default = SOF_IPC,
164 .dspless_mode_supported = true, /* Only supported for HDaudio */
166 [SOF_IPC] = "intel/sof",
167 [SOF_INTEL_IPC4] = "intel/avs/adl",
169 .default_lib_path = {
170 [SOF_INTEL_IPC4] = "intel/avs-lib/adl",
172 .default_tplg_path = {
173 [SOF_IPC] = "intel/sof-tplg",
174 [SOF_INTEL_IPC4] = "intel/avs-tplg",
176 .default_fw_filename = {
177 [SOF_IPC] = "sof-adl.ri",
178 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
180 .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
182 .ops_init = sof_tgl_ops_init,
183 .ops_free = hda_ops_free,
186 static const struct sof_dev_desc adl_n_desc = {
187 .machines = snd_soc_acpi_intel_adl_machines,
188 .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
189 .use_acpi_target_states = true,
190 .resindex_lpe_base = 0,
191 .resindex_pcicfg_base = -1,
192 .resindex_imr_base = -1,
193 .irqindex_host_ipc = -1,
194 .chip_info = &tgl_chip_info,
195 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
196 .ipc_default = SOF_IPC,
197 .dspless_mode_supported = true, /* Only supported for HDaudio */
199 [SOF_IPC] = "intel/sof",
200 [SOF_INTEL_IPC4] = "intel/avs/adl-n",
202 .default_lib_path = {
203 [SOF_INTEL_IPC4] = "intel/avs-lib/adl-n",
205 .default_tplg_path = {
206 [SOF_IPC] = "intel/sof-tplg",
207 [SOF_INTEL_IPC4] = "intel/avs-tplg",
209 .default_fw_filename = {
210 [SOF_IPC] = "sof-adl-n.ri",
211 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
213 .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
215 .ops_init = sof_tgl_ops_init,
216 .ops_free = hda_ops_free,
219 static const struct sof_dev_desc rpls_desc = {
220 .machines = snd_soc_acpi_intel_rpl_machines,
221 .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
222 .use_acpi_target_states = true,
223 .resindex_lpe_base = 0,
224 .resindex_pcicfg_base = -1,
225 .resindex_imr_base = -1,
226 .irqindex_host_ipc = -1,
227 .chip_info = &adls_chip_info,
228 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
229 .ipc_default = SOF_IPC,
230 .dspless_mode_supported = true, /* Only supported for HDaudio */
232 [SOF_IPC] = "intel/sof",
233 [SOF_INTEL_IPC4] = "intel/avs/rpl-s",
235 .default_lib_path = {
236 [SOF_INTEL_IPC4] = "intel/avs-lib/rpl-s",
238 .default_tplg_path = {
239 [SOF_IPC] = "intel/sof-tplg",
240 [SOF_INTEL_IPC4] = "intel/avs-tplg",
242 .default_fw_filename = {
243 [SOF_IPC] = "sof-rpl-s.ri",
244 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
246 .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
248 .ops_init = sof_tgl_ops_init,
249 .ops_free = hda_ops_free,
252 static const struct sof_dev_desc rpl_desc = {
253 .machines = snd_soc_acpi_intel_rpl_machines,
254 .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
255 .use_acpi_target_states = true,
256 .resindex_lpe_base = 0,
257 .resindex_pcicfg_base = -1,
258 .resindex_imr_base = -1,
259 .irqindex_host_ipc = -1,
260 .chip_info = &tgl_chip_info,
261 .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
262 .ipc_default = SOF_IPC,
263 .dspless_mode_supported = true, /* Only supported for HDaudio */
265 [SOF_IPC] = "intel/sof",
266 [SOF_INTEL_IPC4] = "intel/avs/rpl",
268 .default_lib_path = {
269 [SOF_INTEL_IPC4] = "intel/avs-lib/rpl",
271 .default_tplg_path = {
272 [SOF_IPC] = "intel/sof-tplg",
273 [SOF_INTEL_IPC4] = "intel/avs-tplg",
275 .default_fw_filename = {
276 [SOF_IPC] = "sof-rpl.ri",
277 [SOF_INTEL_IPC4] = "dsp_basefw.bin",
279 .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
281 .ops_init = sof_tgl_ops_init,
282 .ops_free = hda_ops_free,
286 static const struct pci_device_id sof_pci_ids[] = {
287 { PCI_DEVICE(0x8086, 0xa0c8), /* TGL-LP */
288 .driver_data = (unsigned long)&tgl_desc},
289 { PCI_DEVICE(0x8086, 0x43c8), /* TGL-H */
290 .driver_data = (unsigned long)&tglh_desc},
291 { PCI_DEVICE(0x8086, 0x4b55), /* EHL */
292 .driver_data = (unsigned long)&ehl_desc},
293 { PCI_DEVICE(0x8086, 0x4b58), /* EHL */
294 .driver_data = (unsigned long)&ehl_desc},
295 { PCI_DEVICE(0x8086, 0x7ad0), /* ADL-S */
296 .driver_data = (unsigned long)&adls_desc},
297 { PCI_DEVICE(0x8086, 0x7a50), /* RPL-S */
298 .driver_data = (unsigned long)&rpls_desc},
299 { PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */
300 .driver_data = (unsigned long)&adl_desc},
301 { PCI_DEVICE(0x8086, 0x51c9), /* ADL-PS */
302 .driver_data = (unsigned long)&adl_desc},
303 { PCI_DEVICE(0x8086, 0x51ca), /* RPL-P */
304 .driver_data = (unsigned long)&rpl_desc},
305 { PCI_DEVICE(0x8086, 0x51cb), /* RPL-P */
306 .driver_data = (unsigned long)&rpl_desc},
307 { PCI_DEVICE(0x8086, 0x51cc), /* ADL-M */
308 .driver_data = (unsigned long)&adl_desc},
309 { PCI_DEVICE(0x8086, 0x51cd), /* ADL-P */
310 .driver_data = (unsigned long)&adl_desc},
311 { PCI_DEVICE(0x8086, 0x51ce), /* RPL-M */
312 .driver_data = (unsigned long)&rpl_desc},
313 { PCI_DEVICE(0x8086, 0x51cf), /* RPL-PX */
314 .driver_data = (unsigned long)&rpl_desc},
315 { PCI_DEVICE(0x8086, 0x54c8), /* ADL-N */
316 .driver_data = (unsigned long)&adl_n_desc},
319 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
321 /* pci_driver definition */
322 static struct pci_driver snd_sof_pci_intel_tgl_driver = {
323 .name = "sof-audio-pci-intel-tgl",
324 .id_table = sof_pci_ids,
325 .probe = hda_pci_intel_probe,
326 .remove = sof_pci_remove,
327 .shutdown = sof_pci_shutdown,
332 module_pci_driver(snd_sof_pci_intel_tgl_driver);
334 MODULE_LICENSE("Dual BSD/GPL");
335 MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
336 MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);