summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2014-02-10 17:35:48 -0800
committerAleksandr Frid <afrid@nvidia.com>2014-02-13 11:05:00 -0800
commit7658313e7a7126fbe94d68f738795211ce061dc3 (patch)
treec8ec1f88f933ae02929b1e53ffa9f007e86348e8 /include
parent538b70e2b892b1c24c7f5dc4f3a5e6fe4563fd68 (diff)
regmap: cache: Add interface to change volatile attribute
Defined regmap driver callback to set access attribute for the single register as either volatile or cached. Provided the respective public interface for changing access attribute on top of the callback. Cleared cache present bit to invalidate register cache whenever access is actually changed. Bug 1454969 Change-Id: If4e29ccc4c67892974ab6095f9d82e001198d19d Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/365704 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/regmap.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 61c350d24de0..882d360b9d75 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -126,6 +126,8 @@ typedef void (*regmap_unlock)(void *);
* field is NULL but precious_table (see below) is not, the
* check is performed on such table (a register is precious if
* it belongs to one of the ranges specified by precious_table).
+ * @reg_volatile_set: Optional callback to change access mode for the register
+ * between volatile and cached.
* @lock: Optional lock callback (overrides regmap's default lock
* function, based on spinlock or mutex).
* @unlock: As above for unlocking.
@@ -189,6 +191,8 @@ struct regmap_config {
bool (*readable_reg)(struct device *dev, unsigned int reg);
bool (*volatile_reg)(struct device *dev, unsigned int reg);
bool (*precious_reg)(struct device *dev, unsigned int reg);
+ int (*reg_volatile_set)(struct device *dev, unsigned int reg,
+ bool is_volatile);
regmap_lock lock;
regmap_unlock unlock;
void *lock_arg;
@@ -401,6 +405,8 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
void regcache_cache_only(struct regmap *map, bool enable);
void regcache_cache_bypass(struct regmap *map, bool enable);
void regcache_mark_dirty(struct regmap *map);
+int regcache_volatile_set(struct regmap *map, unsigned int reg,
+ bool is_volatile);
int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
int num_regs);
@@ -597,6 +603,13 @@ static inline void regcache_mark_dirty(struct regmap *map)
WARN_ONCE(1, "regmap API is disabled");
}
+static int regcache_volatile_set(struct regmap *map, unsigned int reg,
+ bool is_volatile)
+{
+ WARN_ONCE(1, "regmap API is disabled");
+ return -EINVAL;
+}
+
static inline void regmap_async_complete(struct regmap *map)
{
WARN_ONCE(1, "regmap API is disabled");