Re: [PATCH 2/2] regmap: Support some more block operations oncached devices

From: Dimitris Papastamos
Date: Wed Nov 09 2011 - 07:14:09 EST


On Tue, Nov 08, 2011 at 06:37:26PM +0100, Lars-Peter Clausen wrote:
> 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@xxxxxxxxxx>
> ---
> drivers/base/regmap/regmap.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index 4016b00..a471083 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -387,9 +387,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);
>
> --
> 1.7.7

Acked-by: Dimitris Papastamos <dp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/