diff options
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 3b8b860b3dae..34890c54bd64 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -2226,7 +2226,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
2226 | int i, err; | 2226 | int i, err; |
2227 | 2227 | ||
2228 | struct sigmatel_spec *spec = codec->spec; | 2228 | struct sigmatel_spec *spec = codec->spec; |
2229 | unsigned int wid_caps; | 2229 | unsigned int wid_caps, pincap; |
2230 | 2230 | ||
2231 | 2231 | ||
2232 | for (i = 0; i < cfg->line_outs; i++) { | 2232 | for (i = 0; i < cfg->line_outs; i++) { |
@@ -2262,13 +2262,31 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
2262 | } | 2262 | } |
2263 | } | 2263 | } |
2264 | 2264 | ||
2265 | if (spec->line_switch) | 2265 | if (spec->line_switch) { |
2266 | if ((err = stac92xx_add_control(spec, STAC_CTL_WIDGET_IO_SWITCH, "Line In as Output Switch", cfg->input_pins[AUTO_PIN_LINE] << 8)) < 0) | 2266 | nid = cfg->input_pins[AUTO_PIN_LINE]; |
2267 | return err; | 2267 | pincap = snd_hda_param_read(codec, nid, |
2268 | AC_PAR_PIN_CAP); | ||
2269 | if (pincap & AC_PINCAP_OUT) { | ||
2270 | err = stac92xx_add_control(spec, | ||
2271 | STAC_CTL_WIDGET_IO_SWITCH, | ||
2272 | "Line In as Output Switch", nid << 8); | ||
2273 | if (err < 0) | ||
2274 | return err; | ||
2275 | } | ||
2276 | } | ||
2268 | 2277 | ||
2269 | if (spec->mic_switch) | 2278 | if (spec->mic_switch) { |
2270 | if ((err = stac92xx_add_control(spec, STAC_CTL_WIDGET_IO_SWITCH, "Mic as Output Switch", (cfg->input_pins[AUTO_PIN_MIC] << 8) | 1)) < 0) | 2279 | nid = cfg->input_pins[AUTO_PIN_MIC]; |
2271 | return err; | 2280 | pincap = snd_hda_param_read(codec, nid, |
2281 | AC_PAR_PIN_CAP); | ||
2282 | if (pincap & AC_PINCAP_OUT) { | ||
2283 | err = stac92xx_add_control(spec, | ||
2284 | STAC_CTL_WIDGET_IO_SWITCH, | ||
2285 | "Mic as Output Switch", (nid << 8) | 1); | ||
2286 | if (err < 0) | ||
2287 | return err; | ||
2288 | } | ||
2289 | } | ||
2272 | 2290 | ||
2273 | return 0; | 2291 | return 0; |
2274 | } | 2292 | } |