Commit 6eda124b authored by Chekhov Ma's avatar Chekhov Ma Committed by Anas Nashif
Browse files

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: default avatarChekhov Ma <chekhov.ma@nxp.com>
(cherry picked from commit c87900aa)
parent f23e4e1d
Loading
Loading
Loading
Loading
+3 −3
Changes for drivers/gpio/gpio_adp5585.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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;