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