From 0a25e4a3b7753d7cbf354992ed0471f98d787382 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 29 Sep 2011 14:36:27 +0100 Subject: [PATCH] --- yaml --- r: 267007 b: refs/heads/master c: 6eb0f5e0154facfe4f0acdb9f474cde773319efc h: refs/heads/master i: 267005: 20a2ce5bdf7c08f7db06aa9746b789746a9b0605 267003: 4829ed3ba758c533f028d5f7dfc9ad8d68a59ea3 266999: 30714a105e183a3355da96acadfb831c89a2d562 266991: b47aebdb650c717aef39a32d5fd3d0e74eabeffc 266975: 6f49f53b859c618056178717607cdbddcae2ef59 266943: d3e17b2aad55e789cda659b8c592edcf6d80a712 266879: da3d851abd58d6b08a8fa6b5f8e648feebcb42ca 266751: 298bff5d324dbb069ef53835943fd98ce7d4c38f v: v3 --- [refs] | 2 +- trunk/drivers/base/regmap/regcache.c | 19 +++++++++++++++++++ trunk/include/linux/regmap.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0ae2dbb3cf2c..6a8d8f12a888 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: beb1a10f219ce720c13168203bd5ebe4ce7879e0 +refs/heads/master: 6eb0f5e0154facfe4f0acdb9f474cde773319efc diff --git a/trunk/drivers/base/regmap/regcache.c b/trunk/drivers/base/regmap/regcache.c index 5dbc5076267e..876622453cd8 100644 --- a/trunk/drivers/base/regmap/regcache.c +++ b/trunk/drivers/base/regmap/regcache.c @@ -286,6 +286,25 @@ void regcache_cache_only(struct regmap *map, bool enable) } EXPORT_SYMBOL_GPL(regcache_cache_only); +/** + * regcache_cache_bypass: Put a register map into cache bypass mode + * + * @map: map to configure + * @cache_only: flag if changes should not be written to the hardware + * + * When a register map is marked with the cache bypass option, writes + * to the register map API will only update the hardware and not the + * the cache directly. This is useful when syncing the cache back to + * the hardware. + */ +void regcache_cache_bypass(struct regmap *map, bool enable) +{ + mutex_lock(&map->lock); + map->cache_bypass = enable; + mutex_unlock(&map->lock); +} +EXPORT_SYMBOL_GPL(regcache_cache_bypass); + 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 76ac255a17a5..3daac2d8dc37 100644 --- a/trunk/include/linux/regmap.h +++ b/trunk/include/linux/regmap.h @@ -142,5 +142,6 @@ int regmap_update_bits(struct regmap *map, unsigned int reg, int regcache_sync(struct regmap *map); void regcache_cache_only(struct regmap *map, bool enable); +void regcache_cache_bypass(struct regmap *map, bool enable); #endif