diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2012-06-03 21:17:24 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-06-07 04:18:42 -0400 |
commit | 8e2e27c7444ba7880aa0a4cb07a79de130d0ed93 (patch) | |
tree | 085658546fe857444d2b629d5970e71e669ac2fe /drivers/dma | |
parent | 30c1dc0ff30b5552e8af555265dbeac5637cbb48 (diff) |
dma: imx-sdma: buf_tail should be initialize in prepare function
This fix audio underrun issue. When SNDRV_PCM_TRIGGER_STOP
and SNDRV_PCM_TRIGGER_START, it calls prepare again. buf_tail
should be reset to zero.
So move buf_tail initialization into prepare function.
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/imx-sdma.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index fb4f4990f5eb..1dc2a4ad0026 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -815,8 +815,6 @@ static int sdma_request_channel(struct sdma_channel *sdmac) | |||
815 | 815 | ||
816 | init_completion(&sdmac->done); | 816 | init_completion(&sdmac->done); |
817 | 817 | ||
818 | sdmac->buf_tail = 0; | ||
819 | |||
820 | return 0; | 818 | return 0; |
821 | out: | 819 | out: |
822 | 820 | ||
@@ -927,6 +925,8 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( | |||
927 | 925 | ||
928 | sdmac->flags = 0; | 926 | sdmac->flags = 0; |
929 | 927 | ||
928 | sdmac->buf_tail = 0; | ||
929 | |||
930 | dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n", | 930 | dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n", |
931 | sg_len, channel); | 931 | sg_len, channel); |
932 | 932 | ||
@@ -1027,6 +1027,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( | |||
1027 | 1027 | ||
1028 | sdmac->status = DMA_IN_PROGRESS; | 1028 | sdmac->status = DMA_IN_PROGRESS; |
1029 | 1029 | ||
1030 | sdmac->buf_tail = 0; | ||
1031 | |||
1030 | sdmac->flags |= IMX_DMA_SG_LOOP; | 1032 | sdmac->flags |= IMX_DMA_SG_LOOP; |
1031 | sdmac->direction = direction; | 1033 | sdmac->direction = direction; |
1032 | ret = sdma_load_context(sdmac); | 1034 | ret = sdma_load_context(sdmac); |