aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-22 06:01:13 -0400
committerTakashi Iwai <tiwai@suse.de>2014-10-22 06:01:13 -0400
commitc37de55efa1ccf018c27b876560725ff5e9f5701 (patch)
tree9889ff7cf9755e1184be0c01e4b20b0669de3346 /sound/core
parentb46882b6eb713245916100ac5b58664cd242a08d (diff)
ALSA: pcm: Remove arch-dependent mmap kludges
Since we have consistently dma_mmap_coherent() for all architectures, the current ifdef and arch-specific codes in pcm core can be cleaned up gracefully. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_native.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 815396d8427f..aa6754da7929 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -35,9 +35,6 @@
35#include <sound/timer.h> 35#include <sound/timer.h>
36#include <sound/minors.h> 36#include <sound/minors.h>
37#include <asm/io.h> 37#include <asm/io.h>
38#if defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT)
39#include <dma-coherence.h>
40#endif
41 38
42/* 39/*
43 * Compatibility 40 * Compatibility
@@ -3251,20 +3248,6 @@ static inline struct page *
3251snd_pcm_default_page_ops(struct snd_pcm_substream *substream, unsigned long ofs) 3248snd_pcm_default_page_ops(struct snd_pcm_substream *substream, unsigned long ofs)
3252{ 3249{
3253 void *vaddr = substream->runtime->dma_area + ofs; 3250 void *vaddr = substream->runtime->dma_area + ofs;
3254#if defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT)
3255 if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
3256 return virt_to_page(CAC_ADDR(vaddr));
3257#endif
3258#if defined(CONFIG_PPC32) && defined(CONFIG_NOT_COHERENT_CACHE)
3259 if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) {
3260 dma_addr_t addr = substream->runtime->dma_addr + ofs;
3261 addr -= get_dma_offset(substream->dma_buffer.dev.dev);
3262 /* assume dma_handle set via pfn_to_phys() in
3263 * mm/dma-noncoherent.c
3264 */
3265 return pfn_to_page(addr >> PAGE_SHIFT);
3266 }
3267#endif
3268 return virt_to_page(vaddr); 3251 return virt_to_page(vaddr);
3269} 3252}
3270 3253
@@ -3309,13 +3292,6 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = {
3309 .fault = snd_pcm_mmap_data_fault, 3292 .fault = snd_pcm_mmap_data_fault,
3310}; 3293};
3311 3294
3312#ifndef ARCH_HAS_DMA_MMAP_COHERENT
3313/* This should be defined / handled globally! */
3314#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
3315#define ARCH_HAS_DMA_MMAP_COHERENT
3316#endif
3317#endif
3318
3319/* 3295/*
3320 * mmap the DMA buffer on RAM 3296 * mmap the DMA buffer on RAM
3321 */ 3297 */
@@ -3331,7 +3307,6 @@ int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
3331 area->vm_end - area->vm_start, area->vm_page_prot); 3307 area->vm_end - area->vm_start, area->vm_page_prot);
3332 } 3308 }
3333#endif /* CONFIG_GENERIC_ALLOCATOR */ 3309#endif /* CONFIG_GENERIC_ALLOCATOR */
3334#ifdef ARCH_HAS_DMA_MMAP_COHERENT
3335 if (!substream->ops->page && 3310 if (!substream->ops->page &&
3336 substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) 3311 substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
3337 return dma_mmap_coherent(substream->dma_buffer.dev.dev, 3312 return dma_mmap_coherent(substream->dma_buffer.dev.dev,
@@ -3339,11 +3314,6 @@ int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
3339 substream->runtime->dma_area, 3314 substream->runtime->dma_area,
3340 substream->runtime->dma_addr, 3315 substream->runtime->dma_addr,
3341 area->vm_end - area->vm_start); 3316 area->vm_end - area->vm_start);
3342#elif defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT)
3343 if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV &&
3344 !plat_device_is_coherent(substream->dma_buffer.dev.dev))
3345 area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
3346#endif /* ARCH_HAS_DMA_MMAP_COHERENT */
3347 /* mmap with fault handler */ 3317 /* mmap with fault handler */
3348 area->vm_ops = &snd_pcm_vm_ops_data_fault; 3318 area->vm_ops = &snd_pcm_vm_ops_data_fault;
3349 return 0; 3319 return 0;