From 8a1ad138225e5a31d75cd77b9d7f183f3ab6d39c Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Thu, 5 Nov 2020 14:38:51 -0700 Subject: device: Move pci_dev_is_wake_source function Move this function to pci_ops.c, which is already included in the smm build. This is required to use this function in elog functionality, which is called from SMM. Signed-off-by: Tim Wawrzynczak Change-Id: Ie5583c04366c9a16bc1b00a6892d39eeafe5da49 Reviewed-on: https://review.coreboot.org/c/coreboot/+/47260 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Karthik Ramasubramanian --- src/include/device/pci_ops.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/include/device/pci_ops.h') diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index cdf02d6a56..7fe7d429e2 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -209,4 +209,12 @@ u16 pci_find_capability(const struct device *dev, u16 cap) return pci_s_find_capability(PCI_BDF(dev), cap); } +/* + * Determine if the given PCI device is the source of wake from sleep by checking PME_STATUS and + * PME_ENABLE bits in PM control and status register. + * + * Returns true if PCI device is wake source, false otherwise. + */ +bool pci_dev_is_wake_source(const struct device *dev); + #endif /* PCI_OPS_H */ -- cgit v1.2.3