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
This commit is contained in:
		@@ -105,10 +105,11 @@ static int jz4740_pcm_hw_params(struct snd_pcm_substream *substream,
 | 
				
			|||||||
	struct jz4740_pcm_config *config;
 | 
						struct jz4740_pcm_config *config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	config = rtd->dai->cpu_dai->dma_data;
 | 
						config = rtd->dai->cpu_dai->dma_data;
 | 
				
			||||||
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 | 
						if (!prtd->dma) {
 | 
				
			||||||
		prtd->dma = jz4740_dma_request(substream, "PCM Playback");
 | 
							if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 | 
				
			||||||
	} else {
 | 
								prtd->dma = jz4740_dma_request(substream, "PCM Playback");
 | 
				
			||||||
		prtd->dma = jz4740_dma_request(substream, "PCM Capture");
 | 
							else
 | 
				
			||||||
 | 
								prtd->dma = jz4740_dma_request(substream, "PCM Capture");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!prtd->dma)
 | 
						if (!prtd->dma)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user