aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-05 06:50:40 -0400
committerMark Brown <broonie@linaro.org>2013-10-11 15:09:50 -0400
commitb158935f70b9c156903338053216dd0adf7ce31c (patch)
tree8fc35f89210cf56eb647c64f92a814c2ede84505 /include/trace
parent6bb9c0e34185717f5b0df4ad468476f64f0d73fb (diff)
spi: Provide common spi_message processing loop
The loops which SPI controller drivers use to process the list of transfers in a spi_message are typically very similar and have some error prone areas such as the handling of /CS. Help simplify drivers by factoring this code out into the core - if drivers provide a transfer_one() function instead of a transfer_one_message() function the core will handle processing at the message level. /CS can be controlled by either setting cs_gpio or providing a set_cs function. If this is not possible for hardware reasons then both can be omitted and the driver should continue to implement manual /CS handling. This is a first step in refactoring and it is expected that there will be further enhancements, for example factoring out of the mapping of transfers for DMA and the initiation and completion of interrupt driven transfers. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/spi.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/trace/events/spi.h b/include/trace/events/spi.h
index 5e77e21f885a..7e02c983bbe2 100644
--- a/include/trace/events/spi.h
+++ b/include/trace/events/spi.h
@@ -108,6 +108,48 @@ TRACE_EVENT(spi_message_done,
108 (unsigned)__entry->actual, (unsigned)__entry->frame) 108 (unsigned)__entry->actual, (unsigned)__entry->frame)
109); 109);
110 110
111DECLARE_EVENT_CLASS(spi_transfer,
112
113 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
114
115 TP_ARGS(msg, xfer),
116
117 TP_STRUCT__entry(
118 __field( int, bus_num )
119 __field( int, chip_select )
120 __field( struct spi_transfer *, xfer )
121 __field( int, len )
122 ),
123
124 TP_fast_assign(
125 __entry->bus_num = msg->spi->master->bus_num;
126 __entry->chip_select = msg->spi->chip_select;
127 __entry->xfer = xfer;
128 __entry->len = xfer->len;
129 ),
130
131 TP_printk("spi%d.%d %p len=%d", (int)__entry->bus_num,
132 (int)__entry->chip_select,
133 (struct spi_message *)__entry->xfer,
134 (int)__entry->len)
135);
136
137DEFINE_EVENT(spi_transfer, spi_transfer_start,
138
139 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
140
141 TP_ARGS(msg, xfer)
142
143);
144
145DEFINE_EVENT(spi_transfer, spi_transfer_stop,
146
147 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
148
149 TP_ARGS(msg, xfer)
150
151);
152
111#endif /* _TRACE_POWER_H */ 153#endif /* _TRACE_POWER_H */
112 154
113/* This part must be outside protection */ 155/* This part must be outside protection */