Ricardo Ribalda has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46963 )
Change subject: acpi_device: Add ACPI_GPIO_IRQ_EDGE_BOTH_ACTIVE_LOW ......................................................................
acpi_device: Add ACPI_GPIO_IRQ_EDGE_BOTH_ACTIVE_LOW
This is, GPIOs that their value is active low and need to trigger and IRQ on both edges.
Change-Id: I9d55d0f321a832607f780c0a7ba7eddb7c893832 Signed-off-by: Ricardo Ribalda ribalda@chromium.org --- M src/include/acpi/acpi_device.h 1 file changed, 13 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/46963/1
diff --git a/src/include/acpi/acpi_device.h b/src/include/acpi/acpi_device.h index 301f9b0..5dd584e 100644 --- a/src/include/acpi/acpi_device.h +++ b/src/include/acpi/acpi_device.h @@ -216,38 +216,42 @@ #define ACPI_GPIO_INPUT_ACTIVE_LOW(gpio) ACPI_GPIO_INPUT_CFG(gpio, 1)
/* GpioInt-related macros */ -#define ACPI_GPIO_IRQ_CFG(_gpio, _mode, _polarity, _wake) { \ +#define ACPI_GPIO_IRQ_CFG(_gpio, _mode, _polarity, _wake, _active_low) { \ .type = ACPI_GPIO_TYPE_INTERRUPT, \ .pull = ACPI_GPIO_PULL_DEFAULT, \ + .active_low = _active_low, \ .irq.mode = _mode, \ .irq.polarity = _polarity, \ .irq.wake = _wake, \ .pin_count = 1, \ .pins = { (_gpio) } }
-#define ACPI_GPIO_IRQ_EDGE(gpio, polarity) \ - ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_EDGE_TRIGGERED, polarity, 0) +#define ACPI_GPIO_IRQ_EDGE(gpio, polarity, active_low) \ + ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_EDGE_TRIGGERED, polarity, 0, active_low)
#define ACPI_GPIO_IRQ_EDGE_WAKE(gpio, polarity) \ - ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_EDGE_TRIGGERED, polarity, ACPI_IRQ_WAKE) + ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_EDGE_TRIGGERED, polarity, ACPI_IRQ_WAKE, 0)
#define ACPI_GPIO_IRQ_LEVEL(gpio, polarity) \ - ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_LEVEL_TRIGGERED, polarity, 0) + ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_LEVEL_TRIGGERED, polarity, 0, 0)
#define ACPI_GPIO_IRQ_LEVEL_WAKE(gpio, polarity) \ - ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_LEVEL_TRIGGERED, polarity, ACPI_IRQ_WAKE) + ACPI_GPIO_IRQ_CFG(gpio, ACPI_IRQ_LEVEL_TRIGGERED, polarity, ACPI_IRQ_WAKE, 0)
/* Edge Triggered Active High GPIO interrupt */ #define ACPI_GPIO_IRQ_EDGE_HIGH(gpio) \ - ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_HIGH) + ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_HIGH, 0)
/* Edge Triggered Active Low GPIO interrupt */ #define ACPI_GPIO_IRQ_EDGE_LOW(gpio) \ - ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_LOW) + ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_LOW, 0)
/* Edge Triggered Active Both GPIO interrupt */ #define ACPI_GPIO_IRQ_EDGE_BOTH(gpio) \ - ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_BOTH) + ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_BOTH, 0) + +#define ACPI_GPIO_IRQ_EDGE_BOTH_ACTIVE_LOW(gpio) \ + ACPI_GPIO_IRQ_EDGE(gpio, ACPI_IRQ_ACTIVE_BOTH, 1)
/* Edge Triggered Active High GPIO interrupt with wake */ #define ACPI_GPIO_IRQ_EDGE_HIGH_WAKE(gpio) \