aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-09-17 08:42:34 -0400
committerTakashi Iwai <tiwai@suse.de>2010-09-17 08:42:34 -0400
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)
3462 } 3462 }
3463} 3463}
3464 3464
3465static int is_int_mic_conn(unsigned int def_conf)
3466{
3467 unsigned int loc = get_defcfg_location(def_conf);
3468 return get_defcfg_connect(def_conf) == AC_JACK_PORT_FIXED ||
3469 (loc & 0x30) == AC_JACK_LOC_INTERNAL;
3470}
3471
3472/* return true if it's an internal-mic pin */ 3465/* return true if it's an internal-mic pin */
3473static int is_int_mic(struct hda_codec *codec, hda_nid_t pin) 3466static int is_int_mic(struct hda_codec *codec, hda_nid_t pin)
3474{ 3467{
3475 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin); 3468 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin);
3476 return get_defcfg_device(def_conf) == AC_JACK_MIC_IN && 3469 return get_defcfg_device(def_conf) == AC_JACK_MIC_IN &&
3477 is_int_mic_conn(def_conf); 3470 snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT;
3478} 3471}
3479 3472
3480/* return true if it's an external-mic pin */ 3473/* 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)
3482{ 3475{
3483 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin); 3476 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, pin);
3484 return get_defcfg_device(def_conf) == AC_JACK_MIC_IN && 3477 return get_defcfg_device(def_conf) == AC_JACK_MIC_IN &&
3485 !is_int_mic_conn(def_conf); 3478 snd_hda_get_input_pin_attr(def_conf) != INPUT_PIN_ATTR_INT;
3486} 3479}
3487 3480
3488/* check whether the pin config is suitable for auto-mic switching; 3481/* check whether the pin config is suitable for auto-mic switching;