Skip to content

Commit 40962a8

Browse files
cybertalegalak
authored andcommitted
drivers: dma: stm32: add missing fifo operation
The DMA driver of stm32 used to use `stm32_dma_enable_fifo()`, which is located in dma_stm32_v1.c to set DMDIS bit, enable interrupt generation and set FIFO threshold. Now since FIFO threshold is initialized with `stm32_dma_get_fifo_threshold()` and interrupt generation is also configured in dma_stm32.c, this function will only have one job, to configure FIFO mode. We can add FIFO mode operation in dma_stm32.c directly and remove it from dma_stm32_v1.c. Signed-off-by: Song Qiang <[email protected]>
1 parent 065a2cb commit 40962a8

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

drivers/dma/dma_stm32.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,10 @@ static int dma_stm32_configure(struct device *dev, u32_t id,
403403

404404
#if defined(CONFIG_DMA_STM32_V1)
405405
if (DMA_InitStruct.FIFOMode == LL_DMA_FIFOMODE_ENABLE) {
406+
LL_DMA_EnableFifoMode(dma, table_ll_stream[id]);
406407
LL_DMA_EnableIT_FE(dma, table_ll_stream[id]);
407408
} else {
409+
LL_DMA_DisableFifoMode(dma, table_ll_stream[id]);
408410
LL_DMA_DisableIT_FE(dma, table_ll_stream[id]);
409411
}
410412
#endif

drivers/dma/dma_stm32.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ bool stm32_dma_is_irq_happened(DMA_TypeDef *dma, u32_t id);
2222
bool stm32_dma_is_unexpected_irq_happened(DMA_TypeDef *dma, u32_t id);
2323
void stm32_dma_enable_stream(DMA_TypeDef *dma, u32_t id);
2424
int stm32_dma_disable_stream(DMA_TypeDef *dma, u32_t id);
25-
void stm32_dma_enable_fifo(DMA_TypeDef *dma, u32_t id);
2625
void stm32_dma_config_channel_function(DMA_TypeDef *dma, u32_t id, u32_t slot);
2726
#ifdef CONFIG_DMA_STM32_V1
2827
void stm32_dma_disable_fifo_irq(DMA_TypeDef *dma, u32_t id);

drivers/dma/dma_stm32_v1.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,6 @@ int stm32_dma_disable_stream(DMA_TypeDef *dma, u32_t id)
205205
return -EAGAIN;
206206
}
207207

208-
void stm32_dma_enable_fifo(DMA_TypeDef *dma, u32_t id)
209-
{
210-
LL_DMA_EnableFifoMode(dma, table_ll_stream[id]);
211-
LL_DMA_EnableIT_FE(dma, table_ll_stream[id]);
212-
LL_DMA_SetFIFOThreshold(dma, table_ll_stream[id],
213-
LL_DMA_FIFOTHRESHOLD_FULL);
214-
}
215-
216208
void stm32_dma_disable_fifo_irq(DMA_TypeDef *dma, u32_t id)
217209
{
218210
LL_DMA_DisableIT_FE(dma, table_ll_stream[id]);

0 commit comments

Comments
 (0)