From dcc07a0575f4b76f3807452c63eaf29fdc4627e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 1 Aug 2011 11:31:31 +0800 Subject: [PATCH] sound: rk29: fix for v2.6.36 --- sound/soc/rk29/rk29_i2s.c | 10 +++++++++- sound/soc/rk29/rk29_pcm.c | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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; -- 2.34.1