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