summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/acpi_device.c22
-rw-r--r--src/arch/x86/include/arch/acpi_device.h68
2 files changed, 45 insertions, 45 deletions
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c
index 4fe16a138f..323d4f1eab 100644
--- a/src/arch/x86/acpi_device.c
+++ b/src/arch/x86/acpi_device.c
@@ -181,7 +181,7 @@ void acpi_device_write_interrupt(const struct acpi_irq *irq)
return;
/* This is supported by GpioInt() but not Interrupt() */
- if (irq->polarity == IRQ_ACTIVE_BOTH)
+ if (irq->polarity == ACPI_IRQ_ACTIVE_BOTH)
return;
/* Byte 0: Descriptor Type */
@@ -200,13 +200,13 @@ void acpi_device_write_interrupt(const struct acpi_irq *irq)
* [0]: Resource (0=PRODUCER 1=CONSUMER)
*/
flags = 1 << 0; /* ResourceConsumer */
- if (irq->mode == IRQ_EDGE_TRIGGERED)
+ if (irq->mode == ACPI_IRQ_EDGE_TRIGGERED)
flags |= 1 << 1;
- if (irq->polarity == IRQ_ACTIVE_LOW)
+ if (irq->polarity == ACPI_IRQ_ACTIVE_LOW)
flags |= 1 << 2;
- if (irq->shared == IRQ_SHARED)
+ if (irq->shared == ACPI_IRQ_SHARED)
flags |= 1 << 3;
- if (irq->wake == IRQ_WAKE)
+ if (irq->wake == ACPI_IRQ_WAKE)
flags |= 1 << 4;
acpigen_emit_byte(flags);
@@ -262,21 +262,21 @@ void acpi_device_write_gpio(const struct acpi_gpio *gpio)
* [2:1]: Polarity (0=HIGH 1=LOW 2=BOTH)
* [0]: Mode (0=LEVEL 1=EDGE)
*/
- if (gpio->irq.mode == IRQ_EDGE_TRIGGERED)
+ if (gpio->irq.mode == ACPI_IRQ_EDGE_TRIGGERED)
flags |= 1 << 0;
- if (gpio->irq.shared == IRQ_SHARED)
+ if (gpio->irq.shared == ACPI_IRQ_SHARED)
flags |= 1 << 3;
- if (gpio->irq.wake == IRQ_WAKE)
+ if (gpio->irq.wake == ACPI_IRQ_WAKE)
flags |= 1 << 4;
switch (gpio->irq.polarity) {
- case IRQ_ACTIVE_HIGH:
+ case ACPI_IRQ_ACTIVE_HIGH:
flags |= 0 << 1;
break;
- case IRQ_ACTIVE_LOW:
+ case ACPI_IRQ_ACTIVE_LOW:
flags |= 1 << 1;
break;
- case IRQ_ACTIVE_BOTH:
+ case ACPI_IRQ_ACTIVE_BOTH:
flags |= 2 << 1;
break;
}
diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index d88d519298..a9cc85eb3b 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -47,55 +47,55 @@ const char *acpi_device_path_join(struct device *dev, const char *name);
* ACPI Descriptor for extended Interrupt()
*/
-enum irq_mode {
- IRQ_EDGE_TRIGGERED,
- IRQ_LEVEL_TRIGGERED
+enum acpi_irq_mode {
+ ACPI_IRQ_EDGE_TRIGGERED,
+ ACPI_IRQ_LEVEL_TRIGGERED
};
-enum irq_polarity {
- IRQ_ACTIVE_LOW,
- IRQ_ACTIVE_HIGH,
- IRQ_ACTIVE_BOTH
+enum acpi_irq_polarity {
+ ACPI_IRQ_ACTIVE_LOW,
+ ACPI_IRQ_ACTIVE_HIGH,
+ ACPI_IRQ_ACTIVE_BOTH
};
-enum irq_shared {
- IRQ_EXCLUSIVE,
- IRQ_SHARED
+enum acpi_irq_shared {
+ ACPI_IRQ_EXCLUSIVE,
+ ACPI_IRQ_SHARED
};
-enum irq_wake {
- IRQ_NO_WAKE,
- IRQ_WAKE
+enum acpi_irq_wake {
+ ACPI_IRQ_NO_WAKE,
+ ACPI_IRQ_WAKE
};
struct acpi_irq {
unsigned int pin;
- enum irq_mode mode;
- enum irq_polarity polarity;
- enum irq_shared shared;
- enum irq_wake wake;
+ enum acpi_irq_mode mode;
+ enum acpi_irq_polarity polarity;
+ enum acpi_irq_shared shared;
+ enum acpi_irq_wake wake;
};
-#define IRQ_EDGE_LOW(x) { \
+#define ACPI_IRQ_EDGE_LOW(x) { \
.pin = (x), \
- .mode = IRQ_EDGE_TRIGGERED, \
- .polarity = IRQ_ACTIVE_LOW, \
- .shared = IRQ_EXCLUSIVE, \
- .wake = IRQ_NO_WAKE }
+ .mode = ACPI_IRQ_EDGE_TRIGGERED, \
+ .polarity = ACPI_IRQ_ACTIVE_LOW, \
+ .shared = ACPI_IRQ_EXCLUSIVE, \
+ .wake = ACPI_IRQ_NO_WAKE }
-#define IRQ_EDGE_HIGH(x) { \
+#define ACPI_IRQ_EDGE_HIGH(x) { \
.pin = (x), \
- .mode = IRQ_EDGE_TRIGGERED, \
- .polarity = IRQ_ACTIVE_HIGH, \
- .shared = IRQ_EXCLUSIVE, \
- .wake = IRQ_NO_WAKE }
+ .mode = ACPI_IRQ_EDGE_TRIGGERED, \
+ .polarity = ACPI_IRQ_ACTIVE_HIGH, \
+ .shared = ACPI_IRQ_EXCLUSIVE, \
+ .wake = ACPI_IRQ_NO_WAKE }
-#define IRQ_LEVEL_LOW(x) { \
+#define ACPI_IRQ_LEVEL_LOW(x) { \
.pin = (x), \
- .mode = IRQ_LEVEL_TRIGGERED, \
- .polarity = IRQ_ACTIVE_LOW, \
- .shared = IRQ_SHARED, \
- .wake = IRQ_NO_WAKE }
+ .mode = ACPI_IRQ_LEVEL_TRIGGERED, \
+ .polarity = ACPI_IRQ_ACTIVE_LOW, \
+ .shared = ACPI_IRQ_SHARED, \
+ .wake = ACPI_IRQ_NO_WAKE }
/* Write extended Interrupt() descriptor to SSDT AML output */
void acpi_device_write_interrupt(const struct acpi_irq *irq);
@@ -179,8 +179,8 @@ struct acpi_gpio {
#define ACPI_GPIO_IRQ_EDGE_HIGH(gpio) { \
.type = ACPI_GPIO_TYPE_INTERRUPT, \
.pull = ACPI_GPIO_PULL_DEFAULT, \
- .irq.mode = IRQ_EDGE_TRIGGERED, \
- .irq.polarity = IRQ_ACTIVE_HIGH, \
+ .irq.mode = ACPI_IRQ_EDGE_TRIGGERED, \
+ .irq.polarity = ACPI_IRQ_ACTIVE_HIGH, \
.pin_count = 1, \
.pins = { (gpio) } }