Skip to content

Commit

Permalink
regmap: Support some more block operations on cached devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 9, 2011
1 parent 82cd996 commit c48a9d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,11 @@ EXPORT_SYMBOL_GPL(regmap_write);
int regmap_raw_write(struct regmap *map, unsigned int reg,
const void *val, size_t val_len)
{
size_t val_count = val_len / map->format.val_bytes;
int ret;

WARN_ON(map->cache_type != REGCACHE_NONE);
WARN_ON(!regmap_volatile_range(map, reg, val_count) &&
map->cache_type != REGCACHE_NONE);

mutex_lock(&map->lock);

Expand Down

0 comments on commit c48a9d7

Please sign in to comment.