ALSA: hda - Fix mic attribute check for internal mics
authorTakashi Iwai <tiwai@suse.de>
Fri, 17 Sep 2010 08:26:37 +0000 (10:26 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 17 Sep 2010 08:28:20 +0000 (10:28 +0200)
Now Windows claims that the BIOS sets pins for internal mics to be
BOTH connection instead of FIXED.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c

index 08d81b873022ac169079b29109f6eb6d3d5c892d..9f668efbe420558ce74e1bcd26558ed35ef0e640 100644 (file)
@@ -4648,8 +4648,11 @@ enum {
 static int get_mic_pin_attr(unsigned int def_conf)
 {
        unsigned int loc = get_defcfg_location(def_conf);
-       if (get_defcfg_connect(def_conf) == AC_JACK_PORT_FIXED ||
-           (loc & 0x30) == AC_JACK_LOC_INTERNAL)
+       unsigned int conn = get_defcfg_connect(def_conf);
+       /* Windows may claim the internal mic to be BOTH, too */
+       if (conn == AC_JACK_PORT_FIXED || conn == AC_JACK_PORT_BOTH)
+               return MIC_ATTR_INT;
+       if ((loc & 0x30) == AC_JACK_LOC_INTERNAL)
                return MIC_ATTR_INT;
        if ((loc & 0x30) == AC_JACK_LOC_SEPARATE)
                return MIC_ATTR_DOCK;