summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-10-03 16:33:07 -0700
committerFurquan Shaikh <furquan@google.com>2020-10-11 02:13:44 +0000
commit54b27169904538081f85f50a5a0873ba35d8ea16 (patch)
tree83695f27cfd742b9e39a41e3701052b6e438d55a
parent59a863e14ad366fa8e5f46cb506fc88c35ac8911 (diff)
drivers/wifi/generic: Log WiFi wake source to event log
This change adds a call to `pci_dev_is_wake_source()` to determine and log WiFi wake source to event log just like the Intel WiFi driver does. This is done in preparation to merge the generic and Intel WiFi drivers in follow-up changes. BUG=b:169802515 BRANCH=zork Change-Id: I20528ae1f72ca633da31e01d777c46fd5f4a337f Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46032 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
-rw-r--r--src/drivers/wifi/generic/generic.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/wifi/generic/generic.c b/src/drivers/wifi/generic/generic.c
index b175f2363c..2ecaadc5f7 100644
--- a/src/drivers/wifi/generic/generic.c
+++ b/src/drivers/wifi/generic/generic.c
@@ -6,6 +6,7 @@
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_def.h>
+#include <elog.h>
#include <sar.h>
#include <string.h>
#include <wrdd.h>
@@ -237,10 +238,17 @@ static void wifi_generic_fill_ssdt_generator(const struct device *dev)
wifi_generic_fill_ssdt(dev, dev->chip_info);
}
+static void wifi_pci_dev_init(struct device *dev)
+{
+ if (pci_dev_is_wake_source(dev))
+ elog_add_event_wake(ELOG_WAKE_SOURCE_PME_WIFI, 0);
+}
+
struct device_operations wifi_generic_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
+ .init = wifi_pci_dev_init,
.ops_pci = &pci_dev_ops_pci,
.acpi_name = wifi_generic_acpi_name,
.acpi_fill_ssdt = wifi_generic_fill_ssdt_generator,