From 1194b5b70a0a000a4ace54d94d8df5cc3ec6e3e0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 10 Oct 2007 10:04:26 +0200 Subject: [ALSA] hda-codec - Fix Gateway laptops with STAC9200 Fix the output of Gateway laptops with STAC9200 codec chip. They require the EAPD control for some pins. These pins shouldn't be powered down. To enable EAPD control, a new model 'gateway' was added to STAC9200. The known PCI SSIDs are included in the quirk list. The fix was originally suggested by Brian Hinz, in ALSA bug#2948. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/hda/hda_codec.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sound/pci/hda/hda_codec.c') diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 239cdd855dfe..187533e477c6 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1630,10 +1630,24 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, nid = codec->start_nid; for (i = 0; i < codec->num_nodes; i++, nid++) { - if (get_wcaps(codec, nid) & AC_WCAP_POWER) + if (get_wcaps(codec, nid) & AC_WCAP_POWER) { + unsigned int pincap; + /* + * don't power down the widget if it controls eapd + * and EAPD_BTLENABLE is set. + */ + pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); + if (pincap & AC_PINCAP_EAPD) { + int eapd = snd_hda_codec_read(codec, nid, + 0, AC_VERB_GET_EAPD_BTLENABLE, 0); + eapd &= 0x02; + if (power_state == AC_PWRST_D3 && eapd) + continue; + } snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, power_state); + } } if (power_state == AC_PWRST_D0) { -- cgit v1.2.2