diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-13 16:43:12 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-13 16:43:12 +0200 |
commit | 0ad1b5b619e4f053dfdcef9dfc68cc5142d86961 (patch) | |
tree | f6e99ed3ed835f1e5fca74891817930f2d52f7e8 | |
parent | da33986651e137b1ea2ec21794e32bc5c57b03d0 (diff) | |
download | op-kernel-dev-0ad1b5b619e4f053dfdcef9dfc68cc5142d86961.zip op-kernel-dev-0ad1b5b619e4f053dfdcef9dfc68cc5142d86961.tar.gz |
ALSA: hda - Check AMP CAP at initialization of Conexant auto-parser
Some codecs have no mute caps in audio I/O widgets.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index d63e15b..19416e3 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -3549,11 +3549,17 @@ static void cx_auto_init_output(struct hda_codec *codec) struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; hda_nid_t nid; - int i; + int i, val; - for (i = 0; i < spec->multiout.num_dacs; i++) - snd_hda_codec_write(codec, spec->multiout.dac_nids[i], 0, - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); + for (i = 0; i < spec->multiout.num_dacs; i++) { + nid = spec->multiout.dac_nids[i]; + if (query_amp_caps(codec, nid, HDA_OUTPUT) & AC_AMPCAP_MUTE) + val = AMP_OUT_MUTE; + else + val = AMP_OUT_ZERO; + snd_hda_codec_write(codec, nid, 0, + AC_VERB_SET_AMP_GAIN_MUTE, val); + } for (i = 0; i < cfg->hp_outs; i++) snd_hda_codec_write(codec, cfg->hp_pins[i], 0, @@ -3593,11 +3599,17 @@ static void cx_auto_init_input(struct hda_codec *codec) { struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; - int i; + int i, val; - for (i = 0; i < spec->num_adc_nids; i++) - snd_hda_codec_write(codec, spec->adc_nids[i], 0, - AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)); + for (i = 0; i < spec->num_adc_nids; i++) { + hda_nid_t nid = spec->adc_nids[i]; + if (query_amp_caps(codec, nid, HDA_INPUT) & AC_AMPCAP_MUTE) + val = AMP_IN_MUTE(0); + else + val = AMP_IN_UNMUTE(0); + snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, + val); + } for (i = 0; i < cfg->num_inputs; i++) { unsigned int type; |