Commit db2396d4 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[ALSA] oxygen: fix pause handling

Use the DMA_PAUSE register for pausing instead of stopping DMA.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent c9946b2c
...@@ -570,16 +570,16 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -570,16 +570,16 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd)
struct oxygen *chip = snd_pcm_substream_chip(substream); struct oxygen *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *s; struct snd_pcm_substream *s;
unsigned int mask = 0; unsigned int mask = 0;
int running; int pausing;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
running = 0;
break;
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
pausing = 0;
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
running = 1; pausing = 1;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -593,11 +593,18 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -593,11 +593,18 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd)
} }
spin_lock(&chip->reg_lock); spin_lock(&chip->reg_lock);
if (running) if (!pausing) {
chip->pcm_running |= mask; if (cmd == SNDRV_PCM_TRIGGER_START)
else chip->pcm_running |= mask;
chip->pcm_running &= ~mask; else
oxygen_write8(chip, OXYGEN_DMA_STATUS, chip->pcm_running); 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); spin_unlock(&chip->reg_lock);
return 0; return 0;
} }
......
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