diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-16 11:05:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-16 11:05:44 -0400 |
commit | b508c80c553c03baf5c9ad5612ac8caceb13c5f4 (patch) | |
tree | 9a2047f94df087374f7ad3e9058f174ff5dad533 | |
parent | 41ef2d5678d83af030125550329b6ae8b74618fa (diff) | |
parent | fe7d4ccd1d7748bc9919c1bdee1e8286776f75ff (diff) |
Merge remote-tracking branch 'regmap/topic/async' into regmap-next
-rw-r--r-- | drivers/base/regmap/regmap.c | 8 | ||||
-rw-r--r-- | include/trace/events/regmap.h | 48 |
2 files changed, 56 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 58cfb3232428..672ac082cafa 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -999,6 +999,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, | |||
999 | if (!async) | 999 | if (!async) |
1000 | return -ENOMEM; | 1000 | return -ENOMEM; |
1001 | 1001 | ||
1002 | trace_regmap_async_write_start(map->dev, reg, val_len); | ||
1003 | |||
1002 | async->work_buf = kzalloc(map->format.buf_size, | 1004 | async->work_buf = kzalloc(map->format.buf_size, |
1003 | GFP_KERNEL | GFP_DMA); | 1005 | GFP_KERNEL | GFP_DMA); |
1004 | if (!async->work_buf) { | 1006 | if (!async->work_buf) { |
@@ -1642,6 +1644,8 @@ void regmap_async_complete_cb(struct regmap_async *async, int ret) | |||
1642 | struct regmap *map = async->map; | 1644 | struct regmap *map = async->map; |
1643 | bool wake; | 1645 | bool wake; |
1644 | 1646 | ||
1647 | trace_regmap_async_io_complete(map->dev); | ||
1648 | |||
1645 | spin_lock(&map->async_lock); | 1649 | spin_lock(&map->async_lock); |
1646 | 1650 | ||
1647 | list_del(&async->list); | 1651 | list_del(&async->list); |
@@ -1688,6 +1692,8 @@ int regmap_async_complete(struct regmap *map) | |||
1688 | if (!map->bus->async_write) | 1692 | if (!map->bus->async_write) |
1689 | return 0; | 1693 | return 0; |
1690 | 1694 | ||
1695 | trace_regmap_async_complete_start(map->dev); | ||
1696 | |||
1691 | wait_event(map->async_waitq, regmap_async_is_done(map)); | 1697 | wait_event(map->async_waitq, regmap_async_is_done(map)); |
1692 | 1698 | ||
1693 | spin_lock_irqsave(&map->async_lock, flags); | 1699 | spin_lock_irqsave(&map->async_lock, flags); |
@@ -1695,6 +1701,8 @@ int regmap_async_complete(struct regmap *map) | |||
1695 | map->async_ret = 0; | 1701 | map->async_ret = 0; |
1696 | spin_unlock_irqrestore(&map->async_lock, flags); | 1702 | spin_unlock_irqrestore(&map->async_lock, flags); |
1697 | 1703 | ||
1704 | trace_regmap_async_complete_done(map->dev); | ||
1705 | |||
1698 | return ret; | 1706 | return ret; |
1699 | } | 1707 | } |
1700 | EXPORT_SYMBOL_GPL(regmap_async_complete); | 1708 | EXPORT_SYMBOL_GPL(regmap_async_complete); |
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 41a7dbd570e2..a43a2f67bd8e 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h | |||
@@ -175,6 +175,54 @@ DEFINE_EVENT(regmap_bool, regmap_cache_bypass, | |||
175 | 175 | ||
176 | ); | 176 | ); |
177 | 177 | ||
178 | DECLARE_EVENT_CLASS(regmap_async, | ||
179 | |||
180 | TP_PROTO(struct device *dev), | ||
181 | |||
182 | TP_ARGS(dev), | ||
183 | |||
184 | TP_STRUCT__entry( | ||
185 | __string( name, dev_name(dev) ) | ||
186 | ), | ||
187 | |||
188 | TP_fast_assign( | ||
189 | __assign_str(name, dev_name(dev)); | ||
190 | ), | ||
191 | |||
192 | TP_printk("%s", __get_str(name)) | ||
193 | ); | ||
194 | |||
195 | DEFINE_EVENT(regmap_block, regmap_async_write_start, | ||
196 | |||
197 | TP_PROTO(struct device *dev, unsigned int reg, int count), | ||
198 | |||
199 | TP_ARGS(dev, reg, count) | ||
200 | ); | ||
201 | |||
202 | DEFINE_EVENT(regmap_async, regmap_async_io_complete, | ||
203 | |||
204 | TP_PROTO(struct device *dev), | ||
205 | |||
206 | TP_ARGS(dev) | ||
207 | |||
208 | ); | ||
209 | |||
210 | DEFINE_EVENT(regmap_async, regmap_async_complete_start, | ||
211 | |||
212 | TP_PROTO(struct device *dev), | ||
213 | |||
214 | TP_ARGS(dev) | ||
215 | |||
216 | ); | ||
217 | |||
218 | DEFINE_EVENT(regmap_async, regmap_async_complete_done, | ||
219 | |||
220 | TP_PROTO(struct device *dev), | ||
221 | |||
222 | TP_ARGS(dev) | ||
223 | |||
224 | ); | ||
225 | |||
178 | #endif /* _TRACE_REGMAP_H */ | 226 | #endif /* _TRACE_REGMAP_H */ |
179 | 227 | ||
180 | /* This part must be outside protection */ | 228 | /* This part must be outside protection */ |