xref: /openbmc/linux/sound/soc/sof/intel/pci-apl.c (revision 9eb2b4ca)
18d4ba1beSPierre-Louis Bossart // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
28d4ba1beSPierre-Louis Bossart //
38d4ba1beSPierre-Louis Bossart // This file is provided under a dual BSD/GPLv2 license.  When using or
48d4ba1beSPierre-Louis Bossart // redistributing this file, you may do so under either license.
58d4ba1beSPierre-Louis Bossart //
68d4ba1beSPierre-Louis Bossart // Copyright(c) 2018-2021 Intel Corporation. All rights reserved.
78d4ba1beSPierre-Louis Bossart //
88d4ba1beSPierre-Louis Bossart // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
98d4ba1beSPierre-Louis Bossart //
108d4ba1beSPierre-Louis Bossart 
118d4ba1beSPierre-Louis Bossart #include <linux/module.h>
128d4ba1beSPierre-Louis Bossart #include <linux/pci.h>
138d4ba1beSPierre-Louis Bossart #include <sound/soc-acpi.h>
148d4ba1beSPierre-Louis Bossart #include <sound/soc-acpi-intel-match.h>
158d4ba1beSPierre-Louis Bossart #include <sound/sof.h>
168d4ba1beSPierre-Louis Bossart #include "../ops.h"
178d4ba1beSPierre-Louis Bossart #include "../sof-pci-dev.h"
188d4ba1beSPierre-Louis Bossart 
198d4ba1beSPierre-Louis Bossart /* platform specific devices */
208d4ba1beSPierre-Louis Bossart #include "hda.h"
218d4ba1beSPierre-Louis Bossart 
228d4ba1beSPierre-Louis Bossart static const struct sof_dev_desc bxt_desc = {
238d4ba1beSPierre-Louis Bossart 	.machines		= snd_soc_acpi_intel_bxt_machines,
248d4ba1beSPierre-Louis Bossart 	.use_acpi_target_states	= true,
258d4ba1beSPierre-Louis Bossart 	.resindex_lpe_base	= 0,
268d4ba1beSPierre-Louis Bossart 	.resindex_pcicfg_base	= -1,
278d4ba1beSPierre-Louis Bossart 	.resindex_imr_base	= -1,
288d4ba1beSPierre-Louis Bossart 	.irqindex_host_ipc	= -1,
298d4ba1beSPierre-Louis Bossart 	.chip_info = &apl_chip_info,
300cf8ff05SPierre-Louis Bossart 	.ipc_supported_mask	= BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
310cf8ff05SPierre-Louis Bossart 	.ipc_default		= SOF_IPC,
32a3757915SPierre-Louis Bossart 	.default_fw_path = {
33a3757915SPierre-Louis Bossart 		[SOF_IPC] = "intel/sof",
340cf8ff05SPierre-Louis Bossart 		[SOF_INTEL_IPC4] = "intel/avs/apl",
35a3757915SPierre-Louis Bossart 	},
36cd6f2a2eSPeter Ujfalusi 	.default_lib_path = {
37cd6f2a2eSPeter Ujfalusi 		[SOF_INTEL_IPC4] = "intel/avs-lib/apl",
38cd6f2a2eSPeter Ujfalusi 	},
39a3757915SPierre-Louis Bossart 	.default_tplg_path = {
40a3757915SPierre-Louis Bossart 		[SOF_IPC] = "intel/sof-tplg",
410cf8ff05SPierre-Louis Bossart 		[SOF_INTEL_IPC4] = "intel/avs-tplg",
42a3757915SPierre-Louis Bossart 	},
43a97abb3cSPierre-Louis Bossart 	.default_fw_filename = {
44a97abb3cSPierre-Louis Bossart 		[SOF_IPC] = "sof-apl.ri",
45a97abb3cSPierre-Louis Bossart 		[SOF_INTEL_IPC4] = "dsp_basefw.bin",
46a97abb3cSPierre-Louis Bossart 	},
478d4ba1beSPierre-Louis Bossart 	.nocodec_tplg_filename = "sof-apl-nocodec.tplg",
488d4ba1beSPierre-Louis Bossart 	.ops = &sof_apl_ops,
4937e809d5SPierre-Louis Bossart 	.ops_init = sof_apl_ops_init,
501da51943SRanjani Sridharan 	.ops_free = hda_ops_free,
518d4ba1beSPierre-Louis Bossart };
528d4ba1beSPierre-Louis Bossart 
538d4ba1beSPierre-Louis Bossart static const struct sof_dev_desc glk_desc = {
548d4ba1beSPierre-Louis Bossart 	.machines		= snd_soc_acpi_intel_glk_machines,
558d4ba1beSPierre-Louis Bossart 	.use_acpi_target_states	= true,
568d4ba1beSPierre-Louis Bossart 	.resindex_lpe_base	= 0,
578d4ba1beSPierre-Louis Bossart 	.resindex_pcicfg_base	= -1,
588d4ba1beSPierre-Louis Bossart 	.resindex_imr_base	= -1,
598d4ba1beSPierre-Louis Bossart 	.irqindex_host_ipc	= -1,
608d4ba1beSPierre-Louis Bossart 	.chip_info = &apl_chip_info,
610cf8ff05SPierre-Louis Bossart 	.ipc_supported_mask	= BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
620cf8ff05SPierre-Louis Bossart 	.ipc_default		= SOF_IPC,
63a3757915SPierre-Louis Bossart 	.default_fw_path = {
64a3757915SPierre-Louis Bossart 		[SOF_IPC] = "intel/sof",
650cf8ff05SPierre-Louis Bossart 		[SOF_INTEL_IPC4] = "intel/avs/glk",
66a3757915SPierre-Louis Bossart 	},
67cd6f2a2eSPeter Ujfalusi 	.default_lib_path = {
68cd6f2a2eSPeter Ujfalusi 		[SOF_INTEL_IPC4] = "intel/avs-lib/glk",
69cd6f2a2eSPeter Ujfalusi 	},
70a3757915SPierre-Louis Bossart 	.default_tplg_path = {
71a3757915SPierre-Louis Bossart 		[SOF_IPC] = "intel/sof-tplg",
720cf8ff05SPierre-Louis Bossart 		[SOF_INTEL_IPC4] = "intel/avs-tplg",
73a3757915SPierre-Louis Bossart 	},
74a97abb3cSPierre-Louis Bossart 	.default_fw_filename = {
75a97abb3cSPierre-Louis Bossart 		[SOF_IPC] = "sof-glk.ri",
76a97abb3cSPierre-Louis Bossart 		[SOF_INTEL_IPC4] = "dsp_basefw.bin",
77a97abb3cSPierre-Louis Bossart 	},
788d4ba1beSPierre-Louis Bossart 	.nocodec_tplg_filename = "sof-glk-nocodec.tplg",
798d4ba1beSPierre-Louis Bossart 	.ops = &sof_apl_ops,
8037e809d5SPierre-Louis Bossart 	.ops_init = sof_apl_ops_init,
81*9eb2b4caSRanjani Sridharan 	.ops_free = hda_ops_free,
828d4ba1beSPierre-Louis Bossart };
838d4ba1beSPierre-Louis Bossart 
848d4ba1beSPierre-Louis Bossart /* PCI IDs */
858d4ba1beSPierre-Louis Bossart static const struct pci_device_id sof_pci_ids[] = {
868d4ba1beSPierre-Louis Bossart 	{ PCI_DEVICE(0x8086, 0x5a98), /* BXT-P (ApolloLake) */
878d4ba1beSPierre-Louis Bossart 		.driver_data = (unsigned long)&bxt_desc},
888d4ba1beSPierre-Louis Bossart 	{ PCI_DEVICE(0x8086, 0x1a98),/* BXT-T */
898d4ba1beSPierre-Louis Bossart 		.driver_data = (unsigned long)&bxt_desc},
908d4ba1beSPierre-Louis Bossart 	{ PCI_DEVICE(0x8086, 0x3198), /* GeminiLake */
918d4ba1beSPierre-Louis Bossart 		.driver_data = (unsigned long)&glk_desc},
928d4ba1beSPierre-Louis Bossart 	{ 0, }
938d4ba1beSPierre-Louis Bossart };
948d4ba1beSPierre-Louis Bossart MODULE_DEVICE_TABLE(pci, sof_pci_ids);
958d4ba1beSPierre-Louis Bossart 
968d4ba1beSPierre-Louis Bossart /* pci_driver definition */
978d4ba1beSPierre-Louis Bossart static struct pci_driver snd_sof_pci_intel_apl_driver = {
988d4ba1beSPierre-Louis Bossart 	.name = "sof-audio-pci-intel-apl",
998d4ba1beSPierre-Louis Bossart 	.id_table = sof_pci_ids,
100194fe0fcSPierre-Louis Bossart 	.probe = hda_pci_intel_probe,
1018d4ba1beSPierre-Louis Bossart 	.remove = sof_pci_remove,
1028d4ba1beSPierre-Louis Bossart 	.shutdown = sof_pci_shutdown,
1038d4ba1beSPierre-Louis Bossart 	.driver = {
1048d4ba1beSPierre-Louis Bossart 		.pm = &sof_pci_pm,
1058d4ba1beSPierre-Louis Bossart 	},
1068d4ba1beSPierre-Louis Bossart };
1078d4ba1beSPierre-Louis Bossart module_pci_driver(snd_sof_pci_intel_apl_driver);
1088d4ba1beSPierre-Louis Bossart 
1098d4ba1beSPierre-Louis Bossart MODULE_LICENSE("Dual BSD/GPL");
1108d4ba1beSPierre-Louis Bossart MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
1118d4ba1beSPierre-Louis Bossart MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
112