summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-09-17 14:42:34 +0200
committerTakashi Iwai <tiwai@suse.de>2010-09-17 14:42:34 +0200
commit99ae28bea984df4c38234eb6d2f29a552def6c1b (patch)
treec3005c84d8fa092bfe5cb7642a0dd2f61dca977e /sound/pci/hda/patch_conexant.c
parent5637edb2e1c2d13b276748508ae17f319fb7f066 (diff)
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>
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r--sound/pci/hda/patch_conexant.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index e501a85b5612..09d573c59bef 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3462,19 +3462,12 @@ static void cx_auto_unsol_event(struct hda_codec *codec, unsigned int res)
}
}
-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 @@ 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 &&
- !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;