Re: [PATCH 6/6] regmap: Incorporate the regcache core into regmap

Mark Brown
2011-09-06T01:27:48Z

On Mon, Sep 05, 2011 at 06:22:36PM +0200, Lars-Peter Clausen wrote:
> On 09/05/2011 03:51 PM, Dimitris Papastamos wrote:

> > +#ifdef CONFIG_REGCACHE
> > + if (!map->cache_bypass) {
> > + ret = regcache_read(map, reg, val);
> > + if (!ret) {
> > + mutex_unlock(&map->lock);
> > + return 0;
> > + }
> > + }

> I think this will need tighter integration. For example do we want to fallback
> to a hw read when the cached read fails? And also regcache_read will return for
> REGCACHE_NONE, which means we neither do a cached read nor a hw read.

I think falling through to hardware is sensible - if nothing else we've
got to do that for uncached registers. Though if we're in cache only
mode we probably don't want to do that as the hardware may be powered
off. But in general it does make sense to me.