From ffd0e56c606836581da5df742a43ce8015ca7475 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Subject: ALSA: hda - Fix headphone-detection on some machines with STAC/IDT codecs Patch-mainline: 2.6.30-rc3 References: bnc#495515 When the headphone can have no unique DAC, the current code doesn't check the HP-detection although it should. Put the hp-detection check before the DAC check to fix this bug. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_sigmatel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -3025,6 +3025,11 @@ unsigned int wid_caps; for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { + if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { + wid_caps = get_wcaps(codec, pins[i]); + if (wid_caps & AC_WCAP_UNSOL_CAP) + spec->hp_detect = 1; + } nid = dac_nids[i]; if (!nid) continue; @@ -3064,11 +3069,6 @@ err = create_controls(codec, name, nid, 3); if (err < 0) return err; - if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { - wid_caps = get_wcaps(codec, pins[i]); - if (wid_caps & AC_WCAP_UNSOL_CAP) - spec->hp_detect = 1; - } } } return 0;