Skip to content

Commit addf568

Browse files
mjchen0fabiobaltieri
authored andcommitted
drivers: spi_mcux_flexcomm: remove DMA block complete callbacks
For every TX, the driver used to get both callbacks when each block was trasnfered and when the entire DMA was complete. The callback for each block isn't needed so remove it and reduce intermediate interrupts (the more blocks in the DMA link, the more needless intermediate interrupts we now no longer get). Signed-off-by: Mike J. Chen <[email protected]>
1 parent 3ae98de commit addf568

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/spi/spi_mcux_flexcomm.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct stream {
6161
uint32_t channel; /* stores the channel for dma */
6262
struct dma_config dma_cfg;
6363
struct dma_block_config dma_blk_cfg[CONFIG_SPI_MCUX_FLEXCOMM_DMA_MAX_BLOCKS];
64-
int wait_for_dma_status;
6564
};
6665
#endif
6766

@@ -330,9 +329,6 @@ static void spi_mcux_dma_callback(const struct device *dev, void *arg,
330329
} else {
331330
/* identify the origin of this callback */
332331
if (channel == data->dma_tx.channel) {
333-
if (status != data->dma_tx.wait_for_dma_status) {
334-
return;
335-
}
336332
/* this part of the transfer ends */
337333
data->status_flags |= SPI_MCUX_FLEXCOMM_DMA_TX_DONE_FLAG;
338334
} else if (channel == data->dma_rx.channel) {
@@ -409,7 +405,6 @@ static int spi_mcux_dma_tx_load(const struct device *dev, const struct spi_confi
409405
blk_cfg->source_addr_adj = DMA_ADDR_ADJ_NO_CHANGE;
410406
blk_cfg->block_size = sizeof(uint32_t);
411407
blk_cfg->next_block = NULL;
412-
data->dma_tx.wait_for_dma_status = DMA_STATUS_COMPLETE;
413408
} else {
414409
blk_cfg->block_size = len;
415410
blk_cfg->next_block = blk_cfg + 1;
@@ -421,7 +416,6 @@ static int spi_mcux_dma_tx_load(const struct device *dev, const struct spi_confi
421416
blk_cfg->source_address = (uint32_t)&data->dummy_tx_buffer;
422417
blk_cfg->source_addr_adj = DMA_ADDR_ADJ_NO_CHANGE;
423418
}
424-
data->dma_tx.wait_for_dma_status = DMA_STATUS_BLOCK;
425419
}
426420
return EXIT_SUCCESS;
427421
}
@@ -917,7 +911,6 @@ static DEVICE_API(spi, spi_mcux_driver_api) = {
917911
.dma_cfg = { \
918912
.channel_direction = LPC_DMA_SPI_MCUX_FLEXCOMM_TX, \
919913
.dma_callback = spi_mcux_dma_callback, \
920-
.complete_callback_en = true, \
921914
.block_count = 2, \
922915
} \
923916
}, \

0 commit comments

Comments
 (0)