aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-11-14 08:53:42 -0500
committerJaroslav Kysela <perex@perex.cz>2007-11-19 12:38:32 -0500
commit7eba5c9dc3735b14e3df7366671adc15e0c8a048 (patch)
tree861964ee416186daf70408eb7da6be77fa42b301 /sound/pci
parent60fac85fffc74cdd2fbdae821f269594ca25b6b1 (diff)
[ALSA] hda-codec - Check PINCAP only for PIN widgets
The recent addition of checking PINCAP for EAPD seems to break some systems due to unexpected response from the codec chip. We shouldn't issue GET_PINCAP verb to non-PIN widgets. Now checks the widget type before checking EAPD bit. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_codec.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b52f56ffedf4..8cbe3bf1e317 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1625,19 +1625,26 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
1625 1625
1626 nid = codec->start_nid; 1626 nid = codec->start_nid;
1627 for (i = 0; i < codec->num_nodes; i++, nid++) { 1627 for (i = 0; i < codec->num_nodes; i++, nid++) {
1628 if (get_wcaps(codec, nid) & AC_WCAP_POWER) { 1628 unsigned int wcaps = get_wcaps(codec, nid);
1629 unsigned int pincap; 1629 if (wcaps & AC_WCAP_POWER) {
1630 /* 1630 unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
1631 * don't power down the widget if it controls eapd 1631 AC_WCAP_TYPE_SHIFT;
1632 * and EAPD_BTLENABLE is set. 1632 if (wid_type == AC_WID_PIN) {
1633 */ 1633 unsigned int pincap;
1634 pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); 1634 /*
1635 if (pincap & AC_PINCAP_EAPD) { 1635 * don't power down the widget if it controls
1636 int eapd = snd_hda_codec_read(codec, nid, 1636 * eapd and EAPD_BTLENABLE is set.
1637 0, AC_VERB_GET_EAPD_BTLENABLE, 0); 1637 */
1638 eapd &= 0x02; 1638 pincap = snd_hda_param_read(codec, nid,
1639 if (power_state == AC_PWRST_D3 && eapd) 1639 AC_PAR_PIN_CAP);
1640 continue; 1640 if (pincap & AC_PINCAP_EAPD) {
1641 int eapd = snd_hda_codec_read(codec,
1642 nid, 0,
1643 AC_VERB_GET_EAPD_BTLENABLE, 0);
1644 eapd &= 0x02;
1645 if (power_state == AC_PWRST_D3 && eapd)
1646 continue;
1647 }
1641 } 1648 }
1642 snd_hda_codec_write(codec, nid, 0, 1649 snd_hda_codec_write(codec, nid, 0,
1643 AC_VERB_SET_POWER_STATE, 1650 AC_VERB_SET_POWER_STATE,