]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Handle dock line-in as auto-detecable for Cxt auto-parser
authorTakashi Iwai <tiwai@suse.de>
Tue, 17 May 2011 10:57:46 +0000 (12:57 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 17 May 2011 10:57:46 +0000 (12:57 +0200)
Similar process like in patch_realtek.c and patch_sigmatel.c.

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

index 2a04fea016923934727053593635cdca5d9d099c..4f37477d3c71b5238b049275987cca2656df0107 100644 (file)
@@ -3794,17 +3794,19 @@ static void cx_auto_check_auto_mic(struct hda_codec *codec)
        for (i = 0; i < spec->private_imux.num_items; i++) {
                hda_nid_t pin = spec->imux_info[i].pin;
                unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin);
-               int attr;
-               if (get_defcfg_device(def_conf) != AC_JACK_MIC_IN)
-                       return; /* no-mic input */
+               int type, attr;
                attr = snd_hda_get_input_pin_attr(def_conf);
                if (attr == INPUT_PIN_ATTR_UNUSED)
-                       continue;
+                       return; /* invalid entry */
                if (attr > INPUT_PIN_ATTR_NORMAL)
                        attr = INPUT_PIN_ATTR_NORMAL;
                if (attr != INPUT_PIN_ATTR_INT &&
                    !is_jack_detectable(codec, pin))
-                       continue;
+                       return; /* non-detectable pin */
+               type = get_defcfg_device(def_conf);
+               if (type != AC_JACK_MIC_IN &&
+                   (attr != INPUT_PIN_ATTR_DOCK || type != AC_JACK_LINE_IN))
+                       return; /* no valid input type */
                if (pset[attr] >= 0)
                        return; /* already occupied */
                pset[attr] = i;