summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-03-07 10:58:39 +0100
committerTakashi Iwai <tiwai@suse.de>2012-03-07 11:52:50 +0100
commit785f857d1cb0856b612b46a0545b74aa2596e44a (patch)
treedc7d18889a15f5dd835fa466ba95cfd9ce0a3c6c /sound/pci/hda/hda_codec.c
parentALSA: hda/realtek - Reuse init_hook for ALC269VB coef setup (diff)
downloadlinux-785f857d1cb0856b612b46a0545b74aa2596e44a.tar.xz
linux-785f857d1cb0856b612b46a0545b74aa2596e44a.zip
ALSA: hda - Set codec to D3 forcibly even if not used
We've seen a problem with a pop-noise at suspend/resume on a HP machine with ALC269, and it turned out to be an issue that the controller going to D3 while the codec is unused. When the device is once suspended and resumed and kept unused, the driver doesn't initialize the codecs. Instead, the codec chips are set up dynamically at the first usage. Now, suppose the device going to suspend again before the codec is set up. The controller is turned off to D3 while the codec chips are untouched. This caused a pop noise because the codec chip might have been turned on implicitly by the hardware. As a workaround, the codec chip needs to be set to D3 when going to suspend no matter whether it was used or not. Also, for making it happening, the controller has to be always set up in the resume path. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 76bac4fc0472..0527ae1ab96e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5281,6 +5281,10 @@ int snd_hda_suspend(struct hda_bus *bus)
list_for_each_entry(codec, &bus->codec_list, list) {
if (hda_codec_is_power_on(codec))
hda_call_codec_suspend(codec);
+ else /* forcibly change the power to D3 even if not used */
+ hda_set_power_state(codec,
+ codec->afg ? codec->afg : codec->mfg,
+ AC_PWRST_D3);
if (codec->patch_ops.post_suspend)
codec->patch_ops.post_suspend(codec);
}