aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorMatthew Ranostay <mranostay@embeddedalley.com>2008-01-30 08:58:38 -0500
committerMercurial server <hg@alsa0.alsa-project.org>2008-01-31 11:33:37 -0500
commitcace16f174d971a80f81e68ed04f1124a50dd800 (patch)
treee1be8cb18b10e985c28df08302fd652efcfbefaa /sound/pci/hda/patch_sigmatel.c
parent493b4acb9ed3193b19d45d62e0e5740d20f47adc (diff)
[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>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c24
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