Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c48a9d74 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 82cd9965
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);