aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r--drivers/base/regmap/regcache.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 5dbc5076267e..876622453cd8 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -286,6 +286,25 @@ void regcache_cache_only(struct regmap *map, bool enable)
286} 286}
287EXPORT_SYMBOL_GPL(regcache_cache_only); 287EXPORT_SYMBOL_GPL(regcache_cache_only);
288 288
289/**
290 * regcache_cache_bypass: Put a register map into cache bypass mode
291 *
292 * @map: map to configure
293 * @cache_only: flag if changes should not be written to the hardware
294 *
295 * When a register map is marked with the cache bypass option, writes
296 * to the register map API will only update the hardware and not the
297 * the cache directly. This is useful when syncing the cache back to
298 * the hardware.
299 */
300void regcache_cache_bypass(struct regmap *map, bool enable)
301{
302 mutex_lock(&map->lock);
303 map->cache_bypass = enable;
304 mutex_unlock(&map->lock);
305}
306EXPORT_SYMBOL_GPL(regcache_cache_bypass);
307
289bool regcache_set_val(void *base, unsigned int idx, 308bool regcache_set_val(void *base, unsigned int idx,
290 unsigned int val, unsigned int word_size) 309 unsigned int val, unsigned int word_size)
291{ 310{