xref: /linux/sound/soc/sof/intel/pci-skl.c (revision 52990390f91c1c39ca742fc8f390b29891d95127)
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
2 //
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-2022 Intel Corporation. All rights reserved.
7 //
8 
9 #include <linux/module.h>
10 #include <linux/pci.h>
11 #include <sound/soc-acpi.h>
12 #include <sound/soc-acpi-intel-match.h>
13 #include <sound/sof.h>
14 #include "../ops.h"
15 #include "../sof-pci-dev.h"
16 
17 /* platform specific devices */
18 #include "hda.h"
19 
20 static struct sof_dev_desc skl_desc = {
21 	.machines		= snd_soc_acpi_intel_skl_machines,
22 	.resindex_lpe_base	= 0,
23 	.resindex_pcicfg_base	= -1,
24 	.resindex_imr_base	= -1,
25 	.chip_info = &skl_chip_info,
26 	.irqindex_host_ipc	= -1,
27 	.ipc_supported_mask	= BIT(SOF_INTEL_IPC4),
28 	.ipc_default		= SOF_INTEL_IPC4,
29 	.dspless_mode_supported	= true,		/* Only supported for HDaudio */
30 	.default_fw_path = {
31 		[SOF_INTEL_IPC4] = "intel/avs/skl",
32 	},
33 	.default_tplg_path = {
34 		[SOF_INTEL_IPC4] = "intel/avs-tplg",
35 	},
36 	.default_fw_filename = {
37 		[SOF_INTEL_IPC4] = "dsp_basefw.bin",
38 	},
39 	.nocodec_tplg_filename = "sof-skl-nocodec.tplg",
40 	.ops = &sof_skl_ops,
41 	.ops_init = sof_skl_ops_init,
42 	.ops_free = hda_ops_free,
43 };
44 
45 static struct sof_dev_desc kbl_desc = {
46 	.machines		= snd_soc_acpi_intel_kbl_machines,
47 	.resindex_lpe_base	= 0,
48 	.resindex_pcicfg_base	= -1,
49 	.resindex_imr_base	= -1,
50 	.chip_info = &skl_chip_info,
51 	.irqindex_host_ipc	= -1,
52 	.ipc_supported_mask	= BIT(SOF_INTEL_IPC4),
53 	.ipc_default		= SOF_INTEL_IPC4,
54 	.dspless_mode_supported	= true,		/* Only supported for HDaudio */
55 	.default_fw_path = {
56 		[SOF_INTEL_IPC4] = "intel/avs/kbl",
57 	},
58 	.default_tplg_path = {
59 		[SOF_INTEL_IPC4] = "intel/avs-tplg",
60 	},
61 	.default_fw_filename = {
62 		[SOF_INTEL_IPC4] = "dsp_basefw.bin",
63 	},
64 	.nocodec_tplg_filename = "sof-kbl-nocodec.tplg",
65 	.ops = &sof_skl_ops,
66 	.ops_init = sof_skl_ops_init,
67 	.ops_free = hda_ops_free,
68 };
69 
70 /* PCI IDs */
71 static const struct pci_device_id sof_pci_ids[] = {
72 	/* Sunrise Point-LP */
73 	{ PCI_DEVICE(0x8086, 0x9d70), .driver_data = (unsigned long)&skl_desc},
74 	/* KBL */
75 	{ PCI_DEVICE(0x8086, 0x9d71), .driver_data = (unsigned long)&kbl_desc},
76 	{ 0, }
77 };
78 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
79 
80 /* pci_driver definition */
81 static struct pci_driver snd_sof_pci_intel_skl_driver = {
82 	.name = "sof-audio-pci-intel-skl",
83 	.id_table = sof_pci_ids,
84 	.probe = hda_pci_intel_probe,
85 	.remove = sof_pci_remove,
86 	.shutdown = sof_pci_shutdown,
87 	.driver = {
88 		.pm = &sof_pci_pm,
89 	},
90 };
91 module_pci_driver(snd_sof_pci_intel_skl_driver);
92 
93 MODULE_LICENSE("Dual BSD/GPL");
94 MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
95 MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
96