aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-30 09:27:08 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-30 15:51:09 -0500
commitbc7ee55633867909bb05e71f957a4d3c1aa1b488 (patch)
treeb8465a2ee229fed3a7ea133a983236ffe7f657d7 /drivers/base
parent018690d33ecf4aa1eb1415e38c40e2b0b6c7808e (diff)
regmap: Add trace event for successful cache reads
Currently we only trace physical reads, there's no instrumentation if the read is satisfied from cache. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regcache.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 1ca2d7a1051f..1ead66186b7c 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -193,13 +193,21 @@ void regcache_exit(struct regmap *map)
193int regcache_read(struct regmap *map, 193int regcache_read(struct regmap *map,
194 unsigned int reg, unsigned int *value) 194 unsigned int reg, unsigned int *value)
195{ 195{
196 int ret;
197
196 if (map->cache_type == REGCACHE_NONE) 198 if (map->cache_type == REGCACHE_NONE)
197 return -ENOSYS; 199 return -ENOSYS;
198 200
199 BUG_ON(!map->cache_ops); 201 BUG_ON(!map->cache_ops);
200 202
201 if (!regmap_volatile(map, reg)) 203 if (!regmap_volatile(map, reg)) {
202 return map->cache_ops->read(map, reg, value); 204 ret = map->cache_ops->read(map, reg, value);
205
206 if (ret == 0)
207 trace_regmap_reg_read_cache(map->dev, reg, *value);
208
209 return ret;
210 }
203 211
204 return -EINVAL; 212 return -EINVAL;
205} 213}