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