Skip to content

Commit

Permalink
Merge branch 'topic/stm' into for-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodkoul committed Oct 24, 2018
2 parents 4b4447b + cc832dc commit 71f021c
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions drivers/dma/stm32-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,20 +308,12 @@ static bool stm32_dma_fifo_threshold_is_allowed(u32 burst, u32 threshold,

static bool stm32_dma_is_burst_possible(u32 buf_len, u32 threshold)
{
switch (threshold) {
case STM32_DMA_FIFO_THRESHOLD_FULL:
if (buf_len >= STM32_DMA_MAX_BURST)
return true;
else
return false;
case STM32_DMA_FIFO_THRESHOLD_HALFFULL:
if (buf_len >= STM32_DMA_MAX_BURST / 2)
return true;
else
return false;
default:
return false;
}
/*
* Buffer or period length has to be aligned on FIFO depth.
* Otherwise bytes may be stuck within FIFO at buffer or period
* length.
*/
return ((buf_len % ((threshold + 1) * 4)) == 0);
}

static u32 stm32_dma_get_best_burst(u32 buf_len, u32 max_burst, u32 threshold,
Expand Down

0 comments on commit 71f021c

Please sign in to comment.