From fd1557f28ec8f741f7ae3dafcff5f7293eb58e82 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Fri, 7 Dec 2018 10:57:39 -0700 Subject: [PATCH] drivers/generic/gpio_keys: Add mechanism to configure GPE wake event Add mechanism to configure GPE wake event which in turn can be used as ACPI Power Resources for Wake BRANCH=octopus BUG=b:117953118 TEST=Ensure that the wake GPE event is added to ACPI Power Resource for Wake. Change-Id: Iacc12b8636aaac98a8689a211cbe1dcfe306f342 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/30106 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/drivers/generic/gpio_keys/chip.h | 2 ++ src/drivers/generic/gpio_keys/gpio_keys.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/drivers/generic/gpio_keys/chip.h b/src/drivers/generic/gpio_keys/chip.h index bdeb0afeb7..818f14cc3b 100644 --- a/src/drivers/generic/gpio_keys/chip.h +++ b/src/drivers/generic/gpio_keys/chip.h @@ -45,6 +45,8 @@ struct key_info { const char *label; /* Can this key wake-up the system? */ bool is_wakeup_source; + /* Wake GPE */ + unsigned int wake; /* Can this key be disabled? */ bool can_be_disabled; /* Debounce interval time in milliseconds */ diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c index 6120981159..5ecb63e685 100644 --- a/src/drivers/generic/gpio_keys/gpio_keys.c +++ b/src/drivers/generic/gpio_keys/gpio_keys.c @@ -43,6 +43,8 @@ static struct acpi_dp *gpio_keys_add_child_node( if (key->is_wakeup_source) acpi_dp_add_integer(dsd, "wakeup-source", key->is_wakeup_source); + if (key->wake) + acpigen_write_PRW(key->wake, 3); if (key->can_be_disabled) acpi_dp_add_integer(dsd, "linux,can-disable", key->can_be_disabled);