mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
regmap: Skip hardware defaults for LZO caches
Saves some I/O when resyncing; we assume that syncs start from the device reset state. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
f0c2319f9f
commit
a3c3774176
@ -343,6 +343,12 @@ static int regcache_lzo_sync(struct regmap *map)
|
||||
ret = regcache_read(map, i, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Is this the hardware default? If so skip. */
|
||||
ret = regcache_lookup_reg(map, i);
|
||||
if (ret > 0 && val == map->reg_defaults[ret].def)
|
||||
continue;
|
||||
|
||||
map->cache_bypass = 1;
|
||||
ret = _regmap_write(map, i, val);
|
||||
map->cache_bypass = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user