summaryrefslogtreecommitdiffstats
path: root/src/include/device/pci.h
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-10-03 16:23:55 -0700
committerFurquan Shaikh <furquan@google.com>2020-10-11 02:13:17 +0000
commit494f319be78dc08c72d58cdd94bf09213b48238c (patch)
treea01aed9b05a1a35a9e57f88b111ca5746cc73166 /src/include/device/pci.h
parent35a77428b2b3c24ac7e68b3961f866044dcea800 (diff)
downloadcoreboot-494f319be78dc08c72d58cdd94bf09213b48238c.tar.gz
coreboot-494f319be78dc08c72d58cdd94bf09213b48238c.tar.bz2
coreboot-494f319be78dc08c72d58cdd94bf09213b48238c.zip
pci_device: Add a helper function for determining if PCI device is wake source
This change adds a helper function `pci_dev_is_wake_source()` that checks PME_STATUS and PME_ENABLE bits in PM control and status register to determine if the given device is the source of wake. BUG=b:169802515 BRANCH=zork Change-Id: I06e9530b568543ab2f05a4f38dc5c3a527ff391e Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46030 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/include/device/pci.h')
-rw-r--r--src/include/device/pci.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index 6e28cb7f649a..58f5904996a8 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -80,6 +80,14 @@ void pci_bus_reset(struct bus *bus);
struct device *pci_probe_dev(struct device *dev, struct bus *bus,
unsigned int devfn);
+/*
+ * 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);
+
void do_pci_scan_bridge(struct device *dev,
void (*do_scan_bus)(struct bus *bus,
unsigned int min_devfn, unsigned int max_devfn));