summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-19 18:22:14 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-19 19:06:37 +0100
commit92afb286d744511f51a05f8acb6c111d05737617 (patch)
tree4453e7f7ba9b9bbc2ff8fbce64b2fe3a3b81f809 /drivers/base/regmap
parent39a58439d6006c48941511276c0041f56352c529 (diff)
regmap: Allow drivers to control cache_only flag
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r--drivers/base/regmap/regcache.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 179f222d76c..e2b172b93db 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)
{