[coreboot-gerrit] New patch to review for coreboot: acpi_device: Add macros for GPIO interrupts

Duncan Laurie (dlaurie@chromium.org) gerrit at coreboot.org
Sat Feb 18 03:18:36 CET 2017


Duncan Laurie (dlaurie at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18392

-gerrit

commit c2e31dc8e7940a0436514f812e9950a2d4e102da
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Fri Feb 17 17:07:23 2017 -0800

    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 at chromium.org>
---
 src/arch/x86/include/arch/acpi_device.h | 35 +++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index 7d4cb8f..d88d519 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) } }
 



More information about the coreboot-gerrit mailing list