summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeven Lee <wtli@nuvoton.com>2021-03-29 20:00:41 +0800
committerPatrick Georgi <pgeorgi@google.com>2021-04-06 07:09:02 +0000
commitb8159df9fd871ac67219f2f254043c72c238bc6c (patch)
tree338f6a2f95cafb7fa613478d498145aca7ea4bcf
parent647e2c9029d191933f471ddec572b841f951210e (diff)
downloadcoreboot-b8159df9fd871ac67219f2f254043c72c238bc6c.tar.gz
coreboot-b8159df9fd871ac67219f2f254043c72c238bc6c.tar.bz2
coreboot-b8159df9fd871ac67219f2f254043c72c238bc6c.zip
drivers/i2c/nau8825: Support nau8825 for ACPI GPIO descriptors
Add definitions to describe GPIOs in generated ACPI objects. The method allow either write a GpioInt() or Interrupt() descriptor. Signed-off-by: Seven Lee <wtli@nuvoton.com> Change-Id: I37fec7b0b9324dbfb61b7a8bea80f45026c54409 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51922 Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/drivers/i2c/nau8825/chip.h1
-rw-r--r--src/drivers/i2c/nau8825/nau8825.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/i2c/nau8825/chip.h b/src/drivers/i2c/nau8825/chip.h
index 9ba1d9458117..5b160c8724d2 100644
--- a/src/drivers/i2c/nau8825/chip.h
+++ b/src/drivers/i2c/nau8825/chip.h
@@ -11,6 +11,7 @@
struct drivers_i2c_nau8825_config {
/* Interrupt configuration */
struct acpi_irq irq;
+ struct acpi_gpio irq_gpio;
/* I2C Bus Frequency in Hertz (default 400kHz) */
unsigned int bus_speed;
diff --git a/src/drivers/i2c/nau8825/nau8825.c b/src/drivers/i2c/nau8825/nau8825.c
index a0769d042262..01b1f35be615 100644
--- a/src/drivers/i2c/nau8825/nau8825.c
+++ b/src/drivers/i2c/nau8825/nau8825.c
@@ -47,7 +47,11 @@ static void nau8825_fill_ssdt(const struct device *dev)
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
acpi_device_write_i2c(&i2c);
- acpi_device_write_interrupt(&config->irq);
+ /* Allow either GpioInt() or Interrupt() */
+ if (config->irq_gpio.pin_count)
+ acpi_device_write_gpio(&config->irq_gpio);
+ else
+ acpi_device_write_interrupt(&config->irq);
acpigen_write_resourcetemplate_footer();
/* Device Properties */