aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-04-24 19:58:26 +0200
committerJaroslav Kysela <perex@suse.cz>2004-04-24 19:58:26 +0200
commit94c2b95f5b50e4d2fb7535d2479747259cce905b (patch)
treec5e1ea24ef9dc652a9545209a0ff86720f37954e /sound
parent16486f85f78e46dfdd0fa961fbf462c9935f558e (diff)
downloadhistory-94c2b95f5b50e4d2fb7535d2479747259cce905b.tar.gz
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
AC97 Codec Core - export snd_ac97_suspend(). - mute MASTER and HEADPHONE volumes in suspend to avoid possible clicks.
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/ac97/ac97_codec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 91885cded75c09..6b3e9342f29518 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -2001,11 +2001,19 @@ int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97)
* @ac97: the ac97 instance
*
* Suspends the codec, power down the chip.
+ * MASTER and HEADPHONE registers are muted but the register cache values
+ * are not changed, so that the values can be restored in snd_ac97_resume().
*/
void snd_ac97_suspend(ac97_t *ac97)
{
unsigned short power = (ac97->regs[AC97_POWERDOWN] ^ 0x8000) & ~0x8000; /* invert EAPD */
+ if (ac97_is_audio(ac97)) {
+ /* some codecs have stereo mute bits */
+ snd_ac97_write(ac97, AC97_MASTER, 0x9f9f);
+ snd_ac97_write(ac97, AC97_HEADPHONE, 0x9f9f);
+ }
+
power |= 0x4000; /* Headphone amplifier powerdown */
power |= 0x0300; /* ADC & DAC powerdown */
snd_ac97_write(ac97, AC97_POWERDOWN, power);
@@ -2297,6 +2305,7 @@ EXPORT_SYMBOL(snd_ac97_tune_hardware);
EXPORT_SYMBOL(snd_ac97_set_rate);
#ifdef CONFIG_PM
EXPORT_SYMBOL(snd_ac97_resume);
+EXPORT_SYMBOL(snd_ac97_suspend);
#endif
/*