Commit d3b05339 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'regmap/fix/cache', 'regmap/fix/debugfs' and...

Merge remote-tracking branches 'regmap/fix/cache', 'regmap/fix/debugfs' and 'regmap/fix/volatile' into regmap-linus
...@@ -146,6 +146,9 @@ struct regcache_ops { ...@@ -146,6 +146,9 @@ struct regcache_ops {
enum regcache_type type; enum regcache_type type;
int (*init)(struct regmap *map); int (*init)(struct regmap *map);
int (*exit)(struct regmap *map); int (*exit)(struct regmap *map);
#ifdef CONFIG_DEBUG_FS
void (*debugfs_init)(struct regmap *map);
#endif
int (*read)(struct regmap *map, unsigned int reg, unsigned int *value); int (*read)(struct regmap *map, unsigned int reg, unsigned int *value);
int (*write)(struct regmap *map, unsigned int reg, unsigned int value); int (*write)(struct regmap *map, unsigned int reg, unsigned int value);
int (*sync)(struct regmap *map, unsigned int min, unsigned int max); int (*sync)(struct regmap *map, unsigned int min, unsigned int max);
......
...@@ -194,10 +194,6 @@ static void rbtree_debugfs_init(struct regmap *map) ...@@ -194,10 +194,6 @@ static void rbtree_debugfs_init(struct regmap *map)
{ {
debugfs_create_file("rbtree", 0400, map->debugfs, map, &rbtree_fops); debugfs_create_file("rbtree", 0400, map->debugfs, map, &rbtree_fops);
} }
#else
static void rbtree_debugfs_init(struct regmap *map)
{
}
#endif #endif
static int regcache_rbtree_init(struct regmap *map) static int regcache_rbtree_init(struct regmap *map)
...@@ -222,8 +218,6 @@ static int regcache_rbtree_init(struct regmap *map) ...@@ -222,8 +218,6 @@ static int regcache_rbtree_init(struct regmap *map)
goto err; goto err;
} }
rbtree_debugfs_init(map);
return 0; return 0;
err: err:
...@@ -532,6 +526,9 @@ struct regcache_ops regcache_rbtree_ops = { ...@@ -532,6 +526,9 @@ struct regcache_ops regcache_rbtree_ops = {
.name = "rbtree", .name = "rbtree",
.init = regcache_rbtree_init, .init = regcache_rbtree_init,
.exit = regcache_rbtree_exit, .exit = regcache_rbtree_exit,
#ifdef CONFIG_DEBUG_FS
.debugfs_init = rbtree_debugfs_init,
#endif
.read = regcache_rbtree_read, .read = regcache_rbtree_read,
.write = regcache_rbtree_write, .write = regcache_rbtree_write,
.sync = regcache_rbtree_sync, .sync = regcache_rbtree_sync,
......
...@@ -698,7 +698,7 @@ int regcache_sync_block(struct regmap *map, void *block, ...@@ -698,7 +698,7 @@ int regcache_sync_block(struct regmap *map, void *block,
unsigned int block_base, unsigned int start, unsigned int block_base, unsigned int start,
unsigned int end) unsigned int end)
{ {
if (regmap_can_raw_write(map)) if (regmap_can_raw_write(map) && !map->use_single_rw)
return regcache_sync_block_raw(map, block, cache_present, return regcache_sync_block_raw(map, block, cache_present,
block_base, start, end); block_base, start, end);
else else
......
...@@ -538,6 +538,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name) ...@@ -538,6 +538,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
next = rb_next(&range_node->node); next = rb_next(&range_node->node);
} }
if (map->cache_ops && map->cache_ops->debugfs_init)
map->cache_ops->debugfs_init(map);
} }
void regmap_debugfs_exit(struct regmap *map) void regmap_debugfs_exit(struct regmap *map)
......
...@@ -109,7 +109,7 @@ bool regmap_readable(struct regmap *map, unsigned int reg) ...@@ -109,7 +109,7 @@ bool regmap_readable(struct regmap *map, unsigned int reg)
bool regmap_volatile(struct regmap *map, unsigned int reg) bool regmap_volatile(struct regmap *map, unsigned int reg)
{ {
if (!regmap_readable(map, reg)) if (!map->format.format_write && !regmap_readable(map, reg))
return false; return false;
if (map->volatile_reg) if (map->volatile_reg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment