aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-06-27 09:48:17 -0400
committerTakashi Iwai <tiwai@suse.de>2011-06-27 09:48:17 -0400
commit050ea75317f33e376cc413359c0319ad5cc86e2a (patch)
tree76e05218f79b29456d6d6df963515dbc42c79c2e
parent39fa84e94a7df64a6ba27669ef98b51994fb6894 (diff)
ALSA: hda - Fix volume-init of ALC299 & co
ALC269 and compatible codecs have the output volume in DACs, thus we can't use the ALC880's code as is. Fixed by checking the amp caps and picking up the right widget for initialization. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 783017d9247..5293f7f7f42 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5605,17 +5605,28 @@ static int get_pin_type(int line_out_type)
5605 return PIN_OUT; 5605 return PIN_OUT;
5606} 5606}
5607 5607
5608static void alc880_auto_init_dac(struct hda_codec *codec, hda_nid_t nid) 5608static void alc880_auto_init_dac(struct hda_codec *codec, hda_nid_t dac)
5609{ 5609{
5610 if (!nid) 5610 hda_nid_t nid, mix;
5611
5612 if (!dac)
5611 return; 5613 return;
5612 nid = alc880_idx_to_mixer(alc880_dac_to_idx(nid)); 5614 mix = alc880_idx_to_mixer(alc880_dac_to_idx(dac));
5613 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, 5615 if (query_amp_caps(codec, dac, HDA_OUTPUT) & AC_AMPCAP_NUM_STEPS)
5614 AMP_OUT_ZERO); 5616 nid = dac;
5615 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, 5617 else if (query_amp_caps(codec, mix, HDA_OUTPUT) & AC_AMPCAP_NUM_STEPS)
5616 AMP_IN_UNMUTE(0)); 5618 nid = mix;
5617 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, 5619 else
5618 AMP_IN_UNMUTE(1)); 5620 nid = 0;
5621 if (nid)
5622 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
5623 AMP_OUT_ZERO);
5624 if (query_amp_caps(codec, mix, HDA_INPUT) & AC_AMPCAP_MUTE) {
5625 snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
5626 AMP_IN_UNMUTE(0));
5627 snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
5628 AMP_IN_UNMUTE(1));
5629 }
5619} 5630}
5620 5631
5621static void alc880_auto_init_multi_out(struct hda_codec *codec) 5632static void alc880_auto_init_multi_out(struct hda_codec *codec)