regmap: core: Cache all registers by default when cache is enabled
authorMark Brown <broonie@linaro.org>
Mon, 3 Jun 2013 16:24:08 +0000 (17:24 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 3 Jun 2013 17:06:48 +0000 (18:06 +0100)
Currently all register maps with a cache need to provide a volatile
callback since the default is to assume all registers are volatile.
This is not sensible if we have a cache so change the default to be
fully cached if a cache is provided.

Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regmap.c

index a941dcf..2f1f3ff 100644 (file)
@@ -123,7 +123,10 @@ bool regmap_volatile(struct regmap *map, unsigned int reg)
        if (map->volatile_table)
                return _regmap_check_range_table(map, reg, map->volatile_table);
 
-       return true;
+       if (map->cache_ops)
+               return false;
+       else
+               return true;
 }
 
 bool regmap_precious(struct regmap *map, unsigned int reg)