aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMatthew Ranostay <mranostay@embededalley.com>2008-01-25 09:24:50 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:16 -0500
commitb5895dc8b467a2457f4d33bef51f9879cf780a07 (patch)
tree5080f7b0da82774da821220c505602ca96e942d7 /sound
parent628ed1333a9d2a7c7d3dc53641ea59af511e5fe5 (diff)
[ALSA] hda: STAC92xx Line In/Mic as output check
This patch checks to see the Line In/Mic port have the ability to do output before creating the the control switches. The 92hd71bxx series of codecs has this issue with the port 0xe, which only allows input. Signed-off-by: Matthew Ranostay <mranostay@embededalley.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c32
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}