ALSA: hda - Fix headphone-detection on some machines with STAC/IDT codecs

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 <tiwai@suse.de>

+5 -5
+5 -5
sound/pci/hda/patch_sigmatel.c
··· 3076 unsigned int wid_caps; 3077 3078 for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { 3079 nid = dac_nids[i]; 3080 if (!nid) 3081 continue; ··· 3124 err = create_controls_idx(codec, name, idx, nid, 3); 3125 if (err < 0) 3126 return err; 3127 - if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { 3128 - wid_caps = get_wcaps(codec, pins[i]); 3129 - if (wid_caps & AC_WCAP_UNSOL_CAP) 3130 - spec->hp_detect = 1; 3131 - } 3132 } 3133 } 3134 return 0;
··· 3076 unsigned int wid_caps; 3077 3078 for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { 3079 + if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { 3080 + wid_caps = get_wcaps(codec, pins[i]); 3081 + if (wid_caps & AC_WCAP_UNSOL_CAP) 3082 + spec->hp_detect = 1; 3083 + } 3084 nid = dac_nids[i]; 3085 if (!nid) 3086 continue; ··· 3119 err = create_controls_idx(codec, name, idx, nid, 3); 3120 if (err < 0) 3121 return err; 3122 } 3123 } 3124 return 0;