提交 f2985367 编写于 作者: M Mark Brown

regmap: Cache single values read from the chip

If we don't have a cached value for a register and we can cache it then
when we do a read a value we should add it to the cache to save rereading
it later on. Do this for single register reads, for block reads the code
would be a little more complex and this covers most practical usage.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 d939fb9a
......@@ -698,6 +698,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
trace_regmap_reg_read(map->dev, reg, *val);
}
if (ret == 0 && !map->cache_bypass)
regcache_write(map, reg, *val);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册