summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-02-17 18:57:26 +0530
committerLokesh Pathak <lpathak@nvidia.com>2012-03-05 08:01:24 -0800
commitdc3c59847d3282271507e75a82a9d60b2dad7d9a (patch)
tree95350cbaf3da97fdc1da39a5a5f66509ea9a8365 /drivers/base
parent27eb5ab7eb04b7d83b62f557f05b10b14117af3b (diff)
regmap: Bypassing cache when initializing cache
During regcache_init, if client has not passed the default data of cached register then it is directly read from the hw to initialize cache. This hw register read happens before cache ops are initialized and hence avoiding register read to check for the data available on cache or not by enabling flag of cache_bypass. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> (cherry picked from commit df00c79f78d8b0ad788daf689ea461ace9d0811f) Change-Id: I4398162bd6b12689c795afe5ee02397e975e456c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/87593
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regcache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 43ffcc312b44..86cc34251ac5 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -34,12 +34,17 @@ static int regcache_hw_init(struct regmap *map)
return -EINVAL;
if (!map->reg_defaults_raw) {
+ u32 cache_bypass = map->cache_bypass;
dev_warn(map->dev, "No cache defaults, reading back from HW\n");
+
+ /* Bypass the cache access till data read from HW*/
+ map->cache_bypass = 1;
tmp_buf = kmalloc(map->cache_size_raw, GFP_KERNEL);
if (!tmp_buf)
return -EINVAL;
ret = regmap_bulk_read(map, 0, tmp_buf,
map->num_reg_defaults_raw);
+ map->cache_bypass = cache_bypass;
if (ret < 0) {
kfree(tmp_buf);
return ret;