arch/x86/acpi_device: Add macros to define gpio interrupt with wake

Add Provides ACPI_GPIO_IRQ_LEVEL_[LOW|HIGH]_WAKE versions to allow board to define a gpio irq as wake capable.

Change-Id: I42f5084c5f0f5da0a4b39df77707b2f158bcc03d
Signed-off-by: Alex Levin <levinale@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38445
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Alex Levin 2020-01-15 21:30:20 -08:00 committed by Furquan Shaikh
parent d250063c09
commit 9bcdeb274a
1 changed files with 20 additions and 0 deletions

View File

@ -303,6 +303,26 @@ struct acpi_gpio {
.pin_count = 1, \
.pins = { (gpio) } }
/* Level Triggered Active High GPIO interrupt with wake */
#define ACPI_GPIO_IRQ_LEVEL_HIGH_WAKE(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
.irq.mode = ACPI_IRQ_LEVEL_TRIGGERED, \
.irq.polarity = ACPI_IRQ_ACTIVE_HIGH, \
.irq.wake = ACPI_IRQ_WAKE, \
.pin_count = 1, \
.pins = { (gpio) } }
/* Level Triggered Active Low GPIO interrupt with wake */
#define ACPI_GPIO_IRQ_LEVEL_LOW_WAKE(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
.irq.mode = ACPI_IRQ_LEVEL_TRIGGERED, \
.irq.polarity = ACPI_IRQ_ACTIVE_LOW, \
.irq.wake = ACPI_IRQ_WAKE, \
.pin_count = 1, \
.pins = { (gpio) } }
/* Write GpioIo() or GpioInt() descriptor to SSDT AML output */
void acpi_device_write_gpio(const struct acpi_gpio *gpio);