diff options
author | Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | 2011-09-29 09:36:26 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-30 08:57:47 -0400 |
commit | beb1a10f219ce720c13168203bd5ebe4ce7879e0 (patch) | |
tree | 99c7f842621284fcf9313a77f963ad4dfbd0a018 | |
parent | 13753a9088af23c61e2f5c10a8f3ea136d8ebab5 (diff) |
regmap: Save/restore the bypass state upon syncing
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/base/regmap/regcache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 59e432c0163d..5dbc5076267e 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c | |||
@@ -227,10 +227,13 @@ int regcache_sync(struct regmap *map) | |||
227 | unsigned int val; | 227 | unsigned int val; |
228 | unsigned int i; | 228 | unsigned int i; |
229 | const char *name; | 229 | const char *name; |
230 | unsigned int bypass; | ||
230 | 231 | ||
231 | BUG_ON(!map->cache_ops); | 232 | BUG_ON(!map->cache_ops); |
232 | 233 | ||
233 | mutex_lock(&map->lock); | 234 | mutex_lock(&map->lock); |
235 | /* Remember the initial bypass state */ | ||
236 | bypass = map->cache_bypass; | ||
234 | dev_dbg(map->dev, "Syncing %s cache\n", | 237 | dev_dbg(map->dev, "Syncing %s cache\n", |
235 | map->cache_ops->name); | 238 | map->cache_ops->name); |
236 | name = map->cache_ops->name; | 239 | name = map->cache_ops->name; |
@@ -255,6 +258,8 @@ int regcache_sync(struct regmap *map) | |||
255 | } | 258 | } |
256 | out: | 259 | out: |
257 | trace_regcache_sync(map->dev, name, "stop"); | 260 | trace_regcache_sync(map->dev, name, "stop"); |
261 | /* Restore the bypass state */ | ||
262 | map->cache_bypass = bypass; | ||
258 | mutex_unlock(&map->lock); | 263 | mutex_unlock(&map->lock); |
259 | 264 | ||
260 | return ret; | 265 | return ret; |