diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-09-28 17:12:59 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-28 17:15:14 +0200 |
commit | 18a2b9623370479d1646b9b94e3528683f3b74de (patch) | |
tree | 8dc90994f1cdccb6b516ae4f71a299c8fea0fed7 | |
parent | a597310331177cd3969f840a9a6290e3c212e4cf (diff) | |
download | op-kernel-dev-18a2b9623370479d1646b9b94e3528683f3b74de.zip op-kernel-dev-18a2b9623370479d1646b9b94e3528683f3b74de.tar.gz |
ALSA: pcm - Export snd_pcm_lib_default_mmap() helper
Export the default mmap function, snd_pcm_lib_default_mmap().
The upcoming non-snooping support in HD-audio driver will use this
to override the mmap method.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | include/sound/pcm.h | 2 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 57e71fa..249d988 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -1035,6 +1035,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) atomic_dec(&substream->mmap_count); } +int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *area); /* mmap for io-memory area */ #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 1c6be91..b4bf4a4 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -3156,8 +3156,8 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { /* * mmap the DMA buffer on RAM */ -static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, - struct vm_area_struct *area) +int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *area) { area->vm_flags |= VM_RESERVED; #ifdef ARCH_HAS_DMA_MMAP_COHERENT @@ -3177,6 +3177,7 @@ static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, area->vm_ops = &snd_pcm_vm_ops_data_fault; return 0; } +EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap); /* * mmap the DMA buffer on I/O memory area @@ -3242,7 +3243,7 @@ int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, if (substream->ops->mmap) err = substream->ops->mmap(substream, area); else - err = snd_pcm_default_mmap(substream, area); + err = snd_pcm_lib_default_mmap(substream, area); if (!err) atomic_inc(&substream->mmap_count); return err; |