aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-11-08 12:37:26 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-08 19:56:52 -0500
commitc48a9d74926c83f62b0251eff0a3dde259923856 (patch)
treee9292f22699f2ae1ea9e797222a7750ea498dd75 /drivers/base
parent82cd9965c37be7e2cbcb79ad991a6b9860f855d8 (diff)
regmap: Support some more block operations on cached devices
Commit 10a08d9f ("regmap: Support some block operations on cached devices") allowed raw read operations without throwing a warning when using caches if all registers are volatile. This patch does the same for raw write operations. This is for example useful when loading a firmware in a predefined volatile region on a chip where we otherwise want registers to be cached. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 5c4e76de38d2..3e30d168eb1d 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -389,9 +389,11 @@ EXPORT_SYMBOL_GPL(regmap_write);
389int regmap_raw_write(struct regmap *map, unsigned int reg, 389int regmap_raw_write(struct regmap *map, unsigned int reg,
390 const void *val, size_t val_len) 390 const void *val, size_t val_len)
391{ 391{
392 size_t val_count = val_len / map->format.val_bytes;
392 int ret; 393 int ret;
393 394
394 WARN_ON(map->cache_type != REGCACHE_NONE); 395 WARN_ON(!regmap_volatile_range(map, reg, val_count) &&
396 map->cache_type != REGCACHE_NONE);
395 397
396 mutex_lock(&map->lock); 398 mutex_lock(&map->lock);
397 399