summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/sx9310
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/i2c/sx9310')
-rw-r--r--src/drivers/i2c/sx9310/chip.h18
-rw-r--r--src/drivers/i2c/sx9310/sx9310.c7
2 files changed, 20 insertions, 5 deletions
diff --git a/src/drivers/i2c/sx9310/chip.h b/src/drivers/i2c/sx9310/chip.h
index 2799f5bb99..c99a8a1539 100644
--- a/src/drivers/i2c/sx9310/chip.h
+++ b/src/drivers/i2c/sx9310/chip.h
@@ -22,10 +22,20 @@
#define REGISTER(NAME) uint8_t NAME
struct drivers_i2c_sx9310_config {
- const char *desc; /* Device Description */
- unsigned int uid; /* ACPI _UID */
- enum i2c_speed speed; /* Bus speed in Hz, default is I2C_SPEED_FAST */
- struct acpi_irq irq; /* Interrupt */
+ /* Device Description */
+ const char *desc;
+
+ /* ACPI _UID */
+ unsigned int uid;
+
+ /* Bus speed in Hz, default is I2C_SPEED_FAST */
+ enum i2c_speed speed;
+
+ /* Use GPIO-based interrupt instead of IO-APIC */
+ struct acpi_gpio irq_gpio;
+
+ /* IO-APIC interrupt */
+ struct acpi_irq irq;
#include "registers.h"
};
diff --git a/src/drivers/i2c/sx9310/sx9310.c b/src/drivers/i2c/sx9310/sx9310.c
index afd9e3581f..aafd7c7cc8 100644
--- a/src/drivers/i2c/sx9310/sx9310.c
+++ b/src/drivers/i2c/sx9310/sx9310.c
@@ -59,7 +59,12 @@ static void i2c_sx9310_fill_ssdt(struct device *dev)
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
acpi_device_write_i2c(&i2c);
- acpi_device_write_interrupt(&config->irq);
+
+ if (config->irq_gpio.pin_count)
+ acpi_device_write_gpio(&config->irq_gpio);
+ else
+ acpi_device_write_interrupt(&config->irq);
+
acpigen_write_resourcetemplate_footer();
/* DSD */