aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-20 16:21:33 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-20 16:21:33 -0500
commitaca1e172a1096ed3785e0da01d82943b7562527c (patch)
tree0826c140b4e31acd7f8546727498dd849f099ba6 /drivers/base/regmap/regcache.c
parent3bf06a1ad9b147ca3a64b119d70c4a7c0ace3695 (diff)
parent2a14d7d9b7439fe62082a60a7f8983ccb463d134 (diff)
Merge branch 'topic/patch' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-drivers
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r--drivers/base/regmap/regcache.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index d1daa5e9fadf..e9032c329067 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -268,8 +268,22 @@ int regcache_sync(struct regmap *map)
268 map->cache_ops->name); 268 map->cache_ops->name);
269 name = map->cache_ops->name; 269 name = map->cache_ops->name;
270 trace_regcache_sync(map->dev, name, "start"); 270 trace_regcache_sync(map->dev, name, "start");
271
271 if (!map->cache_dirty) 272 if (!map->cache_dirty)
272 goto out; 273 goto out;
274
275 /* Apply any patch first */
276 map->cache_bypass = 1;
277 for (i = 0; i < map->patch_regs; i++) {
278 ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def);
279 if (ret != 0) {
280 dev_err(map->dev, "Failed to write %x = %x: %d\n",
281 map->patch[i].reg, map->patch[i].def, ret);
282 goto out;
283 }
284 }
285 map->cache_bypass = 0;
286
273 if (map->cache_ops->sync) { 287 if (map->cache_ops->sync) {
274 ret = map->cache_ops->sync(map); 288 ret = map->cache_ops->sync(map);
275 } else { 289 } else {