Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/51922 )
Change subject: drivers/i2c/nau8825: Support nau8825 for ACPI GPIO descriptors ......................................................................
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 --- M src/drivers/i2c/nau8825/chip.h M src/drivers/i2c/nau8825/nau8825.c 2 files changed, 6 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified EricR Lai: Looks good to me, approved
diff --git a/src/drivers/i2c/nau8825/chip.h b/src/drivers/i2c/nau8825/chip.h index 9ba1d94..5b160c8 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 a0769d0..01b1f35 100644 --- a/src/drivers/i2c/nau8825/nau8825.c +++ b/src/drivers/i2c/nau8825/nau8825.c @@ -47,7 +47,11 @@ 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 */