diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | 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 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 | } |