Re: [PATCH v3 3/7] gpio: regmap: Add gpio_regmap_operation and write-enable support
From: Andy Shevchenko
Date: Thu Jul 16 2026 - 05:43:42 EST
On Thu, Jul 16, 2026 at 11:08:55AM +0200, Michael Walle wrote:
> On Thu Jul 16, 2026 at 10:27 AM CEST, Andy Shevchenko wrote:
> > On Thu, Jul 16, 2026 at 02:26:14PM +0800, Yu-Chun Lin wrote:
...
> > From the above list I tend to the approach 2, but this might require to have
> > GPIO regmap level of locking. I'm a bit lost in the context, though. I assume
> > we need a fresh start, id est issue a v6 with approach 2 or 3 in place and
> > summarize the choices in the cover letter, so we can understand what has been
> > considered.
>
> I don't really like approach 3. You'd need to check if the regs of
> both xlate calls are the same. With the sample code above, you
> silently drop the first xlate'd reg.
If I rank the proposals, the worst is #1, the best is #2.
> And honestly, it really seems like a one-off. What controllers, are
> there that need a write enable bit. The real problem seems to be
> the assumption that we operate on just one bit. IOW we either set
> mask or don't set mask in gpio_regmap_set().
Yes, we should KISS.
> For a more generic solution, we should be able to control the
> written value. We could add another .value_xlate().
Maybe not now? As per IPs, Synopsys IPs (not exactly GPIO) likes to
have that kind of "protection". So, from HW perspective it's kinda
pattern, and it might be possible to see more IPs (including GPIO)
that follow it in some cases.
--
With Best Regards,
Andy Shevchenko