Re: [PATCH] regmap: allow to define reg_update_bits for no bus configuration

From: Ansuel Smith
Date: Thu Nov 04 2021 - 10:57:49 EST


On Thu, Nov 04, 2021 at 02:50:31PM +0000, Mark Brown wrote:
> On Wed, Nov 03, 2021 at 10:53:17PM +0100, Ansuel Smith wrote:
> > On Wed, Nov 03, 2021 at 09:29:11PM +0000, Mark Brown wrote:
>
> > > > > I don't understand this change. The point of the check for volatile
> > > > > there is that if the register isn't volatile then we need to ensure that
> > > > > the cache gets updated with any change that happens so we need to go
> > > > > through paths that include cache updates. The presence or otherwise of
> > > > > a bus does not seem at all relevant here.
>
> > I think I'm missing something. The user case is a driver that
> > have CACHE DISABLED. The !map->bus check is added just to limit this to
> > a no bus configuration not to permit this with CACHE enabled. The limit
> > I was referring was in the init function where the update_bits is
> > assigned to the map. I honestly didn't notice that anything with cache
> > disabled was flagged as volatile.
>
> In what way would the presence or absence of a bus be relevant to a
> decision about being able to safely use an _update_bits() operation?
>

No reason. It was just to make changes only to a no bus configuration
and doesn't cause any problem/error to other regmap configuration.
(since currently we can declare a custom update_bits function only for
bus configuration)

> > So the rest of the changes permit to declare a update_bits function
> > for a no bus configuration is good?
>
> Probably, I'd need to look again.

Let me send a v2 so you can check the final patch.

--
Ansuel