xref: /linux/sound/soc/sof/intel/pci-nvl.c (revision af0bc3ac9a9e830cb52b718ecb237c4e76a466be)
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) 2025 Intel Corporation.
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 #include "nvl.h"
20 
21 /* PantherLake ops */
22 static struct snd_sof_dsp_ops sof_nvl_ops;
23 
24 static int sof_nvl_ops_init(struct snd_sof_dev *sdev)
25 {
26 	return sof_nvl_set_ops(sdev, &sof_nvl_ops);
27 }
28 
29 static const struct sof_dev_desc nvl_desc = {
30 	.use_acpi_target_states	= true,
31 	.machines               = snd_soc_acpi_intel_nvl_machines,
32 	.alt_machines		= snd_soc_acpi_intel_nvl_sdw_machines,
33 	.resindex_lpe_base      = 0,
34 	.resindex_pcicfg_base   = -1,
35 	.resindex_imr_base      = -1,
36 	.irqindex_host_ipc      = -1,
37 	.chip_info		= &nvl_chip_info,
38 	.ipc_supported_mask	= BIT(SOF_IPC_TYPE_4),
39 	.ipc_default		= SOF_IPC_TYPE_4,
40 	.dspless_mode_supported	= true,
41 	.on_demand_dsp_boot	= true,
42 	.default_fw_path = {
43 		[SOF_IPC_TYPE_4] = "intel/sof-ipc4/nvl",
44 	},
45 	.default_lib_path = {
46 		[SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/nvl",
47 	},
48 	.default_tplg_path = {
49 		[SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
50 	},
51 	.default_fw_filename = {
52 		[SOF_IPC_TYPE_4] = "sof-nvl.ri",
53 	},
54 	.nocodec_tplg_filename = "sof-nvl-nocodec.tplg",
55 	.ops = &sof_nvl_ops,
56 	.ops_init = sof_nvl_ops_init,
57 };
58 
59 static const struct sof_dev_desc nvl_s_desc = {
60 	.use_acpi_target_states	= true,
61 	.machines               = snd_soc_acpi_intel_nvl_machines,
62 	.alt_machines		= snd_soc_acpi_intel_nvl_sdw_machines,
63 	.resindex_lpe_base      = 0,
64 	.resindex_pcicfg_base   = -1,
65 	.resindex_imr_base      = -1,
66 	.irqindex_host_ipc      = -1,
67 	.chip_info		= &nvl_s_chip_info,
68 	.ipc_supported_mask	= BIT(SOF_IPC_TYPE_4),
69 	.ipc_default		= SOF_IPC_TYPE_4,
70 	.dspless_mode_supported	= true,
71 	.on_demand_dsp_boot	= true,
72 	.default_fw_path = {
73 		[SOF_IPC_TYPE_4] = "intel/sof-ipc4/nvl-s",
74 	},
75 	.default_lib_path = {
76 		[SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/nvl-s",
77 	},
78 	.default_tplg_path = {
79 		[SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
80 	},
81 	.default_fw_filename = {
82 		[SOF_IPC_TYPE_4] = "sof-nvl-s.ri",
83 	},
84 	.nocodec_tplg_filename = "sof-nvl-nocodec.tplg",
85 	.ops = &sof_nvl_ops,
86 	.ops_init = sof_nvl_ops_init,
87 };
88 
89 /* PCI IDs */
90 static const struct pci_device_id sof_pci_ids[] = {
91 	{ PCI_DEVICE_DATA(INTEL, HDA_NVL, &nvl_desc) }, /* NVL */
92 	{ PCI_DEVICE_DATA(INTEL, HDA_NVL_S, &nvl_s_desc) }, /* NVL-S */
93 	{ 0, }
94 };
95 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
96 
97 /* pci_driver definition */
98 static struct pci_driver snd_sof_pci_intel_nvl_driver = {
99 	.name = "sof-audio-pci-intel-nvl",
100 	.id_table = sof_pci_ids,
101 	.probe = hda_pci_intel_probe,
102 	.remove = sof_pci_remove,
103 	.shutdown = sof_pci_shutdown,
104 	.driver = {
105 		.pm = pm_ptr(&sof_pci_pm),
106 	},
107 };
108 module_pci_driver(snd_sof_pci_intel_nvl_driver);
109 
110 MODULE_LICENSE("Dual BSD/GPL");
111 MODULE_DESCRIPTION("SOF support for NovaLake platforms");
112 MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_HDA_GENERIC");
113 MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_HDA_COMMON");
114 MODULE_IMPORT_NS("SND_SOC_SOF_PCI_DEV");
115