Commit 9da65a99 authored by Santosh Shilimkar's avatar Santosh Shilimkar Committed by Tony Lindgren

omap: SDMA: Fix omap_stop_dma() API for channel linking

OMAP sDMA driver API omap_stop_dma() doesn't really stop the dma when used
in linking scenario.

The DMA channel needs to be disabled before resetting the chain.
Also fix clearing of the OMAP_DMA_ACTIVE status in the linked case.

Cc: Hari n <hari.zoom@gmail.com>
Cc: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: default avatarVenkatraman S <svenkatr@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6135434a
...@@ -978,6 +978,14 @@ void omap_stop_dma(int lch) ...@@ -978,6 +978,14 @@ void omap_stop_dma(int lch)
{ {
u32 l; u32 l;
/* Disable all interrupts on the channel */
if (cpu_class_is_omap1())
dma_write(0, CICR(lch));
l = dma_read(CCR(lch));
l &= ~OMAP_DMA_CCR_EN;
dma_write(l, CCR(lch));
if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) { if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
int next_lch, cur_lch = lch; int next_lch, cur_lch = lch;
char dma_chan_link_map[OMAP_DMA4_LOGICAL_DMA_CH_COUNT]; char dma_chan_link_map[OMAP_DMA4_LOGICAL_DMA_CH_COUNT];
...@@ -995,18 +1003,8 @@ void omap_stop_dma(int lch) ...@@ -995,18 +1003,8 @@ void omap_stop_dma(int lch)
next_lch = dma_chan[cur_lch].next_lch; next_lch = dma_chan[cur_lch].next_lch;
cur_lch = next_lch; cur_lch = next_lch;
} while (next_lch != -1); } while (next_lch != -1);
return;
} }
/* Disable all interrupts on the channel */
if (cpu_class_is_omap1())
dma_write(0, CICR(lch));
l = dma_read(CCR(lch));
l &= ~OMAP_DMA_CCR_EN;
dma_write(l, CCR(lch));
dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE; dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
} }
EXPORT_SYMBOL(omap_stop_dma); EXPORT_SYMBOL(omap_stop_dma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment