Re: [PATCH 5/6] gpio: ad7768: Add AD7768 GPIO auxiliary driver

From: Linus Walleij

Date: Fri Jul 24 2026 - 03:18:53 EST


On Tue, Jul 14, 2026 at 1:03 PM Janani Sunil <jananisunil.dev@xxxxxxxxx> wrote:

> gpio-regmap does not naturally model the AD7768's direction dependent readback behavior.
> On this device, GPIO Write data (0x0F) holds the latched output values and the GPIO
> Read Data (0x10) reads the logic input level only when the pins are configured as inputs.
> Using the generic gpio-regmap would always read 0x10 including output GPIOs.
> The custom implementation preserves the device specific behavior.

The memory-mapped gpio-generic has this flag:

#define GPIO_GENERIC_READ_OUTPUT_REG_SET BIT(4) /* reg_set
stores output value */

Just implement the same logic flag for gpio-regmap and
the problem is solved?

It's such a minor improvement to gpio-regmap that I don't
think it's much to ask.

Yours,
Linus Walleij