aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/imx/imx-pcm-dma-mx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/imx/imx-pcm-dma-mx2.c')
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c15
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)
71 71
72static void snd_imx_dma_err_callback(int channel, void *data, int err) 72static void snd_imx_dma_err_callback(int channel, void *data, int err)
73{ 73{
74 pr_err("DMA error callback called\n"); 74 struct snd_pcm_substream *substream = data;
75 struct snd_soc_pcm_runtime *rtd = substream->private_data;
76 struct imx_pcm_dma_params *dma_params = rtd->dai->cpu_dai->dma_data;
77 struct snd_pcm_runtime *runtime = substream->runtime;
78 struct imx_pcm_runtime_data *iprtd = runtime->private_data;
79 int ret;
75 80
76 pr_err("DMA timeout on channel %d -%s%s%s%s\n", 81 pr_err("DMA timeout on channel %d -%s%s%s%s\n",
77 channel, 82 channel,
@@ -79,6 +84,14 @@ static void snd_imx_dma_err_callback(int channel, void *data, int err)
79 err & IMX_DMA_ERR_REQUEST ? " request" : "", 84 err & IMX_DMA_ERR_REQUEST ? " request" : "",
80 err & IMX_DMA_ERR_TRANSFER ? " transfer" : "", 85 err & IMX_DMA_ERR_TRANSFER ? " transfer" : "",
81 err & IMX_DMA_ERR_BUFFER ? " buffer" : ""); 86 err & IMX_DMA_ERR_BUFFER ? " buffer" : "");
87
88 imx_dma_disable(iprtd->dma);
89 ret = imx_dma_setup_sg(iprtd->dma, iprtd->sg_list, iprtd->sg_count,
90 IMX_DMA_LENGTH_LOOP, dma_params->dma_addr,
91 substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
92 DMA_MODE_WRITE : DMA_MODE_READ);
93 if (!ret)
94 imx_dma_enable(iprtd->dma);
82} 95}
83 96
84static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream) 97static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream)