From c2ca9645de688095eeee67ce765c09018f154252 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 19 Sep 2011 18:22:14 +0100 Subject: [PATCH] --- yaml --- r: 266992 b: refs/heads/master c: 92afb286d744511f51a05f8acb6c111d05737617 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/base/regmap/regcache.c | 18 ++++++++++++++++++ trunk/include/linux/regmap.h | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 9058c71ab0ba..1ebcaeadce4f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 39a58439d6006c48941511276c0041f56352c529 +refs/heads/master: 92afb286d744511f51a05f8acb6c111d05737617 diff --git a/trunk/drivers/base/regmap/regcache.c b/trunk/drivers/base/regmap/regcache.c index 179f222d76c3..e2b172b93dba 100644 --- a/trunk/drivers/base/regmap/regcache.c +++ b/trunk/drivers/base/regmap/regcache.c @@ -240,6 +240,24 @@ int regcache_sync(struct regmap *map) } EXPORT_SYMBOL_GPL(regcache_sync); +/** + * regcache_cache_only: Put a register map into cache only mode + * + * @map: map to configure + * @cache_only: flag if changes should be written to the hardware + * + * When a register map is marked as cache only writes to the register + * map API will only update the register cache, they will not cause + * any hardware changes. This is useful for allowing portions of + * drivers to act as though the device were functioning as normal when + * it is disabled for power saving reasons. + */ +void regcache_cache_only(struct regmap *map, bool enable) +{ + map->cache_only = enable; +} +EXPORT_SYMBOL_GPL(regcache_cache_only); + bool regcache_set_val(void *base, unsigned int idx, unsigned int val, unsigned int word_size) { diff --git a/trunk/include/linux/regmap.h b/trunk/include/linux/regmap.h index 63b30752adfd..76ac255a17a5 100644 --- a/trunk/include/linux/regmap.h +++ b/trunk/include/linux/regmap.h @@ -141,4 +141,6 @@ int regmap_update_bits(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val); int regcache_sync(struct regmap *map); +void regcache_cache_only(struct regmap *map, bool enable); + #endif