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 tgl_desc = { 238d4ba1beSPierre-Louis Bossart .machines = snd_soc_acpi_intel_tgl_machines, 248d4ba1beSPierre-Louis Bossart .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines, 258d4ba1beSPierre-Louis Bossart .use_acpi_target_states = true, 268d4ba1beSPierre-Louis Bossart .resindex_lpe_base = 0, 278d4ba1beSPierre-Louis Bossart .resindex_pcicfg_base = -1, 288d4ba1beSPierre-Louis Bossart .resindex_imr_base = -1, 298d4ba1beSPierre-Louis Bossart .irqindex_host_ipc = -1, 308d4ba1beSPierre-Louis Bossart .chip_info = &tgl_chip_info, 310cf8ff05SPierre-Louis Bossart .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), 320cf8ff05SPierre-Louis Bossart .ipc_default = SOF_IPC, 33a3757915SPierre-Louis Bossart .default_fw_path = { 34a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof", 350cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs/tgl", 36a3757915SPierre-Louis Bossart }, 37a3757915SPierre-Louis Bossart .default_tplg_path = { 38a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof-tplg", 390cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs-tplg", 40a3757915SPierre-Louis Bossart }, 41a97abb3cSPierre-Louis Bossart .default_fw_filename = { 42a97abb3cSPierre-Louis Bossart [SOF_IPC] = "sof-tgl.ri", 43a97abb3cSPierre-Louis Bossart [SOF_INTEL_IPC4] = "dsp_basefw.bin", 44a97abb3cSPierre-Louis Bossart }, 458d4ba1beSPierre-Louis Bossart .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", 468d4ba1beSPierre-Louis Bossart .ops = &sof_tgl_ops, 4737e809d5SPierre-Louis Bossart .ops_init = sof_tgl_ops_init, 488d4ba1beSPierre-Louis Bossart }; 498d4ba1beSPierre-Louis Bossart 508d4ba1beSPierre-Louis Bossart static const struct sof_dev_desc tglh_desc = { 518d4ba1beSPierre-Louis Bossart .machines = snd_soc_acpi_intel_tgl_machines, 528d4ba1beSPierre-Louis Bossart .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines, 531b988997SLibin Yang .use_acpi_target_states = true, 548d4ba1beSPierre-Louis Bossart .resindex_lpe_base = 0, 558d4ba1beSPierre-Louis Bossart .resindex_pcicfg_base = -1, 568d4ba1beSPierre-Louis Bossart .resindex_imr_base = -1, 578d4ba1beSPierre-Louis Bossart .irqindex_host_ipc = -1, 588d4ba1beSPierre-Louis Bossart .chip_info = &tglh_chip_info, 590cf8ff05SPierre-Louis Bossart .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), 600cf8ff05SPierre-Louis Bossart .ipc_default = SOF_IPC, 61a3757915SPierre-Louis Bossart .default_fw_path = { 62a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof", 630cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs/tgl-h", 64a3757915SPierre-Louis Bossart }, 65a3757915SPierre-Louis Bossart .default_tplg_path = { 66a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof-tplg", 670cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs-tplg", 68a3757915SPierre-Louis Bossart }, 69a97abb3cSPierre-Louis Bossart .default_fw_filename = { 70a97abb3cSPierre-Louis Bossart [SOF_IPC] = "sof-tgl-h.ri", 71a97abb3cSPierre-Louis Bossart [SOF_INTEL_IPC4] = "dsp_basefw.bin", 72a97abb3cSPierre-Louis Bossart }, 738d4ba1beSPierre-Louis Bossart .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", 748d4ba1beSPierre-Louis Bossart .ops = &sof_tgl_ops, 7537e809d5SPierre-Louis Bossart .ops_init = sof_tgl_ops_init, 768d4ba1beSPierre-Louis Bossart }; 778d4ba1beSPierre-Louis Bossart 788d4ba1beSPierre-Louis Bossart static const struct sof_dev_desc ehl_desc = { 798d4ba1beSPierre-Louis Bossart .machines = snd_soc_acpi_intel_ehl_machines, 808d4ba1beSPierre-Louis Bossart .use_acpi_target_states = true, 818d4ba1beSPierre-Louis Bossart .resindex_lpe_base = 0, 828d4ba1beSPierre-Louis Bossart .resindex_pcicfg_base = -1, 838d4ba1beSPierre-Louis Bossart .resindex_imr_base = -1, 848d4ba1beSPierre-Louis Bossart .irqindex_host_ipc = -1, 858d4ba1beSPierre-Louis Bossart .chip_info = &ehl_chip_info, 860cf8ff05SPierre-Louis Bossart .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), 870cf8ff05SPierre-Louis Bossart .ipc_default = SOF_IPC, 88a3757915SPierre-Louis Bossart .default_fw_path = { 89a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof", 900cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs/ehl", 91a3757915SPierre-Louis Bossart }, 92a3757915SPierre-Louis Bossart .default_tplg_path = { 93a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof-tplg", 940cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs-tplg", 95a3757915SPierre-Louis Bossart }, 96a97abb3cSPierre-Louis Bossart .default_fw_filename = { 97a97abb3cSPierre-Louis Bossart [SOF_IPC] = "sof-ehl.ri", 98a97abb3cSPierre-Louis Bossart [SOF_INTEL_IPC4] = "dsp_basefw.bin", 99a97abb3cSPierre-Louis Bossart }, 1008d4ba1beSPierre-Louis Bossart .nocodec_tplg_filename = "sof-ehl-nocodec.tplg", 1013c429f86SLibin Yang .ops = &sof_tgl_ops, 10237e809d5SPierre-Louis Bossart .ops_init = sof_tgl_ops_init, 1038d4ba1beSPierre-Louis Bossart }; 1048d4ba1beSPierre-Louis Bossart 1058d4ba1beSPierre-Louis Bossart static const struct sof_dev_desc adls_desc = { 1068d4ba1beSPierre-Louis Bossart .machines = snd_soc_acpi_intel_adl_machines, 1078d4ba1beSPierre-Louis Bossart .alt_machines = snd_soc_acpi_intel_adl_sdw_machines, 1081b988997SLibin Yang .use_acpi_target_states = true, 1098d4ba1beSPierre-Louis Bossart .resindex_lpe_base = 0, 1108d4ba1beSPierre-Louis Bossart .resindex_pcicfg_base = -1, 1118d4ba1beSPierre-Louis Bossart .resindex_imr_base = -1, 1128d4ba1beSPierre-Louis Bossart .irqindex_host_ipc = -1, 1138d4ba1beSPierre-Louis Bossart .chip_info = &adls_chip_info, 1140cf8ff05SPierre-Louis Bossart .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), 1150cf8ff05SPierre-Louis Bossart .ipc_default = SOF_IPC, 116a3757915SPierre-Louis Bossart .default_fw_path = { 117a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof", 1180cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs/adl-s", 119a3757915SPierre-Louis Bossart }, 120a3757915SPierre-Louis Bossart .default_tplg_path = { 121a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof-tplg", 1220cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs-tplg", 123a3757915SPierre-Louis Bossart }, 124a97abb3cSPierre-Louis Bossart .default_fw_filename = { 125a97abb3cSPierre-Louis Bossart [SOF_IPC] = "sof-adl-s.ri", 126a97abb3cSPierre-Louis Bossart [SOF_INTEL_IPC4] = "dsp_basefw.bin", 127a97abb3cSPierre-Louis Bossart }, 1288d4ba1beSPierre-Louis Bossart .nocodec_tplg_filename = "sof-adl-nocodec.tplg", 1298d4ba1beSPierre-Louis Bossart .ops = &sof_tgl_ops, 13037e809d5SPierre-Louis Bossart .ops_init = sof_tgl_ops_init, 1318d4ba1beSPierre-Louis Bossart }; 1328d4ba1beSPierre-Louis Bossart 1334ad03f89SSathya Prakash M R static const struct sof_dev_desc adl_desc = { 1344ad03f89SSathya Prakash M R .machines = snd_soc_acpi_intel_adl_machines, 1354ad03f89SSathya Prakash M R .alt_machines = snd_soc_acpi_intel_adl_sdw_machines, 136aa21548eSSathya Prakash M R .use_acpi_target_states = true, 1374ad03f89SSathya Prakash M R .resindex_lpe_base = 0, 1384ad03f89SSathya Prakash M R .resindex_pcicfg_base = -1, 1394ad03f89SSathya Prakash M R .resindex_imr_base = -1, 1404ad03f89SSathya Prakash M R .irqindex_host_ipc = -1, 1414ad03f89SSathya Prakash M R .chip_info = &tgl_chip_info, 1420cf8ff05SPierre-Louis Bossart .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), 1430cf8ff05SPierre-Louis Bossart .ipc_default = SOF_IPC, 144a3757915SPierre-Louis Bossart .default_fw_path = { 145a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof", 1460cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs/adl", 147a3757915SPierre-Louis Bossart }, 148a3757915SPierre-Louis Bossart .default_tplg_path = { 149a3757915SPierre-Louis Bossart [SOF_IPC] = "intel/sof-tplg", 1500cf8ff05SPierre-Louis Bossart [SOF_INTEL_IPC4] = "intel/avs-tplg", 151a3757915SPierre-Louis Bossart }, 152a97abb3cSPierre-Louis Bossart .default_fw_filename = { 153a97abb3cSPierre-Louis Bossart [SOF_IPC] = "sof-adl.ri", 154a97abb3cSPierre-Louis Bossart [SOF_INTEL_IPC4] = "dsp_basefw.bin", 155a97abb3cSPierre-Louis Bossart }, 1564ad03f89SSathya Prakash M R .nocodec_tplg_filename = "sof-adl-nocodec.tplg", 1574ad03f89SSathya Prakash M R .ops = &sof_tgl_ops, 15837e809d5SPierre-Louis Bossart .ops_init = sof_tgl_ops_init, 1594ad03f89SSathya Prakash M R }; 1604ad03f89SSathya Prakash M R 1618d4ba1beSPierre-Louis Bossart /* PCI IDs */ 1628d4ba1beSPierre-Louis Bossart static const struct pci_device_id sof_pci_ids[] = { 1638d4ba1beSPierre-Louis Bossart { PCI_DEVICE(0x8086, 0xa0c8), /* TGL-LP */ 1648d4ba1beSPierre-Louis Bossart .driver_data = (unsigned long)&tgl_desc}, 1658d4ba1beSPierre-Louis Bossart { PCI_DEVICE(0x8086, 0x43c8), /* TGL-H */ 1668d4ba1beSPierre-Louis Bossart .driver_data = (unsigned long)&tglh_desc}, 1678d4ba1beSPierre-Louis Bossart { PCI_DEVICE(0x8086, 0x4b55), /* EHL */ 1688d4ba1beSPierre-Louis Bossart .driver_data = (unsigned long)&ehl_desc}, 1698d4ba1beSPierre-Louis Bossart { PCI_DEVICE(0x8086, 0x4b58), /* EHL */ 1708d4ba1beSPierre-Louis Bossart .driver_data = (unsigned long)&ehl_desc}, 1718d4ba1beSPierre-Louis Bossart { PCI_DEVICE(0x8086, 0x7ad0), /* ADL-S */ 1728d4ba1beSPierre-Louis Bossart .driver_data = (unsigned long)&adls_desc}, 173d66c57c5SGongjun Song { PCI_DEVICE(0x8086, 0x7a50), /* RPL-S */ 174d66c57c5SGongjun Song .driver_data = (unsigned long)&adls_desc}, 1758d4ba1beSPierre-Louis Bossart { PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */ 1764ad03f89SSathya Prakash M R .driver_data = (unsigned long)&adl_desc}, 177de7dd909SKai Vehmanen { PCI_DEVICE(0x8086, 0x51cd), /* ADL-P */ 178de7dd909SKai Vehmanen .driver_data = (unsigned long)&adl_desc}, 1796c84dae2SMuralidhar Reddy { PCI_DEVICE(0x8086, 0x51c9), /* ADL-PS */ 1806c84dae2SMuralidhar Reddy .driver_data = (unsigned long)&adl_desc}, 181*c2758721SGongjun Song { PCI_DEVICE(0x8086, 0x51ca), /* RPL-P */ 182*c2758721SGongjun Song .driver_data = (unsigned long)&adl_desc}, 183*c2758721SGongjun Song { PCI_DEVICE(0x8086, 0x51cb), /* RPL-P */ 184*c2758721SGongjun Song .driver_data = (unsigned long)&adl_desc}, 1851f763d03SKai Vehmanen { PCI_DEVICE(0x8086, 0x51cc), /* ADL-M */ 1861f763d03SKai Vehmanen .driver_data = (unsigned long)&adl_desc}, 187cd57eb3cSKai Vehmanen { PCI_DEVICE(0x8086, 0x54c8), /* ADL-N */ 188cd57eb3cSKai Vehmanen .driver_data = (unsigned long)&adl_desc}, 1898d4ba1beSPierre-Louis Bossart { 0, } 1908d4ba1beSPierre-Louis Bossart }; 1918d4ba1beSPierre-Louis Bossart MODULE_DEVICE_TABLE(pci, sof_pci_ids); 1928d4ba1beSPierre-Louis Bossart 1938d4ba1beSPierre-Louis Bossart /* pci_driver definition */ 1948d4ba1beSPierre-Louis Bossart static struct pci_driver snd_sof_pci_intel_tgl_driver = { 1958d4ba1beSPierre-Louis Bossart .name = "sof-audio-pci-intel-tgl", 1968d4ba1beSPierre-Louis Bossart .id_table = sof_pci_ids, 197194fe0fcSPierre-Louis Bossart .probe = hda_pci_intel_probe, 1988d4ba1beSPierre-Louis Bossart .remove = sof_pci_remove, 1998d4ba1beSPierre-Louis Bossart .shutdown = sof_pci_shutdown, 2008d4ba1beSPierre-Louis Bossart .driver = { 2018d4ba1beSPierre-Louis Bossart .pm = &sof_pci_pm, 2028d4ba1beSPierre-Louis Bossart }, 2038d4ba1beSPierre-Louis Bossart }; 2048d4ba1beSPierre-Louis Bossart module_pci_driver(snd_sof_pci_intel_tgl_driver); 2058d4ba1beSPierre-Louis Bossart 2068d4ba1beSPierre-Louis Bossart MODULE_LICENSE("Dual BSD/GPL"); 2078d4ba1beSPierre-Louis Bossart MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON); 2088d4ba1beSPierre-Louis Bossart MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV); 209