audio:解决录音时内存mmap出错,将原有的DMA方式修改成SDRM方式
authorwdc <wdc@rock-chips.com>
Sat, 20 Oct 2012 09:12:38 +0000 (17:12 +0800)
committerwdc <wdc@rock-chips.com>
Sat, 20 Oct 2012 09:12:38 +0000 (17:12 +0800)
[modified-files]
sound/soc/rk29/rk29_pcm.c

sound/soc/rk29/rk29_pcm.c

index 602e53c757b2d7d4f7dba8647eca1d60b8779806..072aeb713360b6dd7068f03fc3d42ecacdb65280 100755 (executable)
@@ -467,12 +467,19 @@ static int rockchip_pcm_mmap(struct snd_pcm_substream *substream,
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
 
-       DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+   DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
 
+#ifdef CONFIG_RK_SRAM_DMA
+       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+        return remap_pfn_range(vma, vma->vm_start,
+                      substream->dma_buffer.addr >> PAGE_SHIFT,
+                      vma->vm_end - vma->vm_start, vma->vm_page_prot);
+#else
        return dma_mmap_writecombine(substream->pcm->card->dev, vma,
                                     runtime->dma_area,
                                     runtime->dma_addr,
                                     runtime->dma_bytes);
+#endif
 }
 
 static struct snd_pcm_ops rockchip_pcm_ops = {