summaryrefslogtreecommitdiff
path: root/src/drivers/i2c
diff options
context:
space:
mode:
authorJianeng Ceng <cengjianeng@huaqin.corp-partner.google.com>2024-04-09 21:20:20 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-04-19 14:13:41 +0000
commit01344bce1a6052448564b83c9e1b8f0f16a8adfe (patch)
treeffccb0cbaab31781b7a636e45f8cb753d2fec9ab /src/drivers/i2c
parentf8a46950cc93db990d00096698d02ba8f12017d1 (diff)
acpi: Make acpi_device_write_dsd_gpio() public
Make sure it can be used for other driver. At present, i2c_generic_write_gpio() is not suitable for being called by other drivers, so delete it, add acpi_device_write_dsd_gpio() to replace it, and make it public. BUG=None TEST= Build BIOS FW pass and it can be use for other driver. Change-Id: Ifb2e60690711b39743afd455c6776c5ace863378 Signed-off-by: Jianeng Ceng <cengjianeng@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81788 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <ericllai@google.com> Reviewed-by: Kapil Porwal <kapilporwal@google.com> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r--src/drivers/i2c/generic/generic.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index afff978065..a2d510bcf2 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -27,20 +27,6 @@ static bool i2c_generic_add_gpios_to_crs(struct drivers_i2c_generic_config *cfg)
return true;
}
-static int i2c_generic_write_gpio(struct acpi_gpio *gpio, int *curr_index)
-{
- int ret = -1;
-
- if (gpio->pin_count == 0)
- return ret;
-
- acpi_device_write_gpio(gpio);
- ret = *curr_index;
- (*curr_index)++;
-
- return ret;
-}
-
void i2c_generic_fill_ssdt(const struct device *dev,
void (*callback)(const struct device *dev),
struct drivers_i2c_generic_config *config)
@@ -96,15 +82,15 @@ void i2c_generic_fill_ssdt(const struct device *dev,
/* Use either Interrupt() or GpioInt() */
if (config->irq_gpio.pin_count)
- irq_gpio_index = i2c_generic_write_gpio(&config->irq_gpio,
+ irq_gpio_index = acpi_device_write_dsd_gpio(&config->irq_gpio,
&curr_index);
else
acpi_device_write_interrupt(&config->irq);
if (i2c_generic_add_gpios_to_crs(config) == true) {
- reset_gpio_index = i2c_generic_write_gpio(&config->reset_gpio,
+ reset_gpio_index = acpi_device_write_dsd_gpio(&config->reset_gpio,
&curr_index);
- enable_gpio_index = i2c_generic_write_gpio(&config->enable_gpio,
+ enable_gpio_index = acpi_device_write_dsd_gpio(&config->enable_gpio,
&curr_index);
}
acpigen_write_resourcetemplate_footer();