[coreboot-gerrit] Change in coreboot[master]: drivers/i2c/da7219: Allow GPIO based interrupt

Daniel Kurtz (Code Review) gerrit at coreboot.org
Thu Feb 8 20:10:03 CET 2018


Hello Daniel Kurtz,

I'd like you to do a code review. Please visit

    https://review.coreboot.org/23657

to review the following change.


Change subject: drivers/i2c/da7219: Allow GPIO based interrupt
......................................................................

drivers/i2c/da7219: Allow GPIO based interrupt

Allow specifying the DA7219 interrupt pin as either an Interrupt or
GpioInt.

BUG=b:72121803
TEST=(with whole patch series) Grunt Kernel discovers DA7219 on i2c0

Change-Id: I2d26731bf4c0ad590dad2c5d26c252371f415f9a
Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
---
M src/drivers/i2c/da7219/chip.h
M src/drivers/i2c/da7219/da7219.c
2 files changed, 8 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/23657/1

diff --git a/src/drivers/i2c/da7219/chip.h b/src/drivers/i2c/da7219/chip.h
index 823b940..572d727 100644
--- a/src/drivers/i2c/da7219/chip.h
+++ b/src/drivers/i2c/da7219/chip.h
@@ -8,6 +8,9 @@
 	/* Interrupt configuration */
 	struct acpi_irq irq;
 
+	/* Use GPIO based interrupt instead of PIRQ */
+	struct acpi_gpio irq_gpio;
+
 	/* I2C Bus Frequency in Hertz (default 400kHz) */
 	unsigned bus_speed;
 
diff --git a/src/drivers/i2c/da7219/da7219.c b/src/drivers/i2c/da7219/da7219.c
index 4eef00c..c0f152d 100644
--- a/src/drivers/i2c/da7219/da7219.c
+++ b/src/drivers/i2c/da7219/da7219.c
@@ -57,7 +57,11 @@
 	acpigen_write_name("_CRS");
 	acpigen_write_resourcetemplate_header();
 	acpi_device_write_i2c(&i2c);
-	acpi_device_write_interrupt(&config->irq);
+	/* Use either Interrupt() or GpioInt() */
+	if (config->irq_gpio.pin_count)
+		acpi_device_write_gpio(&config->irq_gpio);
+	else
+		acpi_device_write_interrupt(&config->irq);
 	acpigen_write_resourcetemplate_footer();
 
 	/* AAD Child Device Properties */

-- 
To view, visit https://review.coreboot.org/23657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d26731bf4c0ad590dad2c5d26c252371f415f9a
Gerrit-Change-Number: 23657
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Kurtz <djkurtz at google.com>
Gerrit-Reviewer: Akshu Agrawal <akshu.agrawal at amd.com>
Gerrit-Reviewer: Daniel Kurtz <djkurtz at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180208/c057dbdf/attachment.html>


More information about the coreboot-gerrit mailing list