Debian Codegraph @

src/soc/intel/common/block/dtt/dtt.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <acpi/acpigen.h>
4 #include <acpi/acpigen_pci.h>
5 #include <device/device.h>
6 #include <device/pci.h>
7 #include <device/pci_ids.h>
8 #include <intelblocks/acpi.h>
9
10 static const unsigned short pci_device_ids[] = {
11 PCI_DID_INTEL_WCL_DTT,
12 PCI_DID_INTEL_PTL_DTT,
13 PCI_DID_INTEL_RPL_DTT,
14 PCI_DID_INTEL_MTL_DTT,
15 PCI_DID_INTEL_ARL_S_DTT,
16 PCI_DID_INTEL_CML_DTT,
17 PCI_DID_INTEL_TGL_DTT,
18 PCI_DID_INTEL_JSL_DTT,
19 PCI_DID_INTEL_ADL_DTT,
20 0
21 };
22
23 static void dtt_acpi_fill_ssdt(const struct device *dev)
24 {
25 /* Skip if DPTF driver or common DPTF ASL in use since TCPU device will already exist */
26 if (CONFIG(DRIVERS_INTEL_DPTF) || CONFIG(SOC_INTEL_COMMON_BLOCK_DTT_STATIC_ASL))
27 return;
28
29 const char *scope = acpi_device_scope(dev);
30
31 if (!scope)
32 return;
33
34 acpigen_write_scope(scope);
35 acpigen_write_device(soc_acpi_name(dev));
36 acpigen_write_ADR_pci_device(dev);
37 acpigen_write_STA(acpi_device_status(dev));
38 acpigen_pop_len(); /* Device */
39 acpigen_pop_len(); /* Scope */
40 }
41
42 static struct device_operations dptf_dev_ops = {
43 .read_resources = pci_dev_read_resources,
44 .set_resources = pci_dev_set_resources,
45 .enable_resources = pci_dev_enable_resources,
46 .scan_bus = scan_generic_bus,
47 .ops_pci = &pci_dev_ops_pci,
48 #if CONFIG(HAVE_ACPI_TABLES)
49 .acpi_fill_ssdt = dtt_acpi_fill_ssdt,
50 #endif
51 };
52
53 static const struct pci_driver pch_dptf __pci_driver = {
54 .ops = &dptf_dev_ops,
55 .vendor = PCI_VID_INTEL,
56 .devices = pci_device_ids,
57 };