diff options
author | lars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-03-22 15:22:26 +0000 |
---|---|---|
committer | lars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-03-22 15:22:26 +0000 |
commit | 124c6d16d7692446d6ff6bbae6f10f32eafcc66e (patch) | |
tree | d09ed6a7570969f58376082a64bbbfd0808c9a0a /target/linux/xburst | |
parent | a62005234bdbcbc729a2c23b49974174ec12e8c3 (diff) |
[xburst] 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.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20369 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/xburst')
-rw-r--r-- | target/linux/xburst/files-2.6.32/sound/soc/jz4740/jz4740-pcm.c | 9 |
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 c71c5b48b..4a4de195a 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) |