From 2e214d17665f55f9207f38fd8a3b3219cac56ac1 Mon Sep 17 00:00:00 2001 From: Chekhov Ma Date: Wed, 5 Mar 2025 19:59:35 +0800 Subject: [PATCH] drivers: gpio: adp5585: fix wrong reg during pin configure The ADP5585_GPO_OUT_MODE_A is used when configuring initial output during pin configuration, causing pins configured HIGH is incorrectly configured as open-drain. Replacing the reg with ADP5585_GPO_DATA_OUT fixes the issue. Signed-off-by: Chekhov Ma (cherry picked from commit c87900aa4090fac09a7592e222d58c2c55a1979c) --- drivers/gpio/gpio_adp5585.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio_adp5585.c b/drivers/gpio/gpio_adp5585.c index 0a1da5e63f4aa..4ebadfeb15d29 100644 --- a/drivers/gpio/gpio_adp5585.c +++ b/drivers/gpio/gpio_adp5585.c @@ -143,14 +143,14 @@ static int gpio_adp5585_config(const struct device *dev, gpio_pin_t pin, gpio_fl data->output |= BIT(pin); } if (bank == 0) { - /* reg_value for ADP5585_GPO_OUT_MODE */ + /* reg_value for ADP5585_GPO_DATA_OUT */ reg_value = (uint8_t)data->output; } else { - /* reg_value for ADP5585_GPO_OUT_MODE */ + /* reg_value for ADP5585_GPO_DATA_OUT */ reg_value = (uint8_t)(data->output >> 8); } ret = i2c_reg_write_byte_dt(&parent_cfg->i2c_bus, - ADP5585_GPO_OUT_MODE_A + bank, + ADP5585_GPO_DATA_OUT_A + bank, reg_value); if (ret != 0) { goto out;