Jianeng Ceng has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81786?usp=email )
Change subject: drivers/i2c/rt5645: Add i2c_acpi_write_gpio for public ......................................................................
drivers/i2c/rt5645: Add i2c_acpi_write_gpio for public
Add the function i2c_acpi_write_gpio to write gpio for acpi device. Make sure it can be use for other driver.
BUG=None TEST= Build BIOS FW pass and it can be use for other driver.
Change-Id: Ie4d2a0bf0506cd9a5f3859eeb3c568bbecd429b5 Signed-off-by: Jianeng Ceng cengjianeng@huaqin.corp-partner.google.com --- M src/drivers/i2c/rt5645/rt5645.c M src/include/acpi/acpi_device.h 2 files changed, 7 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/81786/1
diff --git a/src/drivers/i2c/rt5645/rt5645.c b/src/drivers/i2c/rt5645/rt5645.c index f800173..9c4ee96 100644 --- a/src/drivers/i2c/rt5645/rt5645.c +++ b/src/drivers/i2c/rt5645/rt5645.c @@ -11,7 +11,7 @@ #define RT5645_DP_INT(key, val) \ acpi_dp_add_integer(dp, "realtek," key, (val))
-static int i2c_generic_write_gpio(struct acpi_gpio *gpio, int *curr_index) +int i2c_acpi_write_gpio(struct acpi_gpio *gpio, int *curr_index) { int ret = -1;
@@ -66,15 +66,15 @@
/* Use either Interrupt() or GpioInt() */ if (config->irq_gpio.pin_count) - irq_gpio_index = i2c_generic_write_gpio(&config->irq_gpio, + irq_gpio_index = i2c_acpi_write_gpio(&config->irq_gpio, &curr_index); else acpi_device_write_interrupt(&config->irq);
/* Add I2C GPIO index */ - cbj_sleeve_index = i2c_generic_write_gpio(&config->cbj_sleeve, + cbj_sleeve_index = i2c_acpi_write_gpio(&config->cbj_sleeve, &curr_index); - hp_detect_index = i2c_generic_write_gpio(&config->hp_detect, + hp_detect_index = i2c_acpi_write_gpio(&config->hp_detect, &curr_index); acpigen_write_resourcetemplate_footer();
diff --git a/src/include/acpi/acpi_device.h b/src/include/acpi/acpi_device.h index 9ce5e0a..58cb5c2 100644 --- a/src/include/acpi/acpi_device.h +++ b/src/include/acpi/acpi_device.h @@ -313,6 +313,9 @@ /* Write I2cSerialBus() descriptor to SSDT AML output */ void acpi_device_write_i2c(const struct acpi_i2c *i2c);
+/* Write I2C GPIO for acpi device */ +int i2c_acpi_write_gpio(struct acpi_gpio *gpio, int *curr_index); + /* * ACPI SPI Bus */