diff options
-rw-r--r-- | drivers/base/regmap/regcache.c | 2 | ||||
-rw-r--r-- | include/trace/events/regmap.h | 36 |
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 69d4c9c5a4a8..2d89ce08f137 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c | |||
@@ -313,6 +313,7 @@ void regcache_cache_only(struct regmap *map, bool enable) | |||
313 | mutex_lock(&map->lock); | 313 | mutex_lock(&map->lock); |
314 | WARN_ON(map->cache_bypass && enable); | 314 | WARN_ON(map->cache_bypass && enable); |
315 | map->cache_only = enable; | 315 | map->cache_only = enable; |
316 | trace_regmap_cache_only(map->dev, enable); | ||
316 | mutex_unlock(&map->lock); | 317 | mutex_unlock(&map->lock); |
317 | } | 318 | } |
318 | EXPORT_SYMBOL_GPL(regcache_cache_only); | 319 | EXPORT_SYMBOL_GPL(regcache_cache_only); |
@@ -350,6 +351,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable) | |||
350 | mutex_lock(&map->lock); | 351 | mutex_lock(&map->lock); |
351 | WARN_ON(map->cache_only && enable); | 352 | WARN_ON(map->cache_only && enable); |
352 | map->cache_bypass = enable; | 353 | map->cache_bypass = enable; |
354 | trace_regmap_cache_bypass(map->dev, enable); | ||
353 | mutex_unlock(&map->lock); | 355 | mutex_unlock(&map->lock); |
354 | } | 356 | } |
355 | EXPORT_SYMBOL_GPL(regcache_cache_bypass); | 357 | EXPORT_SYMBOL_GPL(regcache_cache_bypass); |
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 12fbf43524e9..d69738280ffa 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h | |||
@@ -139,6 +139,42 @@ TRACE_EVENT(regcache_sync, | |||
139 | __get_str(type), __get_str(status)) | 139 | __get_str(type), __get_str(status)) |
140 | ); | 140 | ); |
141 | 141 | ||
142 | DECLARE_EVENT_CLASS(regmap_bool, | ||
143 | |||
144 | TP_PROTO(struct device *dev, bool flag), | ||
145 | |||
146 | TP_ARGS(dev, flag), | ||
147 | |||
148 | TP_STRUCT__entry( | ||
149 | __string( name, dev_name(dev) ) | ||
150 | __field( int, flag ) | ||
151 | ), | ||
152 | |||
153 | TP_fast_assign( | ||
154 | __assign_str(name, dev_name(dev)); | ||
155 | __entry->flag = flag; | ||
156 | ), | ||
157 | |||
158 | TP_printk("%s flag=%d", __get_str(name), | ||
159 | (int)__entry->flag) | ||
160 | ); | ||
161 | |||
162 | DEFINE_EVENT(regmap_bool, regmap_cache_only, | ||
163 | |||
164 | TP_PROTO(struct device *dev, bool flag), | ||
165 | |||
166 | TP_ARGS(dev, flag) | ||
167 | |||
168 | ); | ||
169 | |||
170 | DEFINE_EVENT(regmap_bool, regmap_cache_bypass, | ||
171 | |||
172 | TP_PROTO(struct device *dev, bool flag), | ||
173 | |||
174 | TP_ARGS(dev, flag) | ||
175 | |||
176 | ); | ||
177 | |||
142 | #endif /* _TRACE_REGMAP_H */ | 178 | #endif /* _TRACE_REGMAP_H */ |
143 | 179 | ||
144 | /* This part must be outside protection */ | 180 | /* This part must be outside protection */ |