Skip to content

Commit 075f56c

Browse files
committed
spi: SAM add RTIO support
Implements the SPI RTIO API. Refactors many of the internal transfer functions to work on simple types to allow for both the RTIO and existing SPI API functions to co-exist. Removes the unneeded shift_master specialization. Either a polling or DMA transfer flow is used when used with RTIO as all operations are normalized. When SPI_RTIO is enabled the spi_transceive blocking call translates the request into an RTIO transaction placed in the queue of transactions the device is meant to do. Signed-off-by: Tom Burdick <[email protected]>
1 parent 7f56c82 commit 075f56c

File tree

2 files changed

+362
-174
lines changed

2 files changed

+362
-174
lines changed

drivers/spi/Kconfig.sam

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,19 @@ config SPI_SAM_DMA
1919
help
2020
Enable using DMA with SPI for SPI instances that enable dma channels in
2121
their device tree node.
22+
23+
if SPI_RTIO
24+
config SPI_SAM_RTIO_SQ_SIZE
25+
int "Number of avialable submission queue entries"
26+
default 8 # Sensible default that covers most common spi transactions
27+
help
28+
When RTIO is use with SPI each driver holds a context with which blocking
29+
API calls use to perform SPI transactions. This queue needs to be as deep
30+
as the longest set of spi_buf_sets used, where normal SPI operations are
31+
used (equal length buffers). It may need to be slightly deeper where the
32+
spi buffer sets for transmit/receive are not always matched equally in
33+
length as these are transformed into normal transceives.
34+
35+
endif # SPI_RTIO
36+
2237
endif # SPI_SAM

0 commit comments

Comments
 (0)