aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-04-08 05:31:25 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-08 10:21:01 -0400
commit671999cb5d8817611f865f3877f5a5b81372f61e (patch)
tree5828042f09371d758211ecdea9a79031782be776
parent206b60e189c7cc2b4675687d66f167299a13a4d4 (diff)
ASoC: imx-pcm-dma-mx2: restart DMA after an error
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-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)