On Wed, Apr 17, 2013 at 04:43:06PM +0800, Shawn Guo wrote:
On Mon, Apr 15, 2013 at 07:19:57PM +0200, Lars-Peter Clausen wrote:
Use the generic dmaengine PCM driver instead of a custom implementation.
Signed-off-by: Lars-Peter Clausen lars@metafoo.de
sound/soc/mxs/Kconfig | 2 +- sound/soc/mxs/mxs-pcm.c | 135 ++++-------------------------------------------- 2 files changed, 11 insertions(+), 126 deletions(-)
After applying the patch, mxs audio is broken as below.
[ 2.003200] mxs-saif 80042000.saif: Missing dma channel for stream: 1 [ 2.010220] mmc0: new high speed SDHC card at address e624 [ 2.016453] mxs-saif 80042000.saif: ASoC: pcm constructor failed: -22 [ 2.022964] mxs-sgtl5000 sound.12: ASoC: can't create pcm HiFi Playback :-22 [ 2.030310] mxs-sgtl5000 sound.12: ASoC: failed to instantiate card -22
It's caused by that dmaengine_pcm_new() will call dmaengine_pcm_compat_request_channel() twice to request the same mxs-dma channel, and the second call will fail.
For purpose of debugging, the mxs audio can just work as before with the changes below.
Shawn
diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index ae0c37e..7d41fdd 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -148,6 +148,9 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!substream) continue;
+ if (i == SNDRV_PCM_STREAM_CAPTURE) + pcm->chan[i] = pcm->chan[SNDRV_PCM_STREAM_PLAYBACK]; + if (!pcm->chan[i] && pcm->compat) { pcm->chan[i] = dmaengine_pcm_compat_request_channel(rtd, substream);