Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/spi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ zephyr_library_sources_ifdef(CONFIG_NXP_S32_SPI spi_nxp_s32.c)
zephyr_library_sources_ifdef(CONFIG_SPI_XMC4XXX spi_xmc4xxx.c)
zephyr_library_sources_ifdef(CONFIG_SPI_PW spi_pw.c)

zephyr_library_sources_ifdef(CONFIG_SPI_RTIO spi_rtio.c)
zephyr_library_sources_ifdef(CONFIG_SPI_ASYNC spi_signal.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE spi_handlers.c)
8 changes: 8 additions & 0 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ config SPI_ASYNC
help
This option enables the asynchronous API calls.

config SPI_RTIO
bool "RTIO support [EXPERIMENTAL]"
select EXPERIMENTAL
select RTIO
help
This option enables the RTIO API calls. RTIO support is
experimental as the API itself is unstable.

config SPI_SLAVE
bool "Slave support [EXPERIMENTAL]"
select EXPERIMENTAL
Expand Down
15 changes: 15 additions & 0 deletions drivers/spi/Kconfig.sam
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,19 @@ config SPI_SAM_DMA
help
Enable using DMA with SPI for SPI instances that enable dma channels in
their device tree node.

if SPI_RTIO
config SPI_SAM_RTIO_SQ_SIZE
int "Number of avialable submission queue entries"
default 8 # Sensible default that covers most common spi transactions
help
When RTIO is use with SPI each driver holds a context with which blocking
API calls use to perform SPI transactions. This queue needs to be as deep
as the longest set of spi_buf_sets used, where normal SPI operations are
used (equal length buffers). It may need to be slightly deeper where the
spi buffer sets for transmit/receive are not always matched equally in
length as these are transformed into normal transceives.

endif # SPI_RTIO

endif # SPI_SAM
11 changes: 11 additions & 0 deletions drivers/spi/spi_rtio.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/drivers/spi.h>

const struct rtio_iodev_api spi_iodev_api = {
.submit = spi_iodev_submit,
};
Loading