From: 黄涛 Date: Mon, 1 Aug 2011 03:31:31 +0000 (+0800) Subject: sound: rk29: fix for v2.6.36 X-Git-Tag: firefly_0821_release~9782 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dcc07a0575f4b76f3807452c63eaf29fdc4627e6;p=firefly-linux-kernel-4.4.55.git sound: rk29: fix for v2.6.36 --- diff --git a/sound/soc/rk29/rk29_i2s.c b/sound/soc/rk29/rk29_i2s.c index 358eb57b89db..087df82984ab 100755 --- a/sound/soc/rk29/rk29_i2s.c +++ b/sound/soc/rk29/rk29_i2s.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -280,11 +281,18 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, { return 0; } - + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + dai->cpu_dai->playback.dma_data = i2s->dma_playback; + else + dai->cpu_dai->capture.dma_data = i2s->dma_capture; +#else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) dai->cpu_dai->dma_data = i2s->dma_playback; else dai->cpu_dai->dma_data = i2s->dma_capture; +#endif /* Working copies of register */ iismod = readl(&(pheadi2s->I2S_TXCR)); diff --git a/sound/soc/rk29/rk29_pcm.c b/sound/soc/rk29/rk29_pcm.c index 066eaa1ad50f..aebeb39267ea 100755 --- a/sound/soc/rk29/rk29_pcm.c +++ b/sound/soc/rk29/rk29_pcm.c @@ -296,7 +296,11 @@ static int rockchip_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; struct rockchip_runtime_data *prtd = runtime->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) + struct rockchip_pcm_dma_params *dma = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); +#else struct rockchip_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; +#endif unsigned long totbytes = params_buffer_bytes(params); int ret = 0;