From b92be6fecc9f1e8b927d99c12dad9f9dcd729727 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 3 Jun 2013 17:24:08 +0100 Subject: [PATCH] regmap: core: Cache all registers by default when cache is enabled 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 --- drivers/base/regmap/regmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index a941dcfe7590..2f1f3ff6c6bf 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -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)