From 62677aff497134169940c5542d83e3041042c543 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 14 Apr 2014 14:58:05 +0800 Subject: MLK-11429-8: ASoC: dmaengine: Add two function for dmaengine_pcm cherry-pick below patch from imx_3.14.y ENGR00307835-2 ASoC: dmaengine: Add two function for dmaengine_pcm Add check_xrun and device_reset for dmaengine_pcm Signed-off-by: Shengjiu Wang (cherry picked from commit 405588f31e432e5c6634a0817e4d804ead87882b) --- sound/core/pcm_dmaengine.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'sound/core') diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index 8eb58c709b14..99abc917427f 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -5,6 +5,7 @@ * Based on: * imx-pcm-dma-mx2.c, Copyright 2009 Sascha Hauer * mxs-pcm.c, Copyright (C) 2011 Freescale Semiconductor, Inc. + * imx-pcm-dma.c, Copyright (C) 2014-2015 Freescale Semiconductor, Inc. * ep93xx-pcm.c, Copyright (C) 2006 Lennert Buytenhek * Copyright (C) 2006 Applied Data Systems * @@ -28,13 +29,6 @@ #include -struct dmaengine_pcm_runtime_data { - struct dma_chan *dma_chan; - dma_cookie_t cookie; - - unsigned int pos; -}; - static inline struct dmaengine_pcm_runtime_data *substream_to_prtd( const struct snd_pcm_substream *substream) { @@ -171,7 +165,10 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream) if (!desc) return -ENOMEM; - desc->callback = dmaengine_pcm_dma_complete; + if (prtd->callback) + desc->callback = prtd->callback; + else + desc->callback = dmaengine_pcm_dma_complete; desc->callback_param = substream; prtd->cookie = dmaengine_submit(desc); -- cgit v1.2.3