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>
This commit is contained in:
Furquan Shaikh 2020-10-03 16:33:07 -07:00
parent 59a863e14a
commit 54b2716990

View file

@ -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,