diff options
-rw-r--r-- | drivers/base/regmap/regcache.c | 12 | ||||
-rw-r--r-- | include/trace/events/regmap.h | 9 |
2 files changed, 19 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) | |||
193 | int regcache_read(struct regmap *map, | 193 | int 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 | } |
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 1e3193b8fcc8..12fbf43524e9 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h | |||
@@ -55,6 +55,15 @@ DEFINE_EVENT(regmap_reg, regmap_reg_read, | |||
55 | 55 | ||
56 | ); | 56 | ); |
57 | 57 | ||
58 | DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, | ||
59 | |||
60 | TP_PROTO(struct device *dev, unsigned int reg, | ||
61 | unsigned int val), | ||
62 | |||
63 | TP_ARGS(dev, reg, val) | ||
64 | |||
65 | ); | ||
66 | |||
58 | DECLARE_EVENT_CLASS(regmap_block, | 67 | DECLARE_EVENT_CLASS(regmap_block, |
59 | 68 | ||
60 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 69 | TP_PROTO(struct device *dev, unsigned int reg, int count), |