[ALSA] oxygen: fix pause handling

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, January 31, 2008 - 5:03 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db2396...
Commit:     db2396d4959340dbe2b617bde3beb2268f1e3658
Parent:     c9946b2c807aa2e6829765accc267415a893f74a
Author:     Clemens Ladisch <clemens@ladisch.de>
AuthorDate: Mon Jan 21 08:44:52 2008 +0100
Committer:  Jaroslav Kysela <perex@perex.cz>
CommitDate: Thu Jan 31 17:30:06 2008 +0100

    [ALSA] oxygen: fix pause handling
    
    Use the DMA_PAUSE register for pausing instead of stopping DMA.
    
    Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
    Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
 sound/pci/oxygen/oxygen_pcm.c |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
index f147f97..31b0ccd 100644
--- a/sound/pci/oxygen/oxygen_pcm.c
+++ b/sound/pci/oxygen/oxygen_pcm.c
@@ -570,16 +570,16 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd)
 	struct oxygen *chip = snd_pcm_substream_chip(substream);
 	struct snd_pcm_substream *s;
 	unsigned int mask = 0;
-	int running;
+	int pausing;
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		running = 0;
-		break;
 	case SNDRV_PCM_TRIGGER_START:
+		pausing = 0;
+		break;
+	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		running = 1;
+		pausing = 1;
 		break;
 	default:
 		return -EINVAL;
@@ -593,11 +593,18 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd)
 	}
 
 	spin_lock(&chip->reg_lock);
-	if (running)
-		chip->pcm_running |= mask;
-	else
-		chip->pcm_running &= ~mask;
-	oxygen_write8(chip, OXYGEN_DMA_STATUS, chip->pcm_running);
+	if (!pausing) {
+		if (cmd == SNDRV_PCM_TRIGGER_START)
+			chip->pcm_running |= mask;
+		else
+			chip->pcm_running &= ~mask;
+		oxygen_write8(chip, OXYGEN_DMA_STATUS, chip->pcm_running);
+	} else {
+		if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH)
+			oxygen_set_bits8(chip, OXYGEN_DMA_PAUSE, mask);
+		else
+			oxygen_clear_bits8(chip, OXYGEN_DMA_PAUSE, mask);
+	}
 	spin_unlock(&chip->reg_lock);
 	return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ALSA] oxygen: fix pause handling, Linux Kernel Mailing ..., (Thu Jan 31, 5:03 pm)