Skip to content

Commit

Permalink
drivers: i2c: gpio: fix compilation
Browse files Browse the repository at this point in the history
Fix the compilation of i2c_gpio.c after the gpio_config() syscall was
removed.

Fixes: 3632815

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen authored and galak committed Jun 1, 2021
1 parent 1b4fcc4 commit 9138e87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/i2c/i2c_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ static int i2c_gpio_init(const struct device *dev)
return -EINVAL;
}

err = gpio_config(context->scl_gpio, config->scl_pin,
config->scl_flags | GPIO_OUTPUT_HIGH);
err = gpio_pin_configure(context->scl_gpio, config->scl_pin,
config->scl_flags | GPIO_OUTPUT_HIGH);
if (err) {
LOG_ERR("failed to configure SCL GPIO pin (err %d)", err);
return err;
Expand All @@ -141,11 +141,11 @@ static int i2c_gpio_init(const struct device *dev)
return -EINVAL;
}

err = gpio_config(context->sda_gpio, config->sda_pin,
config->sda_flags | GPIO_INPUT | GPIO_OUTPUT_HIGH);
err = gpio_pin_configure(context->sda_gpio, config->sda_pin,
config->sda_flags | GPIO_INPUT | GPIO_OUTPUT_HIGH);
if (err == -ENOTSUP) {
err = gpio_config(context->sda_gpio, config->sda_pin,
config->sda_flags | GPIO_OUTPUT_HIGH);
err = gpio_pin_configure(context->sda_gpio, config->sda_pin,
config->sda_flags | GPIO_OUTPUT_HIGH);
}
if (err) {
LOG_ERR("failed to configure SDA GPIO pin (err %d)", err);
Expand Down

0 comments on commit 9138e87

Please sign in to comment.