summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/include/arch/acpi_device.h65
1 files changed, 38 insertions, 27 deletions
diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index 2711af5a60..d26f330695 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -101,33 +101,44 @@ struct acpi_irq {
enum acpi_irq_wake wake;
};
-#define ACPI_IRQ_EDGE_LOW(x) { \
- .pin = (x), \
- .mode = ACPI_IRQ_EDGE_TRIGGERED, \
- .polarity = ACPI_IRQ_ACTIVE_LOW, \
- .shared = ACPI_IRQ_EXCLUSIVE, \
- .wake = ACPI_IRQ_NO_WAKE }
-
-#define ACPI_IRQ_EDGE_HIGH(x) { \
- .pin = (x), \
- .mode = ACPI_IRQ_EDGE_TRIGGERED, \
- .polarity = ACPI_IRQ_ACTIVE_HIGH, \
- .shared = ACPI_IRQ_EXCLUSIVE, \
- .wake = ACPI_IRQ_NO_WAKE }
-
-#define ACPI_IRQ_LEVEL_LOW(x) { \
- .pin = (x), \
- .mode = ACPI_IRQ_LEVEL_TRIGGERED, \
- .polarity = ACPI_IRQ_ACTIVE_LOW, \
- .shared = ACPI_IRQ_SHARED, \
- .wake = ACPI_IRQ_NO_WAKE }
-
-#define ACPI_IRQ_LEVEL_HIGH(x) { \
- .pin = (x), \
- .mode = ACPI_IRQ_LEVEL_TRIGGERED, \
- .polarity = ACPI_IRQ_ACTIVE_HIGH, \
- .shared = ACPI_IRQ_SHARED, \
- .wake = ACPI_IRQ_NO_WAKE }
+#define ACPI_IRQ_CFG(_pin, _mode, _pol, _shared, _wake) { \
+ .pin = (_pin), \
+ .mode = (_mode), \
+ .polarity = (_pol), \
+ .shared = (_shared), \
+ .wake = (_wake) }
+
+#define ACPI_IRQ_EDGE_LOW(x) \
+ ACPI_IRQ_CFG((x), ACPI_IRQ_EDGE_TRIG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AML output */
void acpi_device_write_interrupt(const struct acpi_irq *irq);