diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-16 10:03:36 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-16 10:03:36 +0200 |
commit | d336905e00f208bcb89c719022c11dd3d976597a (patch) | |
tree | 6a5e3cf552231abe24df3cfae8f5d3884c7a1b4f /sound/soc/imx/imx-pcm-dma-mx2.c | |
parent | 0d0fb0f9c5fddef4a10242fe3337f00f528a3099 (diff) | |
parent | 8392609969b3b37a4da5cff08161661f7a8c16af (diff) | |
download | linux-d336905e00f208bcb89c719022c11dd3d976597a.tar.gz linux-d336905e00f208bcb89c719022c11dd3d976597a.tar.bz2 linux-d336905e00f208bcb89c719022c11dd3d976597a.zip |
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound/soc/imx/imx-pcm-dma-mx2.c')
-rw-r--r-- | sound/soc/imx/imx-pcm-dma-mx2.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 2e79d7136298..2b31ac673ea4 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -71,7 +71,12 @@ static void imx_ssi_dma_callback(int channel, void *data) static void snd_imx_dma_err_callback(int channel, void *data, int err) { - pr_err("DMA error callback called\n"); + struct snd_pcm_substream *substream = data; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct imx_pcm_dma_params *dma_params = rtd->dai->cpu_dai->dma_data; + struct snd_pcm_runtime *runtime = substream->runtime; + struct imx_pcm_runtime_data *iprtd = runtime->private_data; + int ret; pr_err("DMA timeout on channel %d -%s%s%s%s\n", channel, @@ -79,6 +84,14 @@ static void snd_imx_dma_err_callback(int channel, void *data, int err) err & IMX_DMA_ERR_REQUEST ? " request" : "", err & IMX_DMA_ERR_TRANSFER ? " transfer" : "", err & IMX_DMA_ERR_BUFFER ? " buffer" : ""); + + imx_dma_disable(iprtd->dma); + ret = imx_dma_setup_sg(iprtd->dma, iprtd->sg_list, iprtd->sg_count, + IMX_DMA_LENGTH_LOOP, dma_params->dma_addr, + substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + DMA_MODE_WRITE : DMA_MODE_READ); + if (!ret) + imx_dma_enable(iprtd->dma); } static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream) |