diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-13 10:43:12 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-13 10:43:12 -0400 |
commit | 0ad1b5b619e4f053dfdcef9dfc68cc5142d86961 (patch) | |
tree | f6e99ed3ed835f1e5fca74891817930f2d52f7e8 | |
parent | da33986651e137b1ea2ec21794e32bc5c57b03d0 (diff) |
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 d63e15b8937a..19416e305be6 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) | |||
3549 | struct conexant_spec *spec = codec->spec; | 3549 | struct conexant_spec *spec = codec->spec; |
3550 | struct auto_pin_cfg *cfg = &spec->autocfg; | 3550 | struct auto_pin_cfg *cfg = &spec->autocfg; |
3551 | hda_nid_t nid; | 3551 | hda_nid_t nid; |
3552 | int i; | 3552 | int i, val; |
3553 | 3553 | ||
3554 | for (i = 0; i < spec->multiout.num_dacs; i++) | 3554 | for (i = 0; i < spec->multiout.num_dacs; i++) { |
3555 | snd_hda_codec_write(codec, spec->multiout.dac_nids[i], 0, | 3555 | nid = spec->multiout.dac_nids[i]; |
3556 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | 3556 | if (query_amp_caps(codec, nid, HDA_OUTPUT) & AC_AMPCAP_MUTE) |
3557 | val = AMP_OUT_MUTE; | ||
3558 | else | ||
3559 | val = AMP_OUT_ZERO; | ||
3560 | snd_hda_codec_write(codec, nid, 0, | ||
3561 | AC_VERB_SET_AMP_GAIN_MUTE, val); | ||
3562 | } | ||
3557 | 3563 | ||
3558 | for (i = 0; i < cfg->hp_outs; i++) | 3564 | for (i = 0; i < cfg->hp_outs; i++) |
3559 | snd_hda_codec_write(codec, cfg->hp_pins[i], 0, | 3565 | snd_hda_codec_write(codec, cfg->hp_pins[i], 0, |
@@ -3593,11 +3599,17 @@ static void cx_auto_init_input(struct hda_codec *codec) | |||
3593 | { | 3599 | { |
3594 | struct conexant_spec *spec = codec->spec; | 3600 | struct conexant_spec *spec = codec->spec; |
3595 | struct auto_pin_cfg *cfg = &spec->autocfg; | 3601 | struct auto_pin_cfg *cfg = &spec->autocfg; |
3596 | int i; | 3602 | int i, val; |
3597 | 3603 | ||
3598 | for (i = 0; i < spec->num_adc_nids; i++) | 3604 | for (i = 0; i < spec->num_adc_nids; i++) { |
3599 | snd_hda_codec_write(codec, spec->adc_nids[i], 0, | 3605 | hda_nid_t nid = spec->adc_nids[i]; |
3600 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)); | 3606 | if (query_amp_caps(codec, nid, HDA_INPUT) & AC_AMPCAP_MUTE) |
3607 | val = AMP_IN_MUTE(0); | ||
3608 | else | ||
3609 | val = AMP_IN_UNMUTE(0); | ||
3610 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, | ||
3611 | val); | ||
3612 | } | ||
3601 | 3613 | ||
3602 | for (i = 0; i < cfg->num_inputs; i++) { | 3614 | for (i = 0; i < cfg->num_inputs; i++) { |
3603 | unsigned int type; | 3615 | unsigned int type; |