aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.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_sigmatel.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_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7eb359a030de..6bfbc2fe46ed 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2778,7 +2778,7 @@ static inline int stac92xx_add_jack_mode_control(struct hda_codec *codec,
2778 struct sigmatel_spec *spec = codec->spec; 2778 struct sigmatel_spec *spec = codec->spec;
2779 char name[22]; 2779 char name[22];
2780 2780
2781 if (!((get_defcfg_connect(def_conf)) & AC_JACK_PORT_FIXED)) { 2781 if (snd_hda_get_input_pin_attr(def_conf) != INPUT_PIN_ATTR_INT) {
2782 if (stac92xx_get_default_vref(codec, nid) == AC_PINCTL_VREF_GRD 2782 if (stac92xx_get_default_vref(codec, nid) == AC_PINCTL_VREF_GRD
2783 && nid == spec->line_switch) 2783 && nid == spec->line_switch)
2784 control = STAC_CTL_WIDGET_IO_SWITCH; 2784 control = STAC_CTL_WIDGET_IO_SWITCH;
@@ -2857,7 +2857,7 @@ static hda_nid_t check_mic_out_switch(struct hda_codec *codec, hda_nid_t *dac)
2857 def_conf = snd_hda_codec_get_pincfg(codec, nid); 2857 def_conf = snd_hda_codec_get_pincfg(codec, nid);
2858 /* some laptops have an internal analog microphone 2858 /* some laptops have an internal analog microphone
2859 * which can't be used as a output */ 2859 * which can't be used as a output */
2860 if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) { 2860 if (snd_hda_get_input_pin_attr(def_conf) != INPUT_PIN_ATTR_INT) {
2861 pincap = snd_hda_query_pin_caps(codec, nid); 2861 pincap = snd_hda_query_pin_caps(codec, nid);
2862 if (pincap & AC_PINCAP_OUT) { 2862 if (pincap & AC_PINCAP_OUT) {
2863 *dac = get_unassigned_dac(codec, nid); 2863 *dac = get_unassigned_dac(codec, nid);
@@ -3496,23 +3496,23 @@ static int check_mic_pin(struct hda_codec *codec, hda_nid_t nid,
3496 if (!nid) 3496 if (!nid)
3497 return 0; 3497 return 0;
3498 cfg = snd_hda_codec_get_pincfg(codec, nid); 3498 cfg = snd_hda_codec_get_pincfg(codec, nid);
3499 switch (get_defcfg_connect(cfg)) { 3499 switch (snd_hda_get_input_pin_attr(cfg)) {
3500 case AC_JACK_PORT_BOTH: 3500 case INPUT_PIN_ATTR_INT:
3501 case AC_JACK_PORT_FIXED:
3502 if (*fixed) 3501 if (*fixed)
3503 return 1; /* already occupied */ 3502 return 1; /* already occupied */
3504 *fixed = nid; 3503 *fixed = nid;
3505 break; 3504 break;
3506 case AC_JACK_PORT_COMPLEX: 3505 case INPUT_PIN_ATTR_UNUSED:
3507 if ((get_defcfg_location(cfg) & 0xF0) == AC_JACK_LOC_SEPARATE) { 3506 break;
3508 if (*dock) 3507 case INPUT_PIN_ATTR_DOCK:
3509 return 1; /* already occupied */ 3508 if (*dock)
3510 *dock = nid; 3509 return 1; /* already occupied */
3511 } else { 3510 *dock = nid;
3512 if (*ext) 3511 break;
3513 return 1; /* already occupied */ 3512 default:
3514 *ext = nid; 3513 if (*ext)
3515 } 3514 return 1; /* already occupied */
3515 *ext = nid;
3516 break; 3516 break;
3517 } 3517 }
3518 return 0; 3518 return 0;