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

From: Andy Shevchenko

Date: Tue Jul 14 2026 - 07:32:11 EST


On Tue, Jul 14, 2026 at 01:03:40PM +0200, Janani Sunil wrote:
> On 7/9/26 13:05, Andy Shevchenko wrote:
> > On Thu, Jul 09, 2026 at 10:50:16AM +0200, Janani Sunil wrote:

...

> > So, I briefly looked at the implementation and I don't understand why
> > gpio-regmap can't be used. Do you need PM runtime there? It can be
> > done for all (if absent).

> 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.

Will it? Even if you mark the corresponding registers volatile?
So, the problem is that it always tries to read input state even
for the output pins? I think this should be either configurable
(a flag in the respective gpio regmap config) or be clever to know
that the pin is in output and simply return what was latched.

> The custom implementation preserves the device specific behavior.

At bare minimum the summary of this should be mentioned in
the cover letter / comment block.

--
With Best Regards,
Andy Shevchenko