sound: rk29: fix for v2.6.36
author黄涛 <huangtao@rock-chips.com>
Mon, 1 Aug 2011 03:31:31 +0000 (11:31 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 1 Aug 2011 03:31:31 +0000 (11:31 +0800)
sound/soc/rk29/rk29_i2s.c
sound/soc/rk29/rk29_pcm.c

index 358eb57b89db6221b66c3791ba946f2f6983765a..087df82984aba0c220cfd2729da9a0f0ac46d654 100755 (executable)
@@ -17,6 +17,7 @@
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/clk.h>
+#include <linux/version.h>
 
 #include <asm/dma.h>
 #include <sound/core.h>
@@ -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));
index 066eaa1ad50f70147c1530f4193ebae341accab3..aebeb39267ea3a5634aac340ab8ba1681878301e 100755 (executable)
@@ -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;