[ALSA] hda: fix Mic in as output
Some laptop has an internal analog microphone that is 'fixed'. This patch prevents creating a 'Mic In as Output' switch for ports that can't be outputs. Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
493b4acb9e
commit
cace16f174
|
@ -2283,15 +2283,23 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spec->mic_switch) {
|
if (spec->mic_switch) {
|
||||||
|
unsigned int def_conf;
|
||||||
nid = cfg->input_pins[AUTO_PIN_MIC];
|
nid = cfg->input_pins[AUTO_PIN_MIC];
|
||||||
pincap = snd_hda_param_read(codec, nid,
|
def_conf = snd_hda_codec_read(codec, nid, 0,
|
||||||
AC_PAR_PIN_CAP);
|
AC_VERB_GET_CONFIG_DEFAULT, 0);
|
||||||
if (pincap & AC_PINCAP_OUT) {
|
|
||||||
err = stac92xx_add_control(spec,
|
/* some laptops have an internal analog microphone
|
||||||
STAC_CTL_WIDGET_IO_SWITCH,
|
* which can't be used as a output */
|
||||||
"Mic as Output Switch", (nid << 8) | 1);
|
if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) {
|
||||||
if (err < 0)
|
pincap = snd_hda_param_read(codec, nid,
|
||||||
return err;
|
AC_PAR_PIN_CAP);
|
||||||
|
if (pincap & AC_PINCAP_OUT) {
|
||||||
|
err = stac92xx_add_control(spec,
|
||||||
|
STAC_CTL_WIDGET_IO_SWITCH,
|
||||||
|
"Mic as Output Switch", (nid << 8) | 1);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue