diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-05-25 04:05:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-25 05:49:30 -0400 |
commit | 345c03ef0f2bd0c933a1eca27732af7edf5e8d4d (patch) | |
tree | eb0e81e821910743a585cc34cb8b49e70b3da7ed | |
parent | 59a3759d0fe8d969888c741bb33f4946e4d3750d (diff) |
sound: oxygen: reset DMA when stream is closed
When a PCM stream is closed, flush the corresponding DMA channel.
Otherwise, the DMA controller would continue to output the last sample
which would result in a DC offset on the output.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/oxygen/oxygen_pcm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c index c262049961e1..3b5ca70c9d4d 100644 --- a/sound/pci/oxygen/oxygen_pcm.c +++ b/sound/pci/oxygen/oxygen_pcm.c | |||
@@ -487,10 +487,14 @@ static int oxygen_hw_free(struct snd_pcm_substream *substream) | |||
487 | { | 487 | { |
488 | struct oxygen *chip = snd_pcm_substream_chip(substream); | 488 | struct oxygen *chip = snd_pcm_substream_chip(substream); |
489 | unsigned int channel = oxygen_substream_channel(substream); | 489 | unsigned int channel = oxygen_substream_channel(substream); |
490 | unsigned int channel_mask = 1 << channel; | ||
490 | 491 | ||
491 | spin_lock_irq(&chip->reg_lock); | 492 | spin_lock_irq(&chip->reg_lock); |
492 | chip->interrupt_mask &= ~(1 << channel); | 493 | chip->interrupt_mask &= ~channel_mask; |
493 | oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask); | 494 | oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask); |
495 | |||
496 | oxygen_set_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask); | ||
497 | oxygen_clear_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask); | ||
494 | spin_unlock_irq(&chip->reg_lock); | 498 | spin_unlock_irq(&chip->reg_lock); |
495 | 499 | ||
496 | return snd_pcm_lib_free_pages(substream); | 500 | return snd_pcm_lib_free_pages(substream); |