acpi_device: Add macros for GPIO interrupts

Add individual macros for the various interrupt types so
they can be used in devicetree.

BUG=chrome-os-partner:58666
TEST=nothing uses this yet, will be used in an upcoming commit

Change-Id: I2a569f60fcc0815835615656b09670987036b848
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/18392
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Duncan Laurie 2017-02-17 17:07:23 -08:00 committed by Martin Roth
parent bd73dbbc38
commit 4f31d5c2ce
1 changed files with 31 additions and 4 deletions

View File

@ -175,12 +175,39 @@ struct acpi_gpio {
.pin_count = 1, \
.pins = { (gpio) } }
/* Basic interrupt GPIO with default pull settings */
#define ACPI_GPIO_INTERRUPT(gpio,mode,polarity) { \
/* Edge Triggered Active High GPIO interrupt */
#define ACPI_GPIO_IRQ_EDGE_HIGH(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
.irq.mode = (mode), \
.irq.polarity = (polarity), \
.irq.mode = IRQ_EDGE_TRIGGERED, \
.irq.polarity = IRQ_ACTIVE_HIGH, \
.pin_count = 1, \
.pins = { (gpio) } }
/* Edge Triggered Active Low GPIO interrupt */
#define ACPI_GPIO_IRQ_EDGE_LOW(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
.irq.mode = IRQ_EDGE_TRIGGERED, \
.irq.polarity = IRQ_ACTIVE_LOW, \
.pin_count = 1, \
.pins = { (gpio) } }
/* Level Triggered Active High GPIO interrupt */
#define ACPI_GPIO_IRQ_LEVEL_HIGH(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
.irq.mode = IRQ_LEVEL_TRIGGERED, \
.irq.polarity = IRQ_ACTIVE_HIGH, \
.pin_count = 1, \
.pins = { (gpio) } }
/* Level Triggered Active Low GPIO interrupt */
#define ACPI_GPIO_IRQ_LEVEL_LOW(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
.irq.mode = IRQ_LEVEL_TRIGGERED, \
.irq.polarity = IRQ_ACTIVE_LOW, \
.pin_count = 1, \
.pins = { (gpio) } }