commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=6ac00c92c96171414ac5fa5e68b022c73ceca62e
branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/2011R1

Signed-off-by: Mark Brown <[email protected]>
---
 drivers/base/regmap/regcache.c |   18 ++++++++++++++++++
 include/linux/regmap.h         |    2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 179f222..e2b172b 100644
--- a/drivers/base/regmap/regcache.c
+++ b/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/include/linux/regmap.h b/include/linux/regmap.h
index 63b3075..76ac255 100644
--- a/include/linux/regmap.h
+++ b/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
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to