summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-03-22 15:22:26 +0000
committerLars-Peter Clausen <lars@metafoo.de>2010-03-22 15:22:26 +0000
commitfd3344d4881b33c108bccc22a3eb8623adcb8008 (patch)
tree555b9191d87fb486b9a28cee26ed46fedc63cd54
parentf4bcf74b954d9c51c745b228adbb933ea051e516 (diff)
downloadmtk-20170518-fd3344d4881b33c108bccc22a3eb8623adcb8008.zip
mtk-20170518-fd3344d4881b33c108bccc22a3eb8623adcb8008.tar.gz
mtk-20170518-fd3344d4881b33c108bccc22a3eb8623adcb8008.tar.bz2
sound jz4740_pcm: Don't request dma channel mor then once.
It is possible that the hw_params callback is called multiple times when using the oss emulation layer. Thus we need to check whether the dma channel has already been requested otherwise we'll end up with all dma channels being requested by sound driver. SVN-Revision: 20369
-rw-r--r--target/linux/xburst/files-2.6.32/sound/soc/jz4740/jz4740-pcm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/target/linux/xburst/files-2.6.32/sound/soc/jz4740/jz4740-pcm.c b/target/linux/xburst/files-2.6.32/sound/soc/jz4740/jz4740-pcm.c
index c71c5b4..4a4de19 100644
--- a/target/linux/xburst/files-2.6.32/sound/soc/jz4740/jz4740-pcm.c
+++ b/target/linux/xburst/files-2.6.32/sound/soc/jz4740/jz4740-pcm.c
@@ -105,10 +105,11 @@ static int jz4740_pcm_hw_params(struct snd_pcm_substream *substream,
struct jz4740_pcm_config *config;
config = rtd->dai->cpu_dai->dma_data;
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- prtd->dma = jz4740_dma_request(substream, "PCM Playback");
- } else {
- prtd->dma = jz4740_dma_request(substream, "PCM Capture");
+ if (!prtd->dma) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ prtd->dma = jz4740_dma_request(substream, "PCM Playback");
+ else
+ prtd->dma = jz4740_dma_request(substream, "PCM Capture");
}
if (!prtd->dma)