Re: [PATCH 3/3] gpio: tps65219: Fix TPS65214 GPIO direction programming

From: Andy Shevchenko

Date: Thu Sep 24 2026 - 11:51:51 EST


On Sat, Sep 19, 2026 at 8:11 PM Karl Mehltretter <kmehltretter@xxxxxxxxx> wrote:
>
> GPIO_LINE_DIRECTION_OUT and GPIO_LINE_DIRECTION_IN have the values 0
> and 1, respectively, while the TPS65214 GPIO_CONFIG field is BIT(1).
> regmap_update_bits() masks the supplied value, so passing either
> direction value clears the field and selects input mode.
>
> Translate the GPIO direction to the register encoding used by
> tps65214_gpio_get_direction(), setting GPIO_CONFIG for output and
> clearing it for input.

...

> + val = direction == GPIO_LINE_DIRECTION_OUT ?
> + TPS65214_GPIO0_DIR_MASK : 0;
> ret = regmap_update_bits(gpio->tps->regmap, TPS65219_REG_GENERAL_CONFIG,
> - TPS65214_GPIO0_DIR_MASK, direction);
> + TPS65214_GPIO0_DIR_MASK, val);

regmap_assign_bits()

--
With Best Regards,
Andy Shevchenko