mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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>
This commit is contained in:
parent
206b60e189
commit
671999cb5d
1 changed files with 14 additions and 1 deletions
|
@ -70,7 +70,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,
|
||||
|
@ -78,6 +83,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)
|
||||
|
|
Loading…
Reference in a new issue