aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-01-21 02:44:52 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:06 -0500
commitdb2396d4959340dbe2b617bde3beb2268f1e3658 (patch)
tree2feb00af283ca64ed2963ed1ab566603c216c880 /sound
parentc9946b2c807aa2e6829765accc267415a893f74a (diff)
[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>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/oxygen/oxygen_pcm.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
index f147f97bc696..31b0ccdca9a8 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)
570 struct oxygen *chip = snd_pcm_substream_chip(substream); 570 struct oxygen *chip = snd_pcm_substream_chip(substream);
571 struct snd_pcm_substream *s; 571 struct snd_pcm_substream *s;
572 unsigned int mask = 0; 572 unsigned int mask = 0;
573 int running; 573 int pausing;
574 574
575 switch (cmd) { 575 switch (cmd) {
576 case SNDRV_PCM_TRIGGER_STOP: 576 case SNDRV_PCM_TRIGGER_STOP:
577 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
578 running = 0;
579 break;
580 case SNDRV_PCM_TRIGGER_START: 577 case SNDRV_PCM_TRIGGER_START:
578 pausing = 0;
579 break;
580 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
581 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 581 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
582 running = 1; 582 pausing = 1;
583 break; 583 break;
584 default: 584 default:
585 return -EINVAL; 585 return -EINVAL;
@@ -593,11 +593,18 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd)
593 } 593 }
594 594
595 spin_lock(&chip->reg_lock); 595 spin_lock(&chip->reg_lock);
596 if (running) 596 if (!pausing) {
597 chip->pcm_running |= mask; 597 if (cmd == SNDRV_PCM_TRIGGER_START)
598 else 598 chip->pcm_running |= mask;
599 chip->pcm_running &= ~mask; 599 else
600 oxygen_write8(chip, OXYGEN_DMA_STATUS, chip->pcm_running); 600 chip->pcm_running &= ~mask;
601 oxygen_write8(chip, OXYGEN_DMA_STATUS, chip->pcm_running);
602 } else {
603 if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH)
604 oxygen_set_bits8(chip, OXYGEN_DMA_PAUSE, mask);
605 else
606 oxygen_clear_bits8(chip, OXYGEN_DMA_PAUSE, mask);
607 }
601 spin_unlock(&chip->reg_lock); 608 spin_unlock(&chip->reg_lock);
602 return 0; 609 return 0;
603} 610}