mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 10:33:27 +00:00
regmap: Bypass the cache when applying patches
Otherwise any patch that affects a register which is writable may trash cached values. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
d9db762708
commit
8a892d6996
1 changed files with 2 additions and 0 deletions
|
@ -273,6 +273,7 @@ int regcache_sync(struct regmap *map)
|
|||
goto out;
|
||||
|
||||
/* Apply any patch first */
|
||||
map->cache_bypass = 1;
|
||||
for (i = 0; i < map->patch_regs; i++) {
|
||||
ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def);
|
||||
if (ret != 0) {
|
||||
|
@ -281,6 +282,7 @@ int regcache_sync(struct regmap *map)
|
|||
goto out;
|
||||
}
|
||||
}
|
||||
map->cache_bypass = 0;
|
||||
|
||||
if (map->cache_ops->sync) {
|
||||
ret = map->cache_ops->sync(map);
|
||||
|
|
Loading…
Reference in a new issue