Re: [PATCH 1/8] regmap: Introduce caching support

From: Dimitris Papastamos
Date: Fri Sep 02 2011 - 21:10:45 EST


On Sat, Sep 03, 2011 at 12:48:27AM +0100, Mark Brown wrote:
> On Fri, Sep 02, 2011 at 10:02:02PM +0200, Lars-Peter Clausen wrote:
> > On 09/02/2011 05:46 PM, Dimitris Papastamos wrote:
>
> > > +static const struct regcache_ops *cache_types[] = {
> > > +};
>
> > I wonder if it makes sense to keep a list of regcache_ops this way, or whether
> > it is not better to just pass the ops we want to use to regcache_init directly.
>
> Or have a function per cache type. I'm keen to hide the ops from users
> because I don't want to have to worry about them peering inside the
> internals.
>
> > > + if (!map->cache_defaults_raw || !map->num_cache_defaults_raw) {
> > > + dev_err(map->dev, "Client has not provided a defaults cache\n");
> > > + return -EINVAL;
> > > + }
>
> > It should be OK to provide no default register values, in this case regmap
> > should assume that the default for all registers is 0.
>
> Yes - Dimitris, as we discussed offline it's pretty much essential for
> things like PMICs where the defaults aren't meaningful and may even be
> unknowable.

That's implemented in patch 8/8. I can of course squash that patch into
the other patch.

Thanks,
Dimitris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/