xref: /openbmc/linux/sound/soc/sof/intel/pci-skl.c (revision e92606fa)
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 	.default_fw_path = {
30 		[SOF_INTEL_IPC4] = "intel/avs/skl",
31 	},
32 	.default_tplg_path = {
33 		[SOF_INTEL_IPC4] = "intel/avs-tplg",
34 	},
35 	.default_fw_filename = {
36 		[SOF_INTEL_IPC4] = "dsp_basefw.bin",
37 	},
38 	.nocodec_tplg_filename = "sof-skl-nocodec.tplg",
39 	.ops = &sof_skl_ops,
40 	.ops_init = sof_skl_ops_init,
41 	.ops_free = hda_ops_free,
42 };
43 
44 static struct sof_dev_desc kbl_desc = {
45 	.machines		= snd_soc_acpi_intel_kbl_machines,
46 	.resindex_lpe_base	= 0,
47 	.resindex_pcicfg_base	= -1,
48 	.resindex_imr_base	= -1,
49 	.chip_info = &skl_chip_info,
50 	.irqindex_host_ipc	= -1,
51 	.ipc_supported_mask	= BIT(SOF_INTEL_IPC4),
52 	.ipc_default		= SOF_INTEL_IPC4,
53 	.default_fw_path = {
54 		[SOF_INTEL_IPC4] = "intel/avs/kbl",
55 	},
56 	.default_tplg_path = {
57 		[SOF_INTEL_IPC4] = "intel/avs-tplg",
58 	},
59 	.default_fw_filename = {
60 		[SOF_INTEL_IPC4] = "dsp_basefw.bin",
61 	},
62 	.nocodec_tplg_filename = "sof-kbl-nocodec.tplg",
63 	.ops = &sof_skl_ops,
64 	.ops_init = sof_skl_ops_init,
65 	.ops_free = hda_ops_free,
66 };
67 
68 /* PCI IDs */
69 static const struct pci_device_id sof_pci_ids[] = {
70 	/* Sunrise Point-LP */
71 	{ PCI_DEVICE(0x8086, 0x9d70), .driver_data = (unsigned long)&skl_desc},
72 	/* KBL */
73 	{ PCI_DEVICE(0x8086, 0x9d71), .driver_data = (unsigned long)&kbl_desc},
74 	{ 0, }
75 };
76 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
77 
78 /* pci_driver definition */
79 static struct pci_driver snd_sof_pci_intel_skl_driver = {
80 	.name = "sof-audio-pci-intel-skl",
81 	.id_table = sof_pci_ids,
82 	.probe = hda_pci_intel_probe,
83 	.remove = sof_pci_remove,
84 	.shutdown = sof_pci_shutdown,
85 	.driver = {
86 		.pm = &sof_pci_pm,
87 	},
88 };
89 module_pci_driver(snd_sof_pci_intel_skl_driver);
90 
91 MODULE_LICENSE("Dual BSD/GPL");
92 MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
93 MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
94