Skip to content

spi: rtio: Refactor common SPI RTIO APIs to use across common drivers #144283

spi: rtio: Refactor common SPI RTIO APIs to use across common drivers

spi: rtio: Refactor common SPI RTIO APIs to use across common drivers #144283

Triggered via pull request August 17, 2024 12:39
Status Success
Total duration 3m 0s
Artifacts 1

compliance.yml

on: pull_request
Run compliance checks on patch series (PR)
2m 49s
Run compliance checks on patch series (PR)
Fit to window
Zoom out
Zoom in

Annotations

1 error, 1 warning, and 10 notices
Run compliance checks on patch series (PR)
Process completed with exit code 1.
You may want to run clang-format on this change: drivers/spi/spi_mcux_lpspi.c#L578
drivers/spi/spi_mcux_lpspi.c:578 -static inline int transceive_rtio(const struct device *dev, - const struct spi_config *spi_cfg, +static inline int transceive_rtio(const struct device *dev, const struct spi_config *spi_cfg,
You may want to run clang-format on this change: drivers/spi/spi_mcux_lpspi.c#L855
drivers/spi/spi_mcux_lpspi.c:855 -#define SPI_MCUX_RTIO_DEFINE(n) SPI_RTIO_DEFINE(spi_mcux_rtio_##n, \ - CONFIG_SPI_MCUX_RTIO_SQ_SIZE, \ - CONFIG_SPI_MCUX_RTIO_SQ_SIZE) +#define SPI_MCUX_RTIO_DEFINE(n) \ + SPI_RTIO_DEFINE(spi_mcux_rtio_##n, CONFIG_SPI_MCUX_RTIO_SQ_SIZE, \ + CONFIG_SPI_MCUX_RTIO_SQ_SIZE)
You may want to run clang-format on this change: drivers/spi/spi_mcux_lpspi.c#L959
drivers/spi/spi_mcux_lpspi.c:959 -#define SPI_MCUX_LPSPI_INIT(n) \ - PINCTRL_DT_INST_DEFINE(n); \ - COND_CODE_1(CONFIG_SPI_RTIO, (SPI_MCUX_RTIO_DEFINE(n)), ()); \ - \ - static void spi_mcux_config_func_##n(const struct device *dev); \ - \ - static const struct spi_mcux_config spi_mcux_config_##n = { \ - DEVICE_MMIO_NAMED_ROM_INIT(reg_base, DT_DRV_INST(n)), \ - PARENT_DEV(n) \ - .clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \ - .clock_subsys = \ - (clock_control_subsys_t)DT_INST_CLOCKS_CELL(n, name), \ - .irq_config_func = spi_mcux_config_func_##n, \ - .pcs_sck_delay = UTIL_AND( \ - DT_INST_NODE_HAS_PROP(n, pcs_sck_delay), \ - DT_INST_PROP(n, pcs_sck_delay)), \ - .sck_pcs_delay = UTIL_AND( \ - DT_INST_NODE_HAS_PROP(n, sck_pcs_delay), \ - DT_INST_PROP(n, sck_pcs_delay)), \ - .transfer_delay = UTIL_AND( \ - DT_INST_NODE_HAS_PROP(n, transfer_delay), \ - DT_INST_PROP(n, transfer_delay)), \ - .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \ - .data_pin_config = DT_INST_ENUM_IDX(n, data_pin_config),\ - }; \ - \ - static struct spi_mcux_data spi_mcux_data_##n = { \ - SPI_CONTEXT_INIT_LOCK(spi_mcux_data_##n, ctx), \ - SPI_CONTEXT_INIT_SYNC(spi_mcux_data_##n, ctx), \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(n), ctx) \ - SPI_DMA_CHANNELS(n) \ - IF_ENABLED(CONFIG_SPI_RTIO, \ - (.rtio_ctx = &spi_mcux_rtio_##n,)) \ - \ - }; \ - \ - DEVICE_DT_INST_DEFINE(n, spi_mcux_init, NULL, \ - &spi_mcux_data_##n, \ - &spi_mcux_config_##n, POST_KERNEL, \ - CONFIG_SPI_INIT_PRIORITY, \ - &spi_mcux_driver_api); \ - \ - static void spi_mcux_config_func_##n(const struct device *dev) \ - { \ - SPI_MCUX_LPSPI_MODULE_IRQ(n); \ +#define SPI_MCUX_LPSPI_INIT(n) \ + PINCTRL_DT_INST_DEFINE(n); \ + COND_CODE_1(CONFIG_SPI_RTIO, (SPI_MCUX_RTIO_DEFINE(n)), ()); \ + \ + static void spi_mcux_config_func_##n(const struct device *dev); \ + \ + static const struct spi_mcux_config spi_mcux_config_##n = { \ + DEVICE_MMIO_NAMED_ROM_INIT(reg_base, DT_DRV_INST(n)), \ + PARENT_DEV(n).clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \ + .clock_subsys = (clock_control_subsys_t)DT_INST_CLOCKS_CELL(n, name), \ + .irq_config_func = spi_mcux_config_func_##n, \ + .pcs_sck_delay = UTIL_AND(DT_INST_NODE_HAS_PROP(n, pcs_sck_delay), \ + DT_INST_PROP(n, pcs_sck_delay)), \ + .sck_pcs_delay = UTIL_AND(DT_INST_NODE_HAS_PROP(n, sck_pcs_delay), \ + DT_INST_PROP(n, sck_pcs_delay)), \ + .transfer_delay = UTIL_AND(DT_INST_NODE_HAS_PROP(n, transfer_delay), \ + DT_INST_PROP(n, transfer_delay)), \ + .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \ + .data_pin_config = DT_INST_ENUM_IDX(n, data_pin_config), \ + }; \ + \ + static struct spi_mcux_data spi_mcux_data_##n = { \ + SPI_CONTEXT_INIT_LOCK(spi_mcux_data_##n, ctx), \ + SPI_CONTEXT_INIT_SYNC(spi_mcux_data_##n, ctx), \ + SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(n), ctx) SPI_DMA_CHANNELS(n) \ + IF_ENABLED(CONFIG_SPI_RTIO, (.rtio_ctx = &spi_mcux_rtio_##n,
You may want to run clang-format on this change: drivers/spi/spi_rtio.c#L35
drivers/spi/spi_rtio.c:35 -int spi_rtio_copy(struct rtio *r, - struct rtio_iodev *iodev, - const struct spi_buf_set *tx_bufs, - const struct spi_buf_set *rx_bufs, - struct rtio_sqe **last_sqe) +int spi_rtio_copy(struct rtio *r, struct rtio_iodev *iodev, const struct spi_buf_set *tx_bufs, + const struct spi_buf_set *rx_bufs, struct rtio_sqe **last_sqe)
You may want to run clang-format on this change: drivers/spi/spi_rtio.c#L85
drivers/spi/spi_rtio.c:85 - rtio_sqe_prep_read(sqe, iodev, RTIO_PRIO_NORM, - rx_buf, rx_len, NULL); + rtio_sqe_prep_read(sqe, iodev, RTIO_PRIO_NORM, rx_buf, rx_len, + NULL); } else if (rx_buf == NULL) { - rtio_sqe_prep_write(sqe, iodev, RTIO_PRIO_NORM, - tx_buf, tx_len, NULL); - } else { - rtio_sqe_prep_transceive(sqe, iodev, RTIO_PRIO_NORM, - tx_buf, rx_buf, rx_len, NULL); + rtio_sqe_prep_write(sqe, iodev, RTIO_PRIO_NORM, tx_buf, tx_len, + NULL); + } else { + rtio_sqe_prep_transceive(sqe, iodev, RTIO_PRIO_NORM, tx_buf, rx_buf, + rx_len, NULL);
You may want to run clang-format on this change: drivers/spi/spi_rtio.c#L107
drivers/spi/spi_rtio.c:107 - rtio_sqe_prep_read(sqe, iodev, RTIO_PRIO_NORM, - (uint8_t *)rx_buf, - (uint32_t)rx_len, - NULL); + rtio_sqe_prep_read(sqe, iodev, RTIO_PRIO_NORM, (uint8_t *)rx_buf, + (uint32_t)rx_len, NULL);
You may want to run clang-format on this change: drivers/spi/spi_rtio.c#L120
drivers/spi/spi_rtio.c:120 - rtio_sqe_prep_write(sqe, iodev, RTIO_PRIO_NORM, - (uint8_t *)tx_buf, - (uint32_t)tx_len, - NULL); + rtio_sqe_prep_write(sqe, iodev, RTIO_PRIO_NORM, (uint8_t *)tx_buf, + (uint32_t)tx_len, NULL);
Run compliance checks on patch series (PR): ClangFormat.txt#L1
See https://docs.zephyrproject.org/latest/contribute/guidelines.html#clang-format for more details. You may want to run clang-format on this change: -static inline int transceive_rtio(const struct device *dev, - const struct spi_config *spi_cfg, +static inline int transceive_rtio(const struct device *dev, const struct spi_config *spi_cfg, File:drivers/spi/spi_mcux_lpspi.c Line:578 You may want to run clang-format on this change: - File:drivers/spi/spi_mcux_lpspi.c Line:754 You may want to run clang-format on this change: -#define SPI_MCUX_RTIO_DEFINE(n) SPI_RTIO_DEFINE(spi_mcux_rtio_##n, \ - CONFIG_SPI_MCUX_RTIO_SQ_SIZE, \ - CONFIG_SPI_MCUX_RTIO_SQ_SIZE) +#define SPI_MCUX_RTIO_DEFINE(n) \ + SPI_RTIO_DEFINE(spi_mcux_rtio_##n, CONFIG_SPI_MCUX_RTIO_SQ_SIZE, \ + CONFIG_SPI_MCUX_RTIO_SQ_SIZE) File:drivers/spi/spi_mcux_lpspi.c Line:855 You may want to run clang-format on this change: -#define SPI_MCUX_LPSPI_INIT(n) \ - PINCTRL_DT_INST_DEFINE(n); \ - COND_CODE_1(CONFIG_SPI_RTIO, (SPI_MCUX_RTIO_DEFINE(n)), ()); \ - \ - static void spi_mcux_config_func_##n(const struct device *dev); \ - \ - static const struct spi_mcux_config spi_mcux_config_##n = { \ - DEVICE_MMIO_NAMED_ROM_INIT(reg_base, DT_DRV_INST(n)), \ - PARENT_DEV(n) \ - .clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \ - .clock_subsys = \ - (clock_control_subsys_t)DT_INST_CLOCKS_CELL(n, name), \ - .irq_config_func = spi_mcux_config_func_##n, \ - .pcs_sck_delay = UTIL_AND( \ - DT_INST_NODE_HAS_PROP(n, pcs_sck_delay), \ - DT_INST_PROP(n, pcs_sck_delay)), \ - .sck_pcs_delay = UTIL_AND( \ - DT_INST_NODE_HAS_PROP(n, sck_pcs_delay), \ - DT_INST_PROP(n, sck_pcs_delay)), \ - .transfer_delay = UTIL_AND( \ - DT_INST_NODE_HAS_PROP(n, transfer_delay), \ - DT_INST_PROP(n, transfer_delay)), \ - .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \ - .data_pin_config = DT_INST_ENUM_IDX(n, data_pin_config),\ - }; \ - \ - static struct spi_mcux_data spi_mcux_data_##n = { \ - SPI_CONTEXT_INIT_LOCK(spi_mcux_data_##n, ctx), \ - SPI_CONTEXT_INIT_SYNC(spi_mcux_data_##n, ctx), \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(n), ctx) \ - SPI_DMA_CHANNELS(n) \ - IF_ENABLED(CONFIG_SPI_RTIO, \ - (.rtio_ctx = &spi_mcux_rtio_##n,)) \ - \ - }; \ - \ - DEVICE_DT_INST_DEFINE(n, spi_mcux_init, NULL, \ - &spi_mcux_data_##n, \ - &spi_mcux_config_##n, POST_KERNEL, \ - CONFIG_SPI_INIT_PRIORITY, \ - &spi_mcux_driver_api); \ - \ - static void spi_mcux_config_func_##n(const struct device *dev) \ - { \ - SPI_MCUX_LPSPI_MODULE_IRQ(n); \ +#define SPI_MCUX_LPSPI_INIT(n) \ + PINCTRL_DT_INST_DEFINE(n); \ + COND_CODE_1(CONFIG_SPI_RTIO, (SPI_MCUX_RTIO_DEFINE(n)), ()); \ + \ + static void spi_mcux_config_func_##n(const struct device *dev); \ + \ + static const struct spi_mcux_config spi_mcux_config_##n = { \ + DEVICE_MMIO_NAMED_ROM_INIT(reg_base, DT_DRV_INST(n)), \ + PARENT_DEV(n).clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \ + .clock_subsys = (clock_control_subsys_t)DT_INST_CLOCKS_CELL(n, name), \ + .irq_config_func = spi_mcux_config_func_##n, \ + .pcs_sck_delay = UTIL_AND(DT_INST_NODE_HAS_PROP(n, pcs_sck_delay), \ + DT_INST_PROP(n, pcs_sck_delay)), \ + .sck_pcs_delay = UTIL_AND(DT_INST_NODE_HAS_PROP(n, sck_pcs_delay), \ + DT_INST_PROP(n, sck_pcs_delay)

Artifacts

Produced during runtime
Name Size
compliance.xml
2.41 KB