ALSA: hda - Make snd_hda_get_input_pin_attr() helper

Make the helper function to give the input-pin attribute for jack
connectivity and location.  This simplifies checks of input-pin jacks
a bit in some places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index e501a85..09d573c 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3462,19 +3462,12 @@
 	}
 }
 
-static int is_int_mic_conn(unsigned int def_conf)
-{
-	unsigned int loc = get_defcfg_location(def_conf);
-	return get_defcfg_connect(def_conf) == AC_JACK_PORT_FIXED ||
-		(loc & 0x30) == AC_JACK_LOC_INTERNAL;
-}
-
 /* return true if it's an internal-mic pin */
 static int is_int_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 &&
-		is_int_mic_conn(def_conf);
+		snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT;
 }
 
 /* return true if it's an external-mic pin */
@@ -3482,7 +3475,7 @@
 {
 	unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin);
 	return get_defcfg_device(def_conf) == AC_JACK_MIC_IN &&
-		!is_int_mic_conn(def_conf);
+		snd_hda_get_input_pin_attr(def_conf) != INPUT_PIN_ATTR_INT;
 }
 
 /* check whether the pin config is suitable for auto-mic switching;