Skip to content

Commit

Permalink
spi: all: Add default iodev_submit to drivers without native support
Browse files Browse the repository at this point in the history
So that all SPI drivers are compatible with RTIO APIs.

(cherry picked from commit 64a038a)

Original-Signed-off-by: Luis Ubieda <luisf@croxel.com>
GitOrigin-RevId: 64a038a
Cr-Build-Id: 8737098476786990081
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8737098476786990081
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: Ic5ca9308929877b8f3c5cd24792bb760d3936ee1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5842086
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
  • Loading branch information
ubieda authored and Chromeos LUCI committed Sep 11, 2024
1 parent 61c164c commit 8460c5f
Show file tree
Hide file tree
Showing 48 changed files with 176 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi_ambiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
LOG_MODULE_REGISTER(spi_ambiq);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
Expand Down Expand Up @@ -402,6 +403,9 @@ static int spi_ambiq_release(const struct device *dev, const struct spi_config *

static const struct spi_driver_api spi_ambiq_driver_api = {
.transceive = spi_ambiq_transceive,
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_ambiq_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_ambiq_bleif.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
LOG_MODULE_REGISTER(spi_ambiq_bleif);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
Expand Down Expand Up @@ -160,6 +161,9 @@ static int spi_ambiq_release(const struct device *dev, const struct spi_config *

static struct spi_driver_api spi_ambiq_driver_api = {
.transceive = spi_ambiq_transceive,
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_ambiq_release,
};

Expand Down
3 changes: 3 additions & 0 deletions drivers/spi/spi_andes_atcspi200.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,9 @@ static const struct spi_driver_api spi_atcspi200_api = {
.transceive = spi_atcspi200_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_atcspi200_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_atcspi200_release
};
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi_andes_atcspi200.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ LOG_MODULE_REGISTER(spi_atcspi200);
#include "spi_context.h"
#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>

#ifdef CONFIG_ANDES_SPI_DMA_MODE
#include <zephyr/drivers/dma.h>
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_b91.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
LOG_MODULE_REGISTER(spi_telink);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_context.h"
#include <zephyr/drivers/pinctrl.h>

Expand Down Expand Up @@ -458,6 +459,9 @@ static const struct spi_driver_api spi_b91_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_b91_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
};

/* SPI driver registration */
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(spi_bitbang);

#include <zephyr/sys/sys_io.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_context.h"

struct spi_bitbang_data {
Expand Down Expand Up @@ -254,6 +255,9 @@ static const struct spi_driver_api spi_bitbang_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_bitbang_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
};

int spi_bitbang_init(const struct device *dev)
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_cc13xx_cc26xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
LOG_MODULE_REGISTER(spi_cc13xx_cc26xx);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/pm/device.h>
#include <zephyr/pm/policy.h>
Expand Down Expand Up @@ -237,6 +238,9 @@ static int spi_cc13xx_cc26xx_pm_action(const struct device *dev,
static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
.transceive = spi_cc13xx_cc26xx_transceive,
.release = spi_cc13xx_cc26xx_release,
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
};

#ifdef CONFIG_PM
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LOG_MODULE_REGISTER(spi_dw);
#endif

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/irq.h>

#include "spi_dw.h"
Expand Down Expand Up @@ -529,6 +530,9 @@ static const struct spi_driver_api dw_spi_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_dw_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_dw_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_emul.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(spi_emul_ctlr);
#include <zephyr/device.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/spi_emul.h>

/** Working data for the device */
Expand Down Expand Up @@ -131,6 +132,9 @@ int spi_emul_register(const struct device *dev, struct spi_emul *emul)

static const struct spi_driver_api spi_emul_api = {
.transceive = spi_emul_io,
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_emul_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_esp32_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(esp32_spi, CONFIG_SPI_LOG_LEVEL);
#include <soc.h>
#include <esp_memory_utils.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#if defined(CONFIG_SOC_SERIES_ESP32C2) || defined(CONFIG_SOC_SERIES_ESP32C3) || \
defined(CONFIG_SOC_SERIES_ESP32C6)
#include <zephyr/drivers/interrupt_controller/intc_esp32c3.h>
Expand Down Expand Up @@ -497,6 +498,9 @@ static const struct spi_driver_api spi_api = {
.transceive = spi_esp32_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_esp32_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_esp32_release
};
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_gd32.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/reset.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#ifdef CONFIG_SPI_GD32_DMA
#include <zephyr/drivers/dma.h>
#include <zephyr/drivers/dma/dma_gd32.h>
Expand Down Expand Up @@ -573,6 +574,9 @@ static const struct spi_driver_api spi_gd32_driver_api = {
.transceive = spi_gd32_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_gd32_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_gd32_release
};
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_gecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LOG_MODULE_REGISTER(spi_gecko);
#include <zephyr/sys/sys_io.h>
#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <soc.h>

#include "em_cmu.h"
Expand Down Expand Up @@ -386,6 +387,9 @@ static const struct spi_driver_api spi_gecko_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_gecko_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_gecko_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_grlib_spimctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define DT_DRV_COMPAT gaisler_spimctrl

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(spi_spimctrl);
Expand Down Expand Up @@ -219,6 +220,9 @@ static struct spi_driver_api api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_ifx_cat1.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LOG_MODULE_REGISTER(cat1_spi);

#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/kernel.h>

#include <cyhal_scb_common.h>
Expand Down Expand Up @@ -290,6 +291,9 @@ static const struct spi_driver_api ifx_cat1_spi_api = {
.transceive = ifx_cat1_spi_transceive_sync,
#if defined(CONFIG_SPI_ASYNC)
.transceive_async = ifx_cat1_spi_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = ifx_cat1_spi_release,
};
Expand Down
3 changes: 3 additions & 0 deletions drivers/spi/spi_litex.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ static const struct spi_driver_api spi_litex_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_litex_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_litex_release,
};

Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi_litex_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <zephyr/kernel.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys_clock.h>

Expand Down
3 changes: 3 additions & 0 deletions drivers/spi/spi_litex_litespi.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ static const struct spi_driver_api spi_litex_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_litex_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_litex_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ LOG_MODULE_REGISTER(spi_ll_stm32);
#include <stm32_ll_spi.h>
#include <errno.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/toolchain.h>
#include <zephyr/pm/policy.h>
Expand Down Expand Up @@ -1156,6 +1157,9 @@ static const struct spi_driver_api api_funcs = {
.transceive = spi_stm32_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_stm32_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_stm32_release,
};
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_max32.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <errno.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/clock_control/adi_max32_clock_control.h>
#include <zephyr/logging/log.h>
#include <zephyr/irq.h>
Expand Down Expand Up @@ -513,6 +514,9 @@ static const struct spi_driver_api spi_max32_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = api_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = api_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_mchp_mss.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
Expand Down Expand Up @@ -447,6 +448,9 @@ static const struct spi_driver_api mss_spi_driver_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = mss_spi_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = mss_spi_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_mchp_mss_qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
Expand Down Expand Up @@ -573,6 +574,9 @@ static const struct spi_driver_api mss_qspi_driver_api = {
#ifdef CONFIG_SPI_ASYNC
.transceive_async = mss_qspi_transceive_async,
#endif /* CONFIG_SPI_ASYNC */
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = mss_qspi_release,
};

Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_mcux_dspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <errno.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/clock_control.h>
#include <fsl_dspi.h>
#include <zephyr/drivers/pinctrl.h>
Expand Down Expand Up @@ -798,6 +799,9 @@ static const struct spi_driver_api spi_mcux_driver_api = {
.transceive = spi_mcux_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_mcux_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_mcux_release,
};
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_mcux_ecspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(spi_mcux_ecspi, CONFIG_SPI_LOG_LEVEL);
#include <zephyr/drivers/clock_control.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <fsl_ecspi.h>

#include "spi_context.h"
Expand Down Expand Up @@ -305,6 +306,9 @@ static const struct spi_driver_api spi_mcux_driver_api = {
.transceive = spi_mcux_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_mcux_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_mcux_release,
};
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi_mcux_flexcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <errno.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include <zephyr/drivers/clock_control.h>
#include <fsl_spi.h>
#include <zephyr/logging/log.h>
Expand Down Expand Up @@ -814,6 +815,9 @@ static const struct spi_driver_api spi_mcux_driver_api = {
.transceive = spi_mcux_transceive,
#ifdef CONFIG_SPI_ASYNC
.transceive_async = spi_mcux_transceive_async,
#endif
#ifdef CONFIG_SPI_RTIO
.iodev_submit = spi_rtio_iodev_default_submit,
#endif
.release = spi_mcux_release,
};
Expand Down
Loading

0 comments on commit 8460c5f

Please sign in to comment.