Commit beb1a10f authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by Mark Brown

regmap: Save/restore the bypass state upon syncing

Signed-off-by: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 13753a90
...@@ -227,10 +227,13 @@ int regcache_sync(struct regmap *map) ...@@ -227,10 +227,13 @@ int regcache_sync(struct regmap *map)
unsigned int val; unsigned int val;
unsigned int i; unsigned int i;
const char *name; const char *name;
unsigned int bypass;
BUG_ON(!map->cache_ops); BUG_ON(!map->cache_ops);
mutex_lock(&map->lock); mutex_lock(&map->lock);
/* Remember the initial bypass state */
bypass = map->cache_bypass;
dev_dbg(map->dev, "Syncing %s cache\n", dev_dbg(map->dev, "Syncing %s cache\n",
map->cache_ops->name); map->cache_ops->name);
name = map->cache_ops->name; name = map->cache_ops->name;
...@@ -255,6 +258,8 @@ int regcache_sync(struct regmap *map) ...@@ -255,6 +258,8 @@ int regcache_sync(struct regmap *map)
} }
out: out:
trace_regcache_sync(map->dev, name, "stop"); trace_regcache_sync(map->dev, name, "stop");
/* Restore the bypass state */
map->cache_bypass = bypass;
mutex_unlock(&map->lock); mutex_unlock(&map->lock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment