sound: oxygen: reset DMA when stream is closed

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, June 12, 2009 - 12:04 pm

Gitweb:     http://git.kernel.org/linus/345c03ef0f2bd0c933a1eca27732af7edf5e8d4d
Commit:     345c03ef0f2bd0c933a1eca27732af7edf5e8d4d
Parent:     59a3759d0fe8d969888c741bb33f4946e4d3750d
Author:     Clemens Ladisch <clemens@ladisch.de>
AuthorDate: Mon May 25 10:05:00 2009 +0200
Committer:  Takashi Iwai <tiwai@suse.de>
CommitDate: Mon May 25 11:49:30 2009 +0200

    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>
---
 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 c262049..3b5ca70 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)
 {
 	struct oxygen *chip = snd_pcm_substream_chip(substream);
 	unsigned int channel = oxygen_substream_channel(substream);
+	unsigned int channel_mask = 1 << channel;
 
 	spin_lock_irq(&chip->reg_lock);
-	chip->interrupt_mask &= ~(1 << channel);
+	chip->interrupt_mask &= ~channel_mask;
 	oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask);
+
+	oxygen_set_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask);
+	oxygen_clear_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask);
 	spin_unlock_irq(&chip->reg_lock);
 
 	return snd_pcm_lib_free_pages(substream);
--
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:
sound: oxygen: reset DMA when stream is closed, Linux Kernel Mailing ..., (Fri Jun 12, 12:04 pm)