Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=950fb626dc28e17ae4ad01dba07957bdc6e0b997
Commit:     950fb626dc28e17ae4ad01dba07957bdc6e0b997
Parent:     57bd68b8b18608cf2729f97fcb984b8521d19551
Author:     Trent Piepho <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 7 13:18:50 2007 +0200
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 16:49:15 2007 +0200

    [ALSA] snd-bt87x: Power down audio ADC when not in use
    
    Sets a bit to power down the Bt87x's internal audio ADC when the ALSA device
    isn't open, or when it is in 'digital mode' using an external ADC.
    
    Signed-off-by: Trent Piepho <[EMAIL PROTECTED]>
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/bt87x.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 10c8af1..42e57fd 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -377,7 +377,7 @@ static struct snd_pcm_hardware snd_bt87x_analog_hw = {
 
 static int snd_bt87x_set_digital_hw(struct snd_bt87x *chip, struct 
snd_pcm_runtime *runtime)
 {
-       chip->reg_control |= CTL_DA_IOM_DA;
+       chip->reg_control |= CTL_DA_IOM_DA | CTL_A_PWRDN;
        runtime->hw = snd_bt87x_digital_hw;
        runtime->hw.rates = snd_pcm_rate_to_rate_bit(chip->board.dig_rate);
        runtime->hw.rate_min = chip->board.dig_rate;
@@ -398,7 +398,7 @@ static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, 
struct snd_pcm_runtim
                .rats = &analog_clock
        };
 
-       chip->reg_control &= ~CTL_DA_IOM_DA;
+       chip->reg_control &= ~(CTL_DA_IOM_DA | CTL_A_PWRDN);
        runtime->hw = snd_bt87x_analog_hw;
        return snd_pcm_hw_constraint_ratnums(runtime, 0, 
SNDRV_PCM_HW_PARAM_RATE,
                                             &constraint_rates);
@@ -437,6 +437,11 @@ static int snd_bt87x_close(struct snd_pcm_substream 
*substream)
 {
        struct snd_bt87x *chip = snd_pcm_substream_chip(substream);
 
+       spin_lock_irq(&chip->reg_lock);
+       chip->reg_control |= CTL_A_PWRDN;
+       snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control);
+       spin_unlock_irq(&chip->reg_lock);
+
        chip->substream = NULL;
        clear_bit(0, &chip->opened);
        smp_mb__after_clear_bit();
@@ -751,7 +756,8 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
                goto fail;
        }
 
-       chip->reg_control = CTL_DA_ES2 | CTL_PKTP_16 | (15 << CTL_DA_SDR_SHIFT);
+       chip->reg_control = CTL_A_PWRDN | CTL_DA_ES2 |
+                           CTL_PKTP_16 | (15 << CTL_DA_SDR_SHIFT);
        chip->interrupt_mask = MY_INTERRUPTS;
        snd_bt87x_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control);
        snd_bt87x_writel(chip, REG_INT_MASK, 0);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to