mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
regmap: Fixes for v3.17
Several bug fixes for issues that have been lurking for a while: - Check that devices haven't set the flag saying they only support register at a time operation while we're doing cache syncs, otherwise we fail to restore caches. - Ensure that we don't mark all registers on devices using format_write() as cacheable, avoiding adding a cache of things like reset registers which we don't want to rewrite during cache sync. - Make sure we create the debugfs files in the correct directory. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJUAxeQAAoJELSic+t+oim9B78QAJMkF35qhkf1iMMSLL2bX2uJ CB4apXLDFMAQjr1JFJmB5gQlxUb9/QH3jYNXFuNnHioQLHVx4BulN3wT3K6dQLr/ xxGgIpxjtKmYXDjUASlCLG1M+MPBawKN7VuV0cDm2uT9Jm9QmF2WSqNGsOv/Q9MM i2PepX20FBcfEaUu+uAcPenTwjpnayWp3RhAGJMRExp0nOUGxwXhj+hh7PWtw6tz DJS38Y9PJfCI+NLgz4Eq5TS2VRXPtSCYhVCsSURT6J/XbCqoDhI9kzxJ8ZC31kE/ mJxgEZfnREV5vG3zwDFgkifLZjbR668rHRU0eE/LrvBsU16PJ290LbBjbz4JLLwq teDq/8j/T9ScN0cM46kgvFiPXvR06dvsuy1mJ6Sv1+78XEtDTrrRawj9aRFcwQv0 D3STRnPpLuaeNRMjIRwp2zQZmvz9zR9kytvGXyDNLoTtCfPuGsd2FmW2IWz6uf0u FB1uEhpJXUFtYq1wzOsHGEvuxZdtUS099aiAJspwUzCUsVJvuN7E2zRRmz/zwPKT Dgv3lVpAhYPrZzr3yL7kV9kdofw1T433lkdvSLH254MWGJuBqp8oli2lHFd11f2q NMgPvjLtSd3qFP/9Ayj01nekyEsRi5VRuhYDTo1Nro+Mczw9W+4vvbIbX1VAmULl cGn8gmGm8ht6QbzmVwcj =Eo/I -----END PGP SIGNATURE----- Merge tag 'regmap-v3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fixes from Mark Brown: "Several bug fixes for issues that have been lurking for a while: - Check that devices haven't set the flag saying they only support register at a time operation while we're doing cache syncs, otherwise we fail to restore caches - Ensure that we don't mark all registers on devices using format_write() as cacheable, avoiding adding a cache of things like reset registers which we don't want to rewrite during cache sync - Make sure we create the debugfs files in the correct directory" * tag 'regmap-v3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Don't attempt block writes when syncing cache on single_rw devices regmap: Fix handling of volatile registers for format_write() chips regmap: Fix regcache debugfs initialization
This commit is contained in:
commit
cce15667ae
5 changed files with 11 additions and 8 deletions
|
@ -146,6 +146,9 @@ struct regcache_ops {
|
|||
enum regcache_type type;
|
||||
int (*init)(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 (*write)(struct regmap *map, unsigned int reg, unsigned int value);
|
||||
int (*sync)(struct regmap *map, unsigned int min, unsigned int max);
|
||||
|
|
|
@ -194,10 +194,6 @@ static void rbtree_debugfs_init(struct regmap *map)
|
|||
{
|
||||
debugfs_create_file("rbtree", 0400, map->debugfs, map, &rbtree_fops);
|
||||
}
|
||||
#else
|
||||
static void rbtree_debugfs_init(struct regmap *map)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static int regcache_rbtree_init(struct regmap *map)
|
||||
|
@ -222,8 +218,6 @@ static int regcache_rbtree_init(struct regmap *map)
|
|||
goto err;
|
||||
}
|
||||
|
||||
rbtree_debugfs_init(map);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
@ -532,6 +526,9 @@ struct regcache_ops regcache_rbtree_ops = {
|
|||
.name = "rbtree",
|
||||
.init = regcache_rbtree_init,
|
||||
.exit = regcache_rbtree_exit,
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
.debugfs_init = rbtree_debugfs_init,
|
||||
#endif
|
||||
.read = regcache_rbtree_read,
|
||||
.write = regcache_rbtree_write,
|
||||
.sync = regcache_rbtree_sync,
|
||||
|
|
|
@ -698,7 +698,7 @@ int regcache_sync_block(struct regmap *map, void *block,
|
|||
unsigned int block_base, unsigned int start,
|
||||
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,
|
||||
block_base, start, end);
|
||||
else
|
||||
|
|
|
@ -538,6 +538,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
|
|||
|
||||
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)
|
||||
|
|
|
@ -109,7 +109,7 @@ bool regmap_readable(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;
|
||||
|
||||
if (map->volatile_reg)
|
||||
|
|
Loading…
Reference in a new issue