Commit b1fa3e90 authored by Takashi Iwai's avatar Takashi Iwai Committed by Sasha Levin

ALSA: pcm: More kerneldoc updates

[ Upstream commit 30b771cf ]

Add proper kerneldoc comments to the exported functions.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent c3a0841e
This diff is collapsed.
...@@ -220,6 +220,10 @@ static char *snd_pcm_format_names[] = { ...@@ -220,6 +220,10 @@ static char *snd_pcm_format_names[] = {
FORMAT(DSD_U32_BE), FORMAT(DSD_U32_BE),
}; };
/**
* snd_pcm_format_name - Return a name string for the given PCM format
* @format: PCM format
*/
const char *snd_pcm_format_name(snd_pcm_format_t format) const char *snd_pcm_format_name(snd_pcm_format_t format)
{ {
if ((__force unsigned int)format >= ARRAY_SIZE(snd_pcm_format_names)) if ((__force unsigned int)format >= ARRAY_SIZE(snd_pcm_format_names))
...@@ -709,7 +713,6 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) ...@@ -709,7 +713,6 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
} }
return 0; return 0;
} }
EXPORT_SYMBOL(snd_pcm_new_stream); EXPORT_SYMBOL(snd_pcm_new_stream);
static int _snd_pcm_new(struct snd_card *card, const char *id, int device, static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
...@@ -1157,6 +1160,15 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) ...@@ -1157,6 +1160,15 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
return 0; return 0;
} }
/**
* snd_pcm_notify - Add/remove the notify list
* @notify: PCM notify list
* @nfree: 0 = register, 1 = unregister
*
* This adds the given notifier to the global list so that the callback is
* called for each registered PCM devices. This exists only for PCM OSS
* emulation, so far.
*/
int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree) int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
...@@ -1179,7 +1191,6 @@ int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree) ...@@ -1179,7 +1191,6 @@ int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree)
mutex_unlock(&register_mutex); mutex_unlock(&register_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL(snd_pcm_notify); EXPORT_SYMBOL(snd_pcm_notify);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
......
...@@ -77,6 +77,14 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream); ...@@ -77,6 +77,14 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream);
static DEFINE_RWLOCK(snd_pcm_link_rwlock); static DEFINE_RWLOCK(snd_pcm_link_rwlock);
static DECLARE_RWSEM(snd_pcm_link_rwsem); static DECLARE_RWSEM(snd_pcm_link_rwsem);
/**
* snd_pcm_stream_lock - Lock the PCM stream
* @substream: PCM substream
*
* This locks the PCM stream's spinlock or mutex depending on the nonatomic
* flag of the given substream. This also takes the global link rw lock
* (or rw sem), too, for avoiding the race with linked streams.
*/
void snd_pcm_stream_lock(struct snd_pcm_substream *substream) void snd_pcm_stream_lock(struct snd_pcm_substream *substream)
{ {
if (substream->pcm->nonatomic) { if (substream->pcm->nonatomic) {
...@@ -89,6 +97,12 @@ void snd_pcm_stream_lock(struct snd_pcm_substream *substream) ...@@ -89,6 +97,12 @@ void snd_pcm_stream_lock(struct snd_pcm_substream *substream)
} }
EXPORT_SYMBOL_GPL(snd_pcm_stream_lock); EXPORT_SYMBOL_GPL(snd_pcm_stream_lock);
/**
* snd_pcm_stream_lock - Unlock the PCM stream
* @substream: PCM substream
*
* This unlocks the PCM stream that has been locked via snd_pcm_stream_lock().
*/
void snd_pcm_stream_unlock(struct snd_pcm_substream *substream) void snd_pcm_stream_unlock(struct snd_pcm_substream *substream)
{ {
if (substream->pcm->nonatomic) { if (substream->pcm->nonatomic) {
...@@ -101,6 +115,14 @@ void snd_pcm_stream_unlock(struct snd_pcm_substream *substream) ...@@ -101,6 +115,14 @@ void snd_pcm_stream_unlock(struct snd_pcm_substream *substream)
} }
EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock); EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock);
/**
* snd_pcm_stream_lock_irq - Lock the PCM stream
* @substream: PCM substream
*
* This locks the PCM stream like snd_pcm_stream_lock() and disables the local
* IRQ (only when nonatomic is false). In nonatomic case, this is identical
* as snd_pcm_stream_lock().
*/
void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream) void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
{ {
if (!substream->pcm->nonatomic) if (!substream->pcm->nonatomic)
...@@ -109,6 +131,12 @@ void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream) ...@@ -109,6 +131,12 @@ void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
} }
EXPORT_SYMBOL_GPL(snd_pcm_stream_lock_irq); EXPORT_SYMBOL_GPL(snd_pcm_stream_lock_irq);
/**
* snd_pcm_stream_unlock_irq - Unlock the PCM stream
* @substream: PCM substream
*
* This is a counter-part of snd_pcm_stream_lock_irq().
*/
void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream) void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream)
{ {
snd_pcm_stream_unlock(substream); snd_pcm_stream_unlock(substream);
...@@ -127,6 +155,13 @@ unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream) ...@@ -127,6 +155,13 @@ unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream)
} }
EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave); EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave);
/**
* snd_pcm_stream_unlock_irqrestore - Unlock the PCM stream
* @substream: PCM substream
* @flags: irq flags
*
* This is a counter-part of snd_pcm_stream_lock_irqsave().
*/
void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream, void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
unsigned long flags) unsigned long flags)
{ {
...@@ -3319,6 +3354,15 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { ...@@ -3319,6 +3354,15 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = {
/* /*
* mmap the DMA buffer on RAM * mmap the DMA buffer on RAM
*/ */
/**
* snd_pcm_lib_default_mmap - Default PCM data mmap function
* @substream: PCM substream
* @area: VMA
*
* This is the default mmap handler for PCM data. When mmap pcm_ops is NULL,
* this function is invoked implicitly.
*/
int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *area) struct vm_area_struct *area)
{ {
...@@ -3354,6 +3398,15 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap); ...@@ -3354,6 +3398,15 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);
* mmap the DMA buffer on I/O memory area * mmap the DMA buffer on I/O memory area
*/ */
#if SNDRV_PCM_INFO_MMAP_IOMEM #if SNDRV_PCM_INFO_MMAP_IOMEM
/**
* snd_pcm_lib_mmap_iomem - Default PCM data mmap function for I/O mem
* @substream: PCM substream
* @area: VMA
*
* When your hardware uses the iomapped pages as the hardware buffer and
* wants to mmap it, pass this function as mmap pcm_ops. Note that this
* is supposed to work only on limited architectures.
*/
int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream,
struct vm_area_struct *area) struct vm_area_struct *area)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment