diff options
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 7c8cd59852ec..caf48edaa921 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -2283,15 +2283,23 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
2283 | } | 2283 | } |
2284 | 2284 | ||
2285 | if (spec->mic_switch) { | 2285 | if (spec->mic_switch) { |
2286 | unsigned int def_conf; | ||
2286 | nid = cfg->input_pins[AUTO_PIN_MIC]; | 2287 | nid = cfg->input_pins[AUTO_PIN_MIC]; |
2287 | pincap = snd_hda_param_read(codec, nid, | 2288 | def_conf = snd_hda_codec_read(codec, nid, 0, |
2288 | AC_PAR_PIN_CAP); | 2289 | AC_VERB_GET_CONFIG_DEFAULT, 0); |
2289 | if (pincap & AC_PINCAP_OUT) { | 2290 | |
2290 | err = stac92xx_add_control(spec, | 2291 | /* some laptops have an internal analog microphone |
2291 | STAC_CTL_WIDGET_IO_SWITCH, | 2292 | * which can't be used as a output */ |
2292 | "Mic as Output Switch", (nid << 8) | 1); | 2293 | if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) { |
2293 | if (err < 0) | 2294 | pincap = snd_hda_param_read(codec, nid, |
2294 | return err; | 2295 | AC_PAR_PIN_CAP); |
2296 | if (pincap & AC_PINCAP_OUT) { | ||
2297 | err = stac92xx_add_control(spec, | ||
2298 | STAC_CTL_WIDGET_IO_SWITCH, | ||
2299 | "Mic as Output Switch", (nid << 8) | 1); | ||
2300 | if (err < 0) | ||
2301 | return err; | ||
2302 | } | ||
2295 | } | 2303 | } |
2296 | } | 2304 | } |
2297 | 2305 | ||