diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/intel/wifi/wifi.c | 18 | ||||
-rw-r--r-- | src/include/elog.h | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c index 91c21fecff..d1d5684a19 100644 --- a/src/drivers/intel/wifi/wifi.c +++ b/src/drivers/intel/wifi/wifi.c @@ -21,12 +21,16 @@ #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <elog.h> #include <sar.h> #include <smbios.h> #include <string.h> #include <wrdd.h> #include "chip.h" +#define PMCS_DR 0xcc +#define PME_STS (1 << 15) + #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES) static int smbios_write_wifi(struct device *dev, int *handle, unsigned long *current) @@ -197,6 +201,18 @@ static const char *intel_wifi_acpi_name(struct device *dev) } #endif +static void wifi_pci_dev_init(struct device *dev) +{ + pci_dev_init(dev); + + if (IS_ENABLED(CONFIG_ELOG)) { + uint32_t val; + val = pci_read_config16(dev, PMCS_DR); + if (val & PME_STS) + elog_add_event_wake(ELOG_WAKE_SOURCE_PME_WIFI, 0); + } +} + static struct pci_operations pci_ops = { .set_subsystem = pci_dev_set_subsystem, }; @@ -205,7 +221,7 @@ struct device_operations device_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, - .init = pci_dev_init, + .init = wifi_pci_dev_init, #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES) .get_smbios_data = smbios_write_wifi, #endif diff --git a/src/include/elog.h b/src/include/elog.h index 57e278e151..bab7eb0594 100644 --- a/src/include/elog.h +++ b/src/include/elog.h @@ -149,6 +149,7 @@ #define ELOG_WAKE_SOURCE_PME_XDCI 0x1c #define ELOG_WAKE_SOURCE_PME_XHCI_USB_2 0x1d #define ELOG_WAKE_SOURCE_PME_XHCI_USB_3 0x1e +#define ELOG_WAKE_SOURCE_PME_WIFI 0x1f struct elog_event_data_wake { u8 source; |