summaryrefslogtreecommitdiff
path: root/sound/pci/via82xx.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-06-27 20:28:53 +0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 12:37:08 +0400
commit6dbe662874ba08585eaf732d126762c25ac8e3f7 (patch)
tree7460c36d4d848f223b682f7a700866bcf6dbc7d5 /sound/pci/via82xx.c
parent2b29b13c5794f648cd5e839796496704d787f5a6 (diff)
downloadlinux-6dbe662874ba08585eaf732d126762c25ac8e3f7.tar.xz
[ALSA] Add experimental support of aggressive AC97 power-saving mode
Added CONFIG_SND_AC97_POWER_SAVE kernel config to enable the support of aggressive AC97 power-saving mode. In this mode, the AC97 powerdown register bits are dynamically controlled at each open/close of PCM streams. The mode is activated via power_save option for snd-ac97-codec driver. As default it's off. It can be turned on/off on the fly via sysfs, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/via82xx.c')
-rw-r--r--sound/pci/via82xx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 08da9234efb3..2c23a665c3e3 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1277,7 +1277,18 @@ static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream)
if (! ratep->used)
ratep->rate = 0;
spin_unlock_irq(&ratep->lock);
-
+ if (! ratep->rate) {
+ if (! viadev->direction) {
+ snd_ac97_update_power(chip->ac97,
+ AC97_PCM_FRONT_DAC_RATE, 0);
+ snd_ac97_update_power(chip->ac97,
+ AC97_PCM_SURR_DAC_RATE, 0);
+ snd_ac97_update_power(chip->ac97,
+ AC97_PCM_LFE_DAC_RATE, 0);
+ } else
+ snd_ac97_update_power(chip->ac97,
+ AC97_PCM_LR_ADC_RATE, 0);
+ }
viadev->substream = NULL;
return 0;
}