Re: [PATCH v3 2/2] gpio: regmap: Don't set a fixed direction line

From: Michael Walle

Date: Tue May 12 2026 - 03:01:10 EST


On Mon May 11, 2026 at 9:43 PM CEST, Linus Walleij wrote:
> If a GPIO line has a fixed direction, report an error
> is a consumer anyway tries to set the direction to
> something other than what it is hardcoded to.
>
> This didn't happen much before because what we supported was
> all lines input or output and then the implementer would
> probably not specify the direction registers, but with
> sparse fixed direction we can have a mixture so let's take
> this into account.
>
> As a consequence, since gpio_regmap_set_direction() can
> now fail, alter the semantics in
> gpio_regmap_direction_output() such that we first check
> if we can set the direction to output before we set the
> value and the direction.
>
> Suggested-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Link: https://sashiko.dev/#/patchset/20260507-regmap-gpio-sparse-fixed-dir-v1-1-a2e5855e2701%40kernel.org
> Signed-off-by: Linus Walleij <linusw@xxxxxxxxxx>

Reviewed-by: Michael Walle <mwalle@xxxxxxxxxx>

-michael

Attachment: signature.asc
Description: PGP signature