aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-09-21 11:56:18 +0200
committerJaroslav Kysela <perex@suse.cz>2006-09-23 10:48:01 +0200
commit314634bc81325dcfeb31ed138647d428b1f26cbf (patch)
tree9a230e872a69e13d026eae4cb247b1447b14c88f /sound/pci/hda/hda_codec.c
parent7ffffecc7c4df08ad89723ca32d936ff09b5b3ff (diff)
[ALSA] hda-codec - Fix mic input with STAC92xx codecs
Fixed mic input with STAC92xx codecs. The mic pin was sometimes set to OUTPUT by the headphone jack detection. Also, try to assign a secondary mic as front-mic (or vice versa) in the auto-detection if possible. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 07360996caa..9c3d7ac0806 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2079,12 +2079,21 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c
cfg->hp_pins[cfg->hp_outs] = nid;
cfg->hp_outs++;
break;
- case AC_JACK_MIC_IN:
- if (loc == AC_JACK_LOC_FRONT)
- cfg->input_pins[AUTO_PIN_FRONT_MIC] = nid;
- else
- cfg->input_pins[AUTO_PIN_MIC] = nid;
+ case AC_JACK_MIC_IN: {
+ int preferred, alt;
+ if (loc == AC_JACK_LOC_FRONT) {
+ preferred = AUTO_PIN_FRONT_MIC;
+ alt = AUTO_PIN_MIC;
+ } else {
+ preferred = AUTO_PIN_MIC;
+ alt = AUTO_PIN_FRONT_MIC;
+ }
+ if (!cfg->input_pins[preferred])
+ cfg->input_pins[preferred] = nid;
+ else if (!cfg->input_pins[alt])
+ cfg->input_pins[alt] = nid;
break;
+ }
case AC_JACK_LINE_IN:
if (loc == AC_JACK_LOC_FRONT)
cfg->input_pins[AUTO_PIN_FRONT_LINE] = nid;