-#define PCM_LOCK_DEFAULT 0
-#define PCM_LOCK_IRQ 1
-#define PCM_LOCK_IRQSAVE 2
-
-static unsigned long __snd_pcm_stream_lock_mode(struct snd_pcm_substream *substream,
- unsigned int mode)
-{
- unsigned long flags = 0;
- if (substream->pcm->nonatomic) {
- mutex_lock(&substream->self_group.mutex);
- } else {
- switch (mode) {
- case PCM_LOCK_DEFAULT:
- spin_lock(&substream->self_group.lock);
- break;
- case PCM_LOCK_IRQ:
- spin_lock_irq(&substream->self_group.lock);
- break;
- case PCM_LOCK_IRQSAVE:
- spin_lock_irqsave(&substream->self_group.lock, flags);
- break;
- }
- }
- return flags;
-}
-
-static void __snd_pcm_stream_unlock_mode(struct snd_pcm_substream *substream,
- unsigned int mode, unsigned long flags)
-{
- if (substream->pcm->nonatomic) {
- mutex_unlock(&substream->self_group.mutex);
- } else {
- switch (mode) {
- case PCM_LOCK_DEFAULT:
- spin_unlock(&substream->self_group.lock);
- break;
- case PCM_LOCK_IRQ:
- spin_unlock_irq(&substream->self_group.lock);
- break;
- case PCM_LOCK_IRQSAVE:
- spin_unlock_irqrestore(&substream->self_group.lock, flags);
- break;
- }
- }
-}
-