Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7eba5c9dc3735b14e3df7366671adc15e0c8a048
Commit:     7eba5c9dc3735b14e3df7366671adc15e0c8a048
Parent:     60fac85fffc74cdd2fbdae821f269594ca25b6b1
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 14 14:53:42 2007 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Mon Nov 19 18:38:32 2007 +0100

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/hda_codec.c |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b52f56f..8cbe3bf 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,
 
        nid = codec->start_nid;
        for (i = 0; i < codec->num_nodes; i++, nid++) {
-               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;
+               unsigned int wcaps = get_wcaps(codec, nid);
+               if (wcaps & AC_WCAP_POWER) {
+                       unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
+                               AC_WCAP_TYPE_SHIFT;
+                       if (wid_type == AC_WID_PIN) {
+                               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,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to