diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-05-12 04:32:42 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-12 04:32:42 -0400 |
commit | 9fe17b5d47d3d3c85b35623dea8f571a184134c0 (patch) | |
tree | c2cb92b7f898a68b8cbb3adb8deee265b1f06684 /sound/core/pcm_native.c | |
parent | 6a45f7822544c54a2cf070d84f4e85f2fb32ec02 (diff) |
ALSA: pcm - Use pgprot_noncached() for MIPS non-coherent archs
MIPS non-coherent archs need the noncached pgprot in mmap of PCM buffers.
But, since the coherency needs to be checked dynamically via
plat_device_is_coherent(), we need an ugly check dependent on MIPS
in ALSA core code.
This should be cleaned up in MIPS arch side (e.g. creating
dma_mmap_coherent()) in near future.
Tested-by: Wu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 872887624030..20b5982c996b 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -36,6 +36,9 @@ | |||
36 | #include <sound/timer.h> | 36 | #include <sound/timer.h> |
37 | #include <sound/minors.h> | 37 | #include <sound/minors.h> |
38 | #include <asm/io.h> | 38 | #include <asm/io.h> |
39 | #if defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT) | ||
40 | #include <dma-coherence.h> | ||
41 | #endif | ||
39 | 42 | ||
40 | /* | 43 | /* |
41 | * Compatibility | 44 | * Compatibility |
@@ -3184,6 +3187,10 @@ static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, | |||
3184 | substream->runtime->dma_area, | 3187 | substream->runtime->dma_area, |
3185 | substream->runtime->dma_addr, | 3188 | substream->runtime->dma_addr, |
3186 | area->vm_end - area->vm_start); | 3189 | area->vm_end - area->vm_start); |
3190 | #elif defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT) | ||
3191 | if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV && | ||
3192 | !plat_device_is_coherent(substream->dma_buffer.dev.dev)) | ||
3193 | area->vm_page_prot = pgprot_noncached(area->vm_page_prot); | ||
3187 | #endif /* ARCH_HAS_DMA_MMAP_COHERENT */ | 3194 | #endif /* ARCH_HAS_DMA_MMAP_COHERENT */ |
3188 | /* mmap with fault handler */ | 3195 | /* mmap with fault handler */ |
3189 | area->vm_ops = &snd_pcm_vm_ops_data_fault; | 3196 | area->vm_ops = &snd_pcm_vm_ops_data_fault; |