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 <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/30106
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Karthikeyan Ramasubramanian 2018-12-07 10:57:39 -07:00 committed by Patrick Georgi
parent 025a03f616
commit fd1557f28e
2 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,8 @@ struct key_info {
const char *label; const char *label;
/* Can this key wake-up the system? */ /* Can this key wake-up the system? */
bool is_wakeup_source; bool is_wakeup_source;
/* Wake GPE */
unsigned int wake;
/* Can this key be disabled? */ /* Can this key be disabled? */
bool can_be_disabled; bool can_be_disabled;
/* Debounce interval time in milliseconds */ /* Debounce interval time in milliseconds */

View File

@ -43,6 +43,8 @@ static struct acpi_dp *gpio_keys_add_child_node(
if (key->is_wakeup_source) if (key->is_wakeup_source)
acpi_dp_add_integer(dsd, "wakeup-source", acpi_dp_add_integer(dsd, "wakeup-source",
key->is_wakeup_source); key->is_wakeup_source);
if (key->wake)
acpigen_write_PRW(key->wake, 3);
if (key->can_be_disabled) if (key->can_be_disabled)
acpi_dp_add_integer(dsd, "linux,can-disable", acpi_dp_add_integer(dsd, "linux,can-disable",
key->can_be_disabled); key->can_be_disabled);