From: wdc Date: Sat, 20 Oct 2012 09:12:38 +0000 (+0800) Subject: audio:解决录音时内存mmap出错,将原有的DMA方式修改成SDRM方式 X-Git-Tag: firefly_0821_release~8353 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0cde7717dbebd1a557f21fb69db95a9b862154f1;p=firefly-linux-kernel-4.4.55.git audio:解决录音时内存mmap出错,将原有的DMA方式修改成SDRM方式 [modified-files] sound/soc/rk29/rk29_pcm.c --- diff --git a/sound/soc/rk29/rk29_pcm.c b/sound/soc/rk29/rk29_pcm.c index 602e53c757b2..072aeb713360 100755 --- a/sound/soc/rk29/rk29_pcm.c +++ b/sound/soc/rk29/rk29_pcm.c @@ -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 = {