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"
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)) {
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);
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);
DBG(KERN_ERR "failed to get dma channel\n");
return ret;
}
-
+#endif
}
rk29_dma_set_buffdone_fn(prtd->params->channel, rk29_audio_buffdone);
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;