From 4f31d5c2ced908a1d18b14670149c8f2e12fe804 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Fri, 17 Feb 2017 17:07:23 -0800 Subject: 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 Reviewed-on: https://review.coreboot.org/18392 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/arch/x86/include/arch/acpi_device.h | 35 +++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src/arch') diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h index 7d4cb8fd89..d88d519298 100644 --- a/src/arch/x86/include/arch/acpi_device.h +++ b/src/arch/x86/include/arch/acpi_device.h @@ -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) } } -- cgit v1.2.3