mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
I2S: add i2s use DMA event mode choose,default use static mode
This commit is contained in:
12
sound/soc/rk29/Kconfig
Normal file → Executable file
12
sound/soc/rk29/Kconfig
Normal file → Executable file
@@ -22,6 +22,18 @@ config SND_RK29_SOC_I2S_8CH
|
||||
depends on SND_RK29_SOC_I2S
|
||||
help
|
||||
This supports the use of the 8 Channel I2S interface on rk29 processors.
|
||||
|
||||
if SND_RK29_SOC_I2S_2CH || SND_RK29_SOC_I2S_8CH
|
||||
choice
|
||||
bool "Set i2s on DMA event mode"
|
||||
default SND_I2S_DMA_EVENT_STATIC
|
||||
config SND_I2S_DMA_EVENT_DYNAMIC
|
||||
tristate "dynamic mode"
|
||||
|
||||
config SND_I2S_DMA_EVENT_STATIC
|
||||
tristate "static mode"
|
||||
endchoice
|
||||
endif
|
||||
|
||||
config SND_RK29_SOC_WM8988
|
||||
tristate "SoC I2S Audio support for rockchip - WM8988"
|
||||
|
||||
@@ -662,8 +662,10 @@ static int __devinit rockchip_i2s_probe(struct platform_device *pdev)
|
||||
i2s->dma_playback->client = &rk29_dma_client_out;
|
||||
i2s->dma_playback->dma_size = 4;
|
||||
i2s->dma_playback->flag = 0; //add by sxj, used for burst change
|
||||
|
||||
|
||||
#ifdef CONFIG_SND_I2S_DMA_EVENT_STATIC
|
||||
WARN_ON(rk29_dma_request(i2s->dma_playback->channel, i2s->dma_playback->client, NULL));
|
||||
WARN_ON(rk29_dma_request(i2s->dma_capture->channel, i2s->dma_capture->client, NULL));
|
||||
#endif
|
||||
i2s->iis_clk = clk_get(&pdev->dev, "i2s");
|
||||
I2S_DBG("Enter:%s, %d, iis_clk=%d\n", __FUNCTION__, __LINE__, i2s->iis_clk);
|
||||
if (IS_ERR(i2s->iis_clk)) {
|
||||
|
||||
@@ -292,6 +292,11 @@ void rk29_audio_buffdone(void *dev_id, int size,
|
||||
unsigned long flags;
|
||||
|
||||
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
|
||||
|
||||
if (!substream)
|
||||
return;
|
||||
if (!substream->runtime)
|
||||
return;
|
||||
|
||||
prtd = substream->runtime->private_data;
|
||||
DBG("Enter::%s----%d, substream=0x%08X, prtd=0x%08X\n",__FUNCTION__,__LINE__, substream, prtd);
|
||||
@@ -337,7 +342,7 @@ static int rockchip_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
if (prtd->params == NULL) {
|
||||
/* prepare DMA */
|
||||
prtd->params = dma;
|
||||
|
||||
#ifdef CONFIG_SND_I2S_DMA_EVENT_DYNAMIC
|
||||
DBG("params %p, client %p, channel %d\n", prtd->params,
|
||||
prtd->params->client, prtd->params->channel);
|
||||
|
||||
@@ -356,7 +361,7 @@ static int rockchip_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
DBG(KERN_ERR "failed to get dma channel\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
rk29_dma_set_buffdone_fn(prtd->params->channel, rk29_audio_buffdone);
|
||||
@@ -389,9 +394,11 @@ static int rockchip_pcm_hw_free(struct snd_pcm_substream *substream)
|
||||
snd_pcm_set_runtime_buffer(substream, NULL);
|
||||
|
||||
if (prtd->params) {
|
||||
#ifdef CONFIG_SND_I2S_DMA_EVENT_DYNAMIC
|
||||
//free_dma(prtd->params->channel);
|
||||
rk29_dma_free(prtd->params->channel, prtd->params->client);
|
||||
prtd->params = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user