xref: /openbmc/linux/sound/soc/sof/intel/pci-tgl.c (revision 32daa5d7)
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-2021 Intel Corporation. All rights reserved.
7 //
8 // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
9 //
10 
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>
16 #include "../ops.h"
17 #include "../sof-pci-dev.h"
18 
19 /* platform specific devices */
20 #include "hda.h"
21 
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 	.resindex_dma_base      = -1,
31 	.chip_info = &tgl_chip_info,
32 	.default_fw_path = "intel/sof",
33 	.default_tplg_path = "intel/sof-tplg",
34 	.default_fw_filename = "sof-tgl.ri",
35 	.nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
36 	.ops = &sof_tgl_ops,
37 };
38 
39 static const struct sof_dev_desc tglh_desc = {
40 	.machines               = snd_soc_acpi_intel_tgl_machines,
41 	.alt_machines		= snd_soc_acpi_intel_tgl_sdw_machines,
42 	.resindex_lpe_base      = 0,
43 	.resindex_pcicfg_base   = -1,
44 	.resindex_imr_base      = -1,
45 	.irqindex_host_ipc      = -1,
46 	.resindex_dma_base      = -1,
47 	.chip_info = &tglh_chip_info,
48 	.default_fw_path = "intel/sof",
49 	.default_tplg_path = "intel/sof-tplg",
50 	.default_fw_filename = "sof-tgl-h.ri",
51 	.nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
52 	.ops = &sof_tgl_ops,
53 };
54 
55 static const struct sof_dev_desc ehl_desc = {
56 	.machines               = snd_soc_acpi_intel_ehl_machines,
57 	.use_acpi_target_states	= true,
58 	.resindex_lpe_base      = 0,
59 	.resindex_pcicfg_base   = -1,
60 	.resindex_imr_base      = -1,
61 	.irqindex_host_ipc      = -1,
62 	.resindex_dma_base      = -1,
63 	.chip_info = &ehl_chip_info,
64 	.default_fw_path = "intel/sof",
65 	.default_tplg_path = "intel/sof-tplg",
66 	.default_fw_filename = "sof-ehl.ri",
67 	.nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
68 	.ops = &sof_tgl_ops,
69 };
70 
71 static const struct sof_dev_desc adls_desc = {
72 	.machines               = snd_soc_acpi_intel_adl_machines,
73 	.alt_machines           = snd_soc_acpi_intel_adl_sdw_machines,
74 	.resindex_lpe_base      = 0,
75 	.resindex_pcicfg_base   = -1,
76 	.resindex_imr_base      = -1,
77 	.irqindex_host_ipc      = -1,
78 	.resindex_dma_base      = -1,
79 	.chip_info = &adls_chip_info,
80 	.default_fw_path = "intel/sof",
81 	.default_tplg_path = "intel/sof-tplg",
82 	.default_fw_filename = "sof-adl-s.ri",
83 	.nocodec_tplg_filename = "sof-adl-nocodec.tplg",
84 	.ops = &sof_tgl_ops,
85 };
86 
87 /* PCI IDs */
88 static const struct pci_device_id sof_pci_ids[] = {
89 	{ PCI_DEVICE(0x8086, 0xa0c8), /* TGL-LP */
90 		.driver_data = (unsigned long)&tgl_desc},
91 	{ PCI_DEVICE(0x8086, 0x43c8), /* TGL-H */
92 		.driver_data = (unsigned long)&tglh_desc},
93 	{ PCI_DEVICE(0x8086, 0x4b55), /* EHL */
94 		.driver_data = (unsigned long)&ehl_desc},
95 	{ PCI_DEVICE(0x8086, 0x4b58), /* EHL */
96 		.driver_data = (unsigned long)&ehl_desc},
97 	{ PCI_DEVICE(0x8086, 0x7ad0), /* ADL-S */
98 		.driver_data = (unsigned long)&adls_desc},
99 	{ PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */
100 		.driver_data = (unsigned long)&tgl_desc},
101 	{ 0, }
102 };
103 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
104 
105 /* pci_driver definition */
106 static struct pci_driver snd_sof_pci_intel_tgl_driver = {
107 	.name = "sof-audio-pci-intel-tgl",
108 	.id_table = sof_pci_ids,
109 	.probe = hda_pci_intel_probe,
110 	.remove = sof_pci_remove,
111 	.shutdown = sof_pci_shutdown,
112 	.driver = {
113 		.pm = &sof_pci_pm,
114 	},
115 };
116 module_pci_driver(snd_sof_pci_intel_tgl_driver);
117 
118 MODULE_LICENSE("Dual BSD/GPL");
119 MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
120 MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
121 
122