Merge tag 'soc-drivers-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-block.git] / sound / soc / sof / intel / pci-tgl.c
CommitLineData
8d4ba1be
PLB
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
22static 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,
8d4ba1be 30 .chip_info = &tgl_chip_info,
a8fffb94
PU
31 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
32 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 33 .dspless_mode_supported = true, /* Only supported for HDaudio */
a3757915 34 .default_fw_path = {
a8fffb94 35 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 36 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/tgl",
a3757915 37 },
cd6f2a2e 38 .default_lib_path = {
d463bcd7 39 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/tgl",
cd6f2a2e 40 },
a3757915 41 .default_tplg_path = {
a8fffb94 42 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 43 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
a3757915 44 },
a97abb3c 45 .default_fw_filename = {
a8fffb94 46 [SOF_IPC_TYPE_3] = "sof-tgl.ri",
d463bcd7 47 [SOF_IPC_TYPE_4] = "sof-tgl.ri",
a97abb3c 48 },
8d4ba1be
PLB
49 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
50 .ops = &sof_tgl_ops,
37e809d5 51 .ops_init = sof_tgl_ops_init,
9eb2b4ca 52 .ops_free = hda_ops_free,
8d4ba1be
PLB
53};
54
55static const struct sof_dev_desc tglh_desc = {
56 .machines = snd_soc_acpi_intel_tgl_machines,
57 .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines,
1b988997 58 .use_acpi_target_states = true,
8d4ba1be
PLB
59 .resindex_lpe_base = 0,
60 .resindex_pcicfg_base = -1,
61 .resindex_imr_base = -1,
62 .irqindex_host_ipc = -1,
8d4ba1be 63 .chip_info = &tglh_chip_info,
a8fffb94
PU
64 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
65 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 66 .dspless_mode_supported = true, /* Only supported for HDaudio */
a3757915 67 .default_fw_path = {
a8fffb94 68 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 69 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/tgl-h",
a3757915 70 },
cd6f2a2e 71 .default_lib_path = {
d463bcd7 72 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/tgl-h",
cd6f2a2e 73 },
a3757915 74 .default_tplg_path = {
a8fffb94 75 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 76 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
a3757915 77 },
a97abb3c 78 .default_fw_filename = {
a8fffb94 79 [SOF_IPC_TYPE_3] = "sof-tgl-h.ri",
d463bcd7 80 [SOF_IPC_TYPE_4] = "sof-tgl-h.ri",
a97abb3c 81 },
8d4ba1be
PLB
82 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
83 .ops = &sof_tgl_ops,
37e809d5 84 .ops_init = sof_tgl_ops_init,
1da51943 85 .ops_free = hda_ops_free,
8d4ba1be
PLB
86};
87
88static const struct sof_dev_desc ehl_desc = {
89 .machines = snd_soc_acpi_intel_ehl_machines,
90 .use_acpi_target_states = true,
91 .resindex_lpe_base = 0,
92 .resindex_pcicfg_base = -1,
93 .resindex_imr_base = -1,
94 .irqindex_host_ipc = -1,
8d4ba1be 95 .chip_info = &ehl_chip_info,
a8fffb94
PU
96 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
97 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 98 .dspless_mode_supported = true, /* Only supported for HDaudio */
a3757915 99 .default_fw_path = {
a8fffb94 100 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 101 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/ehl",
a3757915 102 },
cd6f2a2e 103 .default_lib_path = {
d463bcd7 104 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/ehl",
cd6f2a2e 105 },
a3757915 106 .default_tplg_path = {
a8fffb94 107 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 108 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
a3757915 109 },
a97abb3c 110 .default_fw_filename = {
a8fffb94 111 [SOF_IPC_TYPE_3] = "sof-ehl.ri",
d463bcd7 112 [SOF_IPC_TYPE_4] = "sof-ehl.ri",
a97abb3c 113 },
8d4ba1be 114 .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
3c429f86 115 .ops = &sof_tgl_ops,
37e809d5 116 .ops_init = sof_tgl_ops_init,
9eb2b4ca 117 .ops_free = hda_ops_free,
8d4ba1be
PLB
118};
119
120static const struct sof_dev_desc adls_desc = {
121 .machines = snd_soc_acpi_intel_adl_machines,
122 .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
1b988997 123 .use_acpi_target_states = true,
8d4ba1be
PLB
124 .resindex_lpe_base = 0,
125 .resindex_pcicfg_base = -1,
126 .resindex_imr_base = -1,
127 .irqindex_host_ipc = -1,
8d4ba1be 128 .chip_info = &adls_chip_info,
a8fffb94
PU
129 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
130 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 131 .dspless_mode_supported = true, /* Only supported for HDaudio */
a3757915 132 .default_fw_path = {
a8fffb94 133 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 134 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/adl-s",
a3757915 135 },
cd6f2a2e 136 .default_lib_path = {
d463bcd7 137 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/adl-s",
cd6f2a2e 138 },
a3757915 139 .default_tplg_path = {
a8fffb94 140 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 141 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
a3757915 142 },
a97abb3c 143 .default_fw_filename = {
a8fffb94 144 [SOF_IPC_TYPE_3] = "sof-adl-s.ri",
d463bcd7 145 [SOF_IPC_TYPE_4] = "sof-adl-s.ri",
a97abb3c 146 },
8d4ba1be
PLB
147 .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
148 .ops = &sof_tgl_ops,
37e809d5 149 .ops_init = sof_tgl_ops_init,
9eb2b4ca 150 .ops_free = hda_ops_free,
8d4ba1be
PLB
151};
152
4ad03f89
SP
153static const struct sof_dev_desc adl_desc = {
154 .machines = snd_soc_acpi_intel_adl_machines,
155 .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
aa21548e 156 .use_acpi_target_states = true,
4ad03f89
SP
157 .resindex_lpe_base = 0,
158 .resindex_pcicfg_base = -1,
159 .resindex_imr_base = -1,
160 .irqindex_host_ipc = -1,
4ad03f89 161 .chip_info = &tgl_chip_info,
a8fffb94
PU
162 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
163 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 164 .dspless_mode_supported = true, /* Only supported for HDaudio */
a3757915 165 .default_fw_path = {
a8fffb94 166 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 167 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/adl",
a3757915 168 },
cd6f2a2e 169 .default_lib_path = {
d463bcd7 170 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/adl",
cd6f2a2e 171 },
a3757915 172 .default_tplg_path = {
a8fffb94 173 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 174 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
a3757915 175 },
a97abb3c 176 .default_fw_filename = {
a8fffb94 177 [SOF_IPC_TYPE_3] = "sof-adl.ri",
d463bcd7 178 [SOF_IPC_TYPE_4] = "sof-adl.ri",
a97abb3c 179 },
4ad03f89
SP
180 .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
181 .ops = &sof_tgl_ops,
37e809d5 182 .ops_init = sof_tgl_ops_init,
9eb2b4ca 183 .ops_free = hda_ops_free,
4ad03f89
SP
184};
185
05de5cf6
PLB
186static const struct sof_dev_desc adl_n_desc = {
187 .machines = snd_soc_acpi_intel_adl_machines,
188 .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
189 .use_acpi_target_states = true,
190 .resindex_lpe_base = 0,
191 .resindex_pcicfg_base = -1,
192 .resindex_imr_base = -1,
193 .irqindex_host_ipc = -1,
194 .chip_info = &tgl_chip_info,
a8fffb94
PU
195 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
196 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 197 .dspless_mode_supported = true, /* Only supported for HDaudio */
05de5cf6 198 .default_fw_path = {
a8fffb94 199 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 200 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/adl-n",
05de5cf6 201 },
25bbc0c5 202 .default_lib_path = {
d463bcd7 203 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/adl-n",
25bbc0c5 204 },
05de5cf6 205 .default_tplg_path = {
a8fffb94 206 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 207 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
05de5cf6
PLB
208 },
209 .default_fw_filename = {
a8fffb94 210 [SOF_IPC_TYPE_3] = "sof-adl-n.ri",
d463bcd7 211 [SOF_IPC_TYPE_4] = "sof-adl-n.ri",
05de5cf6
PLB
212 },
213 .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
214 .ops = &sof_tgl_ops,
215 .ops_init = sof_tgl_ops_init,
9eb2b4ca 216 .ops_free = hda_ops_free,
05de5cf6
PLB
217};
218
63d375b9
KV
219static const struct sof_dev_desc rpls_desc = {
220 .machines = snd_soc_acpi_intel_rpl_machines,
221 .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
222 .use_acpi_target_states = true,
223 .resindex_lpe_base = 0,
224 .resindex_pcicfg_base = -1,
225 .resindex_imr_base = -1,
226 .irqindex_host_ipc = -1,
227 .chip_info = &adls_chip_info,
a8fffb94
PU
228 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
229 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 230 .dspless_mode_supported = true, /* Only supported for HDaudio */
63d375b9 231 .default_fw_path = {
a8fffb94 232 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 233 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/rpl-s",
63d375b9 234 },
cd6f2a2e 235 .default_lib_path = {
d463bcd7 236 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/rpl-s",
cd6f2a2e 237 },
63d375b9 238 .default_tplg_path = {
a8fffb94 239 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 240 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
63d375b9
KV
241 },
242 .default_fw_filename = {
a8fffb94 243 [SOF_IPC_TYPE_3] = "sof-rpl-s.ri",
d463bcd7 244 [SOF_IPC_TYPE_4] = "sof-rpl-s.ri",
63d375b9
KV
245 },
246 .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
247 .ops = &sof_tgl_ops,
248 .ops_init = sof_tgl_ops_init,
376f79bb 249 .ops_free = hda_ops_free,
63d375b9
KV
250};
251
252static const struct sof_dev_desc rpl_desc = {
253 .machines = snd_soc_acpi_intel_rpl_machines,
254 .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
255 .use_acpi_target_states = true,
256 .resindex_lpe_base = 0,
257 .resindex_pcicfg_base = -1,
258 .resindex_imr_base = -1,
259 .irqindex_host_ipc = -1,
260 .chip_info = &tgl_chip_info,
a8fffb94
PU
261 .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
262 .ipc_default = SOF_IPC_TYPE_3,
5962c2a5 263 .dspless_mode_supported = true, /* Only supported for HDaudio */
63d375b9 264 .default_fw_path = {
a8fffb94 265 [SOF_IPC_TYPE_3] = "intel/sof",
d463bcd7 266 [SOF_IPC_TYPE_4] = "intel/sof-ipc4/rpl",
63d375b9 267 },
cd6f2a2e 268 .default_lib_path = {
d463bcd7 269 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/rpl",
cd6f2a2e 270 },
63d375b9 271 .default_tplg_path = {
a8fffb94 272 [SOF_IPC_TYPE_3] = "intel/sof-tplg",
d463bcd7 273 [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
63d375b9
KV
274 },
275 .default_fw_filename = {
a8fffb94 276 [SOF_IPC_TYPE_3] = "sof-rpl.ri",
d463bcd7 277 [SOF_IPC_TYPE_4] = "sof-rpl.ri",
63d375b9
KV
278 },
279 .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
280 .ops = &sof_tgl_ops,
281 .ops_init = sof_tgl_ops_init,
376f79bb 282 .ops_free = hda_ops_free,
63d375b9
KV
283};
284
8d4ba1be
PLB
285/* PCI IDs */
286static const struct pci_device_id sof_pci_ids[] = {
a9022f4b
AS
287 { PCI_DEVICE_DATA(INTEL, HDA_TGL_LP, &tgl_desc) },
288 { PCI_DEVICE_DATA(INTEL, HDA_TGL_H, &tglh_desc) },
289 { PCI_DEVICE_DATA(INTEL, HDA_EHL_0, &ehl_desc) },
290 { PCI_DEVICE_DATA(INTEL, HDA_EHL_3, &ehl_desc) },
291 { PCI_DEVICE_DATA(INTEL, HDA_ADL_S, &adls_desc) },
292 { PCI_DEVICE_DATA(INTEL, HDA_RPL_S, &rpls_desc) },
293 { PCI_DEVICE_DATA(INTEL, HDA_ADL_P, &adl_desc) },
294 { PCI_DEVICE_DATA(INTEL, HDA_ADL_PS, &adl_desc) },
295 { PCI_DEVICE_DATA(INTEL, HDA_RPL_P_0, &rpl_desc) },
296 { PCI_DEVICE_DATA(INTEL, HDA_RPL_P_1, &rpl_desc) },
297 { PCI_DEVICE_DATA(INTEL, HDA_ADL_M, &adl_desc) },
298 { PCI_DEVICE_DATA(INTEL, HDA_ADL_PX, &adl_desc) },
299 { PCI_DEVICE_DATA(INTEL, HDA_RPL_M, &rpl_desc) },
300 { PCI_DEVICE_DATA(INTEL, HDA_RPL_PX, &rpl_desc) },
301 { PCI_DEVICE_DATA(INTEL, HDA_ADL_N, &adl_n_desc) },
8d4ba1be
PLB
302 { 0, }
303};
304MODULE_DEVICE_TABLE(pci, sof_pci_ids);
305
306/* pci_driver definition */
307static struct pci_driver snd_sof_pci_intel_tgl_driver = {
308 .name = "sof-audio-pci-intel-tgl",
309 .id_table = sof_pci_ids,
194fe0fc 310 .probe = hda_pci_intel_probe,
8d4ba1be
PLB
311 .remove = sof_pci_remove,
312 .shutdown = sof_pci_shutdown,
313 .driver = {
314 .pm = &sof_pci_pm,
315 },
316};
317module_pci_driver(snd_sof_pci_intel_tgl_driver);
318
319MODULE_LICENSE("Dual BSD/GPL");
320MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
321MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);