blob: 75657a25dbc059dbabc6b23598d9c3127c09ac63 [file] [log] [blame]
Olivier Deprez157378f2022-04-04 15:47:50 +02001// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
David Brazdil0f672f62019-12-10 10:32:29 +00002//
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.
5//
6// Copyright(c) 2018 Intel Corporation. All rights reserved.
7//
8// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
9//
10
11#include <linux/firmware.h>
Olivier Deprez157378f2022-04-04 15:47:50 +020012#include <linux/dmi.h>
David Brazdil0f672f62019-12-10 10:32:29 +000013#include <linux/module.h>
14#include <linux/pci.h>
15#include <linux/pm_runtime.h>
Olivier Deprez157378f2022-04-04 15:47:50 +020016#include <sound/intel-dsp-config.h>
David Brazdil0f672f62019-12-10 10:32:29 +000017#include <sound/soc-acpi.h>
18#include <sound/soc-acpi-intel-match.h>
19#include <sound/sof.h>
20#include "ops.h"
21
22/* platform specific devices */
23#include "intel/shim.h"
24#include "intel/hda.h"
25
26static char *fw_path;
27module_param(fw_path, charp, 0444);
28MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
29
30static char *tplg_path;
31module_param(tplg_path, charp, 0444);
32MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
33
Olivier Deprez157378f2022-04-04 15:47:50 +020034static int sof_pci_debug;
35module_param_named(sof_pci_debug, sof_pci_debug, int, 0444);
36MODULE_PARM_DESC(sof_pci_debug, "SOF PCI debug options (0x0 all off)");
37
38static const char *sof_override_tplg_name;
39
40#define SOF_PCI_DISABLE_PM_RUNTIME BIT(0)
41
42static int sof_tplg_cb(const struct dmi_system_id *id)
43{
44 sof_override_tplg_name = id->driver_data;
45 return 1;
46}
47
48static const struct dmi_system_id sof_tplg_table[] = {
49 {
50 .callback = sof_tplg_cb,
51 .matches = {
52 DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Volteer"),
53 DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98373_ALC5682I_I2S_UP4"),
54 },
55 .driver_data = "sof-tgl-rt5682-ssp0-max98373-ssp2.tplg",
56 },
57 {}
58};
59
60static const struct dmi_system_id community_key_platforms[] = {
61 {
62 .ident = "Up Squared",
63 .matches = {
64 DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
65 DMI_MATCH(DMI_BOARD_NAME, "UP-APL01"),
66 }
67 },
68 {
69 .ident = "Up Extreme",
70 .matches = {
71 DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
72 DMI_MATCH(DMI_BOARD_NAME, "UP-WHL01"),
73 }
74 },
75 {
76 .ident = "Google Chromebooks",
77 .matches = {
78 DMI_MATCH(DMI_SYS_VENDOR, "Google"),
79 }
80 },
81 {},
82};
83
David Brazdil0f672f62019-12-10 10:32:29 +000084#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
85static const struct sof_dev_desc bxt_desc = {
86 .machines = snd_soc_acpi_intel_bxt_machines,
Olivier Deprez157378f2022-04-04 15:47:50 +020087 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +000088 .resindex_lpe_base = 0,
89 .resindex_pcicfg_base = -1,
90 .resindex_imr_base = -1,
91 .irqindex_host_ipc = -1,
92 .resindex_dma_base = -1,
93 .chip_info = &apl_chip_info,
94 .default_fw_path = "intel/sof",
95 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +020096 .default_fw_filename = "sof-apl.ri",
David Brazdil0f672f62019-12-10 10:32:29 +000097 .nocodec_tplg_filename = "sof-apl-nocodec.tplg",
98 .ops = &sof_apl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +000099};
100#endif
101
102#if IS_ENABLED(CONFIG_SND_SOC_SOF_GEMINILAKE)
103static const struct sof_dev_desc glk_desc = {
104 .machines = snd_soc_acpi_intel_glk_machines,
Olivier Deprez157378f2022-04-04 15:47:50 +0200105 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000106 .resindex_lpe_base = 0,
107 .resindex_pcicfg_base = -1,
108 .resindex_imr_base = -1,
109 .irqindex_host_ipc = -1,
110 .resindex_dma_base = -1,
111 .chip_info = &apl_chip_info,
112 .default_fw_path = "intel/sof",
113 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200114 .default_fw_filename = "sof-glk.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000115 .nocodec_tplg_filename = "sof-glk-nocodec.tplg",
116 .ops = &sof_apl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000117};
118#endif
119
120#if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD)
121static struct snd_soc_acpi_mach sof_tng_machines[] = {
122 {
123 .id = "INT343A",
124 .drv_name = "edison",
125 .sof_fw_filename = "sof-byt.ri",
126 .sof_tplg_filename = "sof-byt.tplg",
127 },
128 {}
129};
130
131static const struct sof_dev_desc tng_desc = {
132 .machines = sof_tng_machines,
133 .resindex_lpe_base = 3, /* IRAM, but subtract IRAM offset */
134 .resindex_pcicfg_base = -1,
135 .resindex_imr_base = 0,
136 .irqindex_host_ipc = -1,
137 .resindex_dma_base = -1,
138 .chip_info = &tng_chip_info,
139 .default_fw_path = "intel/sof",
140 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200141 .default_fw_filename = "sof-byt.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000142 .nocodec_tplg_filename = "sof-byt.tplg",
143 .ops = &sof_tng_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000144};
145#endif
146
147#if IS_ENABLED(CONFIG_SND_SOC_SOF_CANNONLAKE)
148static const struct sof_dev_desc cnl_desc = {
149 .machines = snd_soc_acpi_intel_cnl_machines,
Olivier Deprez157378f2022-04-04 15:47:50 +0200150 .alt_machines = snd_soc_acpi_intel_cnl_sdw_machines,
151 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000152 .resindex_lpe_base = 0,
153 .resindex_pcicfg_base = -1,
154 .resindex_imr_base = -1,
155 .irqindex_host_ipc = -1,
156 .resindex_dma_base = -1,
157 .chip_info = &cnl_chip_info,
158 .default_fw_path = "intel/sof",
159 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200160 .default_fw_filename = "sof-cnl.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000161 .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
162 .ops = &sof_cnl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000163};
164#endif
165
166#if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE)
167static const struct sof_dev_desc cfl_desc = {
Olivier Deprez157378f2022-04-04 15:47:50 +0200168 .machines = snd_soc_acpi_intel_cfl_machines,
169 .alt_machines = snd_soc_acpi_intel_cfl_sdw_machines,
170 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000171 .resindex_lpe_base = 0,
172 .resindex_pcicfg_base = -1,
173 .resindex_imr_base = -1,
174 .irqindex_host_ipc = -1,
175 .resindex_dma_base = -1,
176 .chip_info = &cnl_chip_info,
177 .default_fw_path = "intel/sof",
178 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200179 .default_fw_filename = "sof-cfl.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000180 .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
181 .ops = &sof_cnl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000182};
183#endif
184
Olivier Deprez157378f2022-04-04 15:47:50 +0200185#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE)
David Brazdil0f672f62019-12-10 10:32:29 +0000186static const struct sof_dev_desc cml_desc = {
Olivier Deprez157378f2022-04-04 15:47:50 +0200187 .machines = snd_soc_acpi_intel_cml_machines,
188 .alt_machines = snd_soc_acpi_intel_cml_sdw_machines,
189 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000190 .resindex_lpe_base = 0,
191 .resindex_pcicfg_base = -1,
192 .resindex_imr_base = -1,
193 .irqindex_host_ipc = -1,
194 .resindex_dma_base = -1,
195 .chip_info = &cnl_chip_info,
196 .default_fw_path = "intel/sof",
197 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200198 .default_fw_filename = "sof-cml.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000199 .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
200 .ops = &sof_cnl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000201};
202#endif
203
204#if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE)
205static const struct sof_dev_desc icl_desc = {
206 .machines = snd_soc_acpi_intel_icl_machines,
Olivier Deprez157378f2022-04-04 15:47:50 +0200207 .alt_machines = snd_soc_acpi_intel_icl_sdw_machines,
208 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000209 .resindex_lpe_base = 0,
210 .resindex_pcicfg_base = -1,
211 .resindex_imr_base = -1,
212 .irqindex_host_ipc = -1,
213 .resindex_dma_base = -1,
214 .chip_info = &icl_chip_info,
215 .default_fw_path = "intel/sof",
216 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200217 .default_fw_filename = "sof-icl.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000218 .nocodec_tplg_filename = "sof-icl-nocodec.tplg",
219 .ops = &sof_cnl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000220};
221#endif
222
223#if IS_ENABLED(CONFIG_SND_SOC_SOF_TIGERLAKE)
224static const struct sof_dev_desc tgl_desc = {
225 .machines = snd_soc_acpi_intel_tgl_machines,
Olivier Deprez157378f2022-04-04 15:47:50 +0200226 .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines,
227 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000228 .resindex_lpe_base = 0,
229 .resindex_pcicfg_base = -1,
230 .resindex_imr_base = -1,
231 .irqindex_host_ipc = -1,
232 .resindex_dma_base = -1,
233 .chip_info = &tgl_chip_info,
234 .default_fw_path = "intel/sof",
235 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200236 .default_fw_filename = "sof-tgl.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000237 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200238 .ops = &sof_tgl_ops,
239};
240
241static const struct sof_dev_desc tglh_desc = {
242 .machines = snd_soc_acpi_intel_tgl_machines,
243 .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines,
244 .resindex_lpe_base = 0,
245 .resindex_pcicfg_base = -1,
246 .resindex_imr_base = -1,
247 .irqindex_host_ipc = -1,
248 .resindex_dma_base = -1,
249 .chip_info = &tglh_chip_info,
250 .default_fw_path = "intel/sof",
251 .default_tplg_path = "intel/sof-tplg",
252 .default_fw_filename = "sof-tgl-h.ri",
253 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
254 .ops = &sof_tgl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000255};
256#endif
257
258#if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE)
259static const struct sof_dev_desc ehl_desc = {
260 .machines = snd_soc_acpi_intel_ehl_machines,
Olivier Deprez157378f2022-04-04 15:47:50 +0200261 .use_acpi_target_states = true,
David Brazdil0f672f62019-12-10 10:32:29 +0000262 .resindex_lpe_base = 0,
263 .resindex_pcicfg_base = -1,
264 .resindex_imr_base = -1,
265 .irqindex_host_ipc = -1,
266 .resindex_dma_base = -1,
267 .chip_info = &ehl_chip_info,
268 .default_fw_path = "intel/sof",
269 .default_tplg_path = "intel/sof-tplg",
Olivier Deprez157378f2022-04-04 15:47:50 +0200270 .default_fw_filename = "sof-ehl.ri",
David Brazdil0f672f62019-12-10 10:32:29 +0000271 .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
272 .ops = &sof_cnl_ops,
Olivier Deprez157378f2022-04-04 15:47:50 +0200273};
274#endif
275
276#if IS_ENABLED(CONFIG_SND_SOC_SOF_JASPERLAKE)
277static const struct sof_dev_desc jsl_desc = {
278 .machines = snd_soc_acpi_intel_jsl_machines,
279 .use_acpi_target_states = true,
280 .resindex_lpe_base = 0,
281 .resindex_pcicfg_base = -1,
282 .resindex_imr_base = -1,
283 .irqindex_host_ipc = -1,
284 .resindex_dma_base = -1,
285 .chip_info = &jsl_chip_info,
286 .default_fw_path = "intel/sof",
287 .default_tplg_path = "intel/sof-tplg",
288 .default_fw_filename = "sof-jsl.ri",
289 .nocodec_tplg_filename = "sof-jsl-nocodec.tplg",
290 .ops = &sof_cnl_ops,
David Brazdil0f672f62019-12-10 10:32:29 +0000291};
292#endif
293
294static const struct dev_pm_ops sof_pci_pm = {
Olivier Deprez157378f2022-04-04 15:47:50 +0200295 .prepare = snd_sof_prepare,
296 .complete = snd_sof_complete,
David Brazdil0f672f62019-12-10 10:32:29 +0000297 SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
298 SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
299 snd_sof_runtime_idle)
300};
301
302static void sof_pci_probe_complete(struct device *dev)
303{
304 dev_dbg(dev, "Completing SOF PCI probe");
305
Olivier Deprez157378f2022-04-04 15:47:50 +0200306 if (sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME)
307 return;
308
David Brazdil0f672f62019-12-10 10:32:29 +0000309 /* allow runtime_pm */
310 pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS);
311 pm_runtime_use_autosuspend(dev);
312
313 /*
314 * runtime pm for pci device is "forbidden" by default.
315 * so call pm_runtime_allow() to enable it.
316 */
317 pm_runtime_allow(dev);
318
319 /* mark last_busy for pm_runtime to make sure not suspend immediately */
320 pm_runtime_mark_last_busy(dev);
321
322 /* follow recommendation in pci-driver.c to decrement usage counter */
323 pm_runtime_put_noidle(dev);
324}
325
326static int sof_pci_probe(struct pci_dev *pci,
327 const struct pci_device_id *pci_id)
328{
329 struct device *dev = &pci->dev;
330 const struct sof_dev_desc *desc =
331 (const struct sof_dev_desc *)pci_id->driver_data;
David Brazdil0f672f62019-12-10 10:32:29 +0000332 struct snd_sof_pdata *sof_pdata;
333 const struct snd_sof_dsp_ops *ops;
334 int ret;
335
Olivier Deprez157378f2022-04-04 15:47:50 +0200336 ret = snd_intel_dsp_driver_probe(pci);
337 if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
338 dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
339 return -ENODEV;
340 }
David Brazdil0f672f62019-12-10 10:32:29 +0000341 dev_dbg(&pci->dev, "PCI DSP detected");
342
343 /* get ops for platform */
344 ops = desc->ops;
345 if (!ops) {
346 dev_err(dev, "error: no matching PCI descriptor ops\n");
347 return -ENODEV;
348 }
349
350 sof_pdata = devm_kzalloc(dev, sizeof(*sof_pdata), GFP_KERNEL);
351 if (!sof_pdata)
352 return -ENOMEM;
353
354 ret = pcim_enable_device(pci);
355 if (ret < 0)
356 return ret;
357
358 ret = pci_request_regions(pci, "Audio DSP");
359 if (ret < 0)
360 return ret;
361
David Brazdil0f672f62019-12-10 10:32:29 +0000362 sof_pdata->name = pci_name(pci);
David Brazdil0f672f62019-12-10 10:32:29 +0000363 sof_pdata->desc = (struct sof_dev_desc *)pci_id->driver_data;
364 sof_pdata->dev = dev;
Olivier Deprez157378f2022-04-04 15:47:50 +0200365 sof_pdata->fw_filename = desc->default_fw_filename;
366
367 /*
368 * for platforms using the SOF community key, change the
369 * default path automatically to pick the right files from the
370 * linux-firmware tree. This can be overridden with the
371 * fw_path kernel parameter, e.g. for developers.
372 */
David Brazdil0f672f62019-12-10 10:32:29 +0000373
374 /* alternate fw and tplg filenames ? */
Olivier Deprez157378f2022-04-04 15:47:50 +0200375 if (fw_path) {
David Brazdil0f672f62019-12-10 10:32:29 +0000376 sof_pdata->fw_filename_prefix = fw_path;
Olivier Deprez157378f2022-04-04 15:47:50 +0200377
378 dev_dbg(dev,
379 "Module parameter used, changed fw path to %s\n",
380 sof_pdata->fw_filename_prefix);
381
382 } else if (dmi_check_system(community_key_platforms)) {
383 sof_pdata->fw_filename_prefix =
384 devm_kasprintf(dev, GFP_KERNEL, "%s/%s",
385 sof_pdata->desc->default_fw_path,
386 "community");
387
388 dev_dbg(dev,
389 "Platform uses community key, changed fw path to %s\n",
390 sof_pdata->fw_filename_prefix);
391 } else {
David Brazdil0f672f62019-12-10 10:32:29 +0000392 sof_pdata->fw_filename_prefix =
393 sof_pdata->desc->default_fw_path;
Olivier Deprez157378f2022-04-04 15:47:50 +0200394 }
David Brazdil0f672f62019-12-10 10:32:29 +0000395
396 if (tplg_path)
397 sof_pdata->tplg_filename_prefix = tplg_path;
398 else
399 sof_pdata->tplg_filename_prefix =
400 sof_pdata->desc->default_tplg_path;
401
Olivier Deprez157378f2022-04-04 15:47:50 +0200402 dmi_check_system(sof_tplg_table);
403 if (sof_override_tplg_name)
404 sof_pdata->tplg_filename = sof_override_tplg_name;
405
David Brazdil0f672f62019-12-10 10:32:29 +0000406#if IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
407 /* set callback to enable runtime_pm */
408 sof_pdata->sof_probe_complete = sof_pci_probe_complete;
409#endif
410 /* call sof helper for DSP hardware probe */
411 ret = snd_sof_device_probe(dev, sof_pdata);
412 if (ret) {
413 dev_err(dev, "error: failed to probe DSP hardware!\n");
414 goto release_regions;
415 }
416
417#if !IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
418 sof_pci_probe_complete(dev);
419#endif
420
421 return ret;
422
423release_regions:
424 pci_release_regions(pci);
425
426 return ret;
427}
428
429static void sof_pci_remove(struct pci_dev *pci)
430{
431 /* call sof helper for DSP hardware remove */
432 snd_sof_device_remove(&pci->dev);
433
434 /* follow recommendation in pci-driver.c to increment usage counter */
Olivier Deprez157378f2022-04-04 15:47:50 +0200435 if (!(sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME))
436 pm_runtime_get_noresume(&pci->dev);
David Brazdil0f672f62019-12-10 10:32:29 +0000437
438 /* release pci regions and disable device */
439 pci_release_regions(pci);
440}
441
442/* PCI IDs */
443static const struct pci_device_id sof_pci_ids[] = {
444#if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD)
445 { PCI_DEVICE(0x8086, 0x119a),
446 .driver_data = (unsigned long)&tng_desc},
447#endif
448#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
449 /* BXT-P & Apollolake */
450 { PCI_DEVICE(0x8086, 0x5a98),
451 .driver_data = (unsigned long)&bxt_desc},
452 { PCI_DEVICE(0x8086, 0x1a98),
453 .driver_data = (unsigned long)&bxt_desc},
454#endif
455#if IS_ENABLED(CONFIG_SND_SOC_SOF_GEMINILAKE)
456 { PCI_DEVICE(0x8086, 0x3198),
457 .driver_data = (unsigned long)&glk_desc},
458#endif
459#if IS_ENABLED(CONFIG_SND_SOC_SOF_CANNONLAKE)
460 { PCI_DEVICE(0x8086, 0x9dc8),
461 .driver_data = (unsigned long)&cnl_desc},
462#endif
463#if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE)
464 { PCI_DEVICE(0x8086, 0xa348),
465 .driver_data = (unsigned long)&cfl_desc},
466#endif
David Brazdil0f672f62019-12-10 10:32:29 +0000467#if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE)
Olivier Deprez157378f2022-04-04 15:47:50 +0200468 { PCI_DEVICE(0x8086, 0x34C8), /* ICL-LP */
David Brazdil0f672f62019-12-10 10:32:29 +0000469 .driver_data = (unsigned long)&icl_desc},
Olivier Deprez157378f2022-04-04 15:47:50 +0200470 { PCI_DEVICE(0x8086, 0x3dc8), /* ICL-H */
471 .driver_data = (unsigned long)&icl_desc},
472
David Brazdil0f672f62019-12-10 10:32:29 +0000473#endif
Olivier Deprez157378f2022-04-04 15:47:50 +0200474#if IS_ENABLED(CONFIG_SND_SOC_SOF_JASPERLAKE)
475 { PCI_DEVICE(0x8086, 0x38c8),
476 .driver_data = (unsigned long)&jsl_desc},
477 { PCI_DEVICE(0x8086, 0x4dc8),
478 .driver_data = (unsigned long)&jsl_desc},
479#endif
480#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE)
481 { PCI_DEVICE(0x8086, 0x02c8), /* CML-LP */
David Brazdil0f672f62019-12-10 10:32:29 +0000482 .driver_data = (unsigned long)&cml_desc},
Olivier Deprez157378f2022-04-04 15:47:50 +0200483 { PCI_DEVICE(0x8086, 0x06c8), /* CML-H */
David Brazdil0f672f62019-12-10 10:32:29 +0000484 .driver_data = (unsigned long)&cml_desc},
Olivier Deprez0e641232021-09-23 10:07:05 +0200485 { PCI_DEVICE(0x8086, 0xa3f0), /* CML-S */
486 .driver_data = (unsigned long)&cml_desc},
David Brazdil0f672f62019-12-10 10:32:29 +0000487#endif
488#if IS_ENABLED(CONFIG_SND_SOC_SOF_TIGERLAKE)
Olivier Deprez157378f2022-04-04 15:47:50 +0200489 { PCI_DEVICE(0x8086, 0xa0c8), /* TGL-LP */
David Brazdil0f672f62019-12-10 10:32:29 +0000490 .driver_data = (unsigned long)&tgl_desc},
Olivier Deprez157378f2022-04-04 15:47:50 +0200491 { PCI_DEVICE(0x8086, 0x43c8), /* TGL-H */
492 .driver_data = (unsigned long)&tglh_desc},
493
David Brazdil0f672f62019-12-10 10:32:29 +0000494#endif
495#if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE)
496 { PCI_DEVICE(0x8086, 0x4b55),
497 .driver_data = (unsigned long)&ehl_desc},
Olivier Deprez157378f2022-04-04 15:47:50 +0200498 { PCI_DEVICE(0x8086, 0x4b58),
499 .driver_data = (unsigned long)&ehl_desc},
David Brazdil0f672f62019-12-10 10:32:29 +0000500#endif
501 { 0, }
502};
503MODULE_DEVICE_TABLE(pci, sof_pci_ids);
504
505/* pci_driver definition */
506static struct pci_driver snd_sof_pci_driver = {
507 .name = "sof-audio-pci",
508 .id_table = sof_pci_ids,
509 .probe = sof_pci_probe,
510 .remove = sof_pci_remove,
511 .driver = {
512 .pm = &sof_pci_pm,
513 },
514};
515module_pci_driver(snd_sof_pci_driver);
516
517MODULE_LICENSE("Dual BSD/GPL");
Olivier Deprez157378f2022-04-04 15:47:50 +0200518MODULE_IMPORT_NS(SND_SOC_SOF_MERRIFIELD);
519MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);