diff options
author | Vinod Koul <vkoul@kernel.org> | 2018-10-24 04:16:33 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-10-24 04:16:33 -0400 |
commit | 71f021cf6de822ac49a790509683fbb4a06ce4bf (patch) | |
tree | 5a8b32252f76c53915f4196ec8d0e468079e0d4a | |
parent | 4b4447bfadd0e12aa975c45d953ef6c34eb2e5cd (diff) | |
parent | cc832dc8e32785a730ba07c3a357e17c201a5df8 (diff) |
Merge branch 'topic/stm' into for-linus
-rw-r--r-- | drivers/dma/stm32-dma.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 379e8d534e61..4903a408fc14 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c | |||
@@ -308,20 +308,12 @@ static bool stm32_dma_fifo_threshold_is_allowed(u32 burst, u32 threshold, | |||
308 | 308 | ||
309 | static bool stm32_dma_is_burst_possible(u32 buf_len, u32 threshold) | 309 | static bool stm32_dma_is_burst_possible(u32 buf_len, u32 threshold) |
310 | { | 310 | { |
311 | switch (threshold) { | 311 | /* |
312 | case STM32_DMA_FIFO_THRESHOLD_FULL: | 312 | * Buffer or period length has to be aligned on FIFO depth. |
313 | if (buf_len >= STM32_DMA_MAX_BURST) | 313 | * Otherwise bytes may be stuck within FIFO at buffer or period |
314 | return true; | 314 | * length. |
315 | else | 315 | */ |
316 | return false; | 316 | return ((buf_len % ((threshold + 1) * 4)) == 0); |
317 | case STM32_DMA_FIFO_THRESHOLD_HALFFULL: | ||
318 | if (buf_len >= STM32_DMA_MAX_BURST / 2) | ||
319 | return true; | ||
320 | else | ||
321 | return false; | ||
322 | default: | ||
323 | return false; | ||
324 | } | ||
325 | } | 317 | } |
326 | 318 | ||
327 | static u32 stm32_dma_get_best_burst(u32 buf_len, u32 max_burst, u32 threshold, | 319 | static u32 stm32_dma_get_best_burst(u32 buf_len, u32 max_burst, u32 threshold, |