aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ac97/ac97_pcm.c')
-rw-r--r--sound/pci/ac97/ac97_pcm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c
index f684aa2c0067..3758d07182f8 100644
--- a/sound/pci/ac97/ac97_pcm.c
+++ b/sound/pci/ac97/ac97_pcm.c
@@ -269,6 +269,7 @@ int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate)
269 return -EINVAL; 269 return -EINVAL;
270 } 270 }
271 271
272 snd_ac97_update_power(ac97, reg, 1);
272 switch (reg) { 273 switch (reg) {
273 case AC97_PCM_MIC_ADC_RATE: 274 case AC97_PCM_MIC_ADC_RATE:
274 if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRM) == 0) /* MIC VRA */ 275 if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRM) == 0) /* MIC VRA */
@@ -606,6 +607,7 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
606 goto error; 607 goto error;
607 } 608 }
608 } 609 }
610 pcm->cur_dbl = r;
609 spin_unlock_irq(&pcm->bus->bus_lock); 611 spin_unlock_irq(&pcm->bus->bus_lock);
610 for (i = 3; i < 12; i++) { 612 for (i = 3; i < 12; i++) {
611 if (!(slots & (1 << i))) 613 if (!(slots & (1 << i)))
@@ -651,6 +653,21 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm)
651 unsigned short slots = pcm->aslots; 653 unsigned short slots = pcm->aslots;
652 int i, cidx; 654 int i, cidx;
653 655
656#ifdef CONFIG_SND_AC97_POWER_SAVE
657 int r = pcm->cur_dbl;
658 for (i = 3; i < 12; i++) {
659 if (!(slots & (1 << i)))
660 continue;
661 for (cidx = 0; cidx < 4; cidx++) {
662 if (pcm->r[r].rslots[cidx] & (1 << i)) {
663 int reg = get_slot_reg(pcm, cidx, i, r);
664 snd_ac97_update_power(pcm->r[r].codec[cidx],
665 reg, 0);
666 }
667 }
668 }
669#endif
670
654 bus = pcm->bus; 671 bus = pcm->bus;
655 spin_lock_irq(&pcm->bus->bus_lock); 672 spin_lock_irq(&pcm->bus->bus_lock);
656 for (i = 3; i < 12; i++) { 673 for (i = 3; i < 12; i++) {
@@ -660,6 +677,7 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm)
660 bus->used_slots[pcm->stream][cidx] &= ~(1 << i); 677 bus->used_slots[pcm->stream][cidx] &= ~(1 << i);
661 } 678 }
662 pcm->aslots = 0; 679 pcm->aslots = 0;
680 pcm->cur_dbl = 0;
663 spin_unlock_irq(&pcm->bus->bus_lock); 681 spin_unlock_irq(&pcm->bus->bus_lock);
664 return 0; 682 return 0;
665} 683}