diff options
| author | Mark Brown <broonie@kernel.org> | 2021-06-25 14:08:26 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2021-06-25 14:08:26 +0100 |
| commit | 1bee1ecf232cd90ad112d78ab5124850b4e5ea09 (patch) | |
| tree | 850cf42ea49ec040c2042fdd8bc61d332461e948 /include/trace/events/spi.h | |
| parent | edf978a5a17dc9e38625b33821dc71f10c46f694 (diff) | |
| parent | b470e10eb43f19e08245cd87dd3192a8141cfbb5 (diff) | |
| download | linux-next-1bee1ecf232cd90ad112d78ab5124850b4e5ea09.tar.gz linux-next-1bee1ecf232cd90ad112d78ab5124850b4e5ea09.zip | |
Merge remote-tracking branch 'spi/for-5.14' into spi-next
Diffstat (limited to 'include/trace/events/spi.h')
| -rw-r--r-- | include/trace/events/spi.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/include/trace/events/spi.h b/include/trace/events/spi.h index 0dd9171d2ad8..c0d9844befd7 100644 --- a/include/trace/events/spi.h +++ b/include/trace/events/spi.h @@ -42,6 +42,63 @@ DEFINE_EVENT(spi_controller, spi_controller_busy, ); +TRACE_EVENT(spi_setup, + TP_PROTO(struct spi_device *spi, int status), + TP_ARGS(spi, status), + + TP_STRUCT__entry( + __field(int, bus_num) + __field(int, chip_select) + __field(unsigned long, mode) + __field(unsigned int, bits_per_word) + __field(unsigned int, max_speed_hz) + __field(int, status) + ), + + TP_fast_assign( + __entry->bus_num = spi->controller->bus_num; + __entry->chip_select = spi->chip_select; + __entry->mode = spi->mode; + __entry->bits_per_word = spi->bits_per_word; + __entry->max_speed_hz = spi->max_speed_hz; + __entry->status = status; + ), + + TP_printk("spi%d.%d setup mode %lu, %s%s%s%s%u bits/w, %u Hz max --> %d", + __entry->bus_num, __entry->chip_select, + (__entry->mode & SPI_MODE_X_MASK), + (__entry->mode & SPI_CS_HIGH) ? "cs_high, " : "", + (__entry->mode & SPI_LSB_FIRST) ? "lsb, " : "", + (__entry->mode & SPI_3WIRE) ? "3wire, " : "", + (__entry->mode & SPI_LOOP) ? "loopback, " : "", + __entry->bits_per_word, __entry->max_speed_hz, + __entry->status) +); + +TRACE_EVENT(spi_set_cs, + TP_PROTO(struct spi_device *spi, bool enable), + TP_ARGS(spi, enable), + + TP_STRUCT__entry( + __field(int, bus_num) + __field(int, chip_select) + __field(unsigned long, mode) + __field(bool, enable) + ), + + TP_fast_assign( + __entry->bus_num = spi->controller->bus_num; + __entry->chip_select = spi->chip_select; + __entry->mode = spi->mode; + __entry->enable = enable; + ), + + TP_printk("spi%d.%d %s%s", + __entry->bus_num, __entry->chip_select, + __entry->enable ? "activate" : "deactivate", + (__entry->mode & SPI_CS_HIGH) ? ", cs_high" : "") +); + DECLARE_EVENT_CLASS(spi_message, TP_PROTO(struct spi_message *msg), |
