From: Takashi Iwai Date: Fri, 17 Sep 2010 12:45:14 +0000 (+0200) Subject: ALSA: hda - Check the external mic pin more strictly for Conexant chips X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f68b3b291d39f1e3361b194a95459f9cbdaf31e6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ALSA: hda - Check the external mic pin more strictly for Conexant chips The external mic jack for auto-mic switch must be really an external jack and with a presense-detection capability. This patch makes the check more paranoia. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 09d573c59bef..a6c68cb06ddb 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -3475,7 +3475,8 @@ static int is_ext_mic(struct hda_codec *codec, hda_nid_t pin) { unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin); return get_defcfg_device(def_conf) == AC_JACK_MIC_IN && - snd_hda_get_input_pin_attr(def_conf) != INPUT_PIN_ATTR_INT; + snd_hda_get_input_pin_attr(def_conf) >= INPUT_PIN_ATTR_NORMAL && + (snd_hda_query_pin_caps(codec, pin) & AC_PINCAP_PRES_DETECT); } /* check whether the pin config is suitable for auto-mic switching;