Commit 050ea753 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 39fa84e9
......@@ -5605,17 +5605,28 @@ static int get_pin_type(int line_out_type)
return PIN_OUT;
}
static void alc880_auto_init_dac(struct hda_codec *codec, hda_nid_t nid)
static void alc880_auto_init_dac(struct hda_codec *codec, hda_nid_t dac)
{
if (!nid)
hda_nid_t nid, mix;
if (!dac)
return;
nid = alc880_idx_to_mixer(alc880_dac_to_idx(nid));
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_OUT_ZERO);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_UNMUTE(0));
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_UNMUTE(1));
mix = alc880_idx_to_mixer(alc880_dac_to_idx(dac));
if (query_amp_caps(codec, dac, HDA_OUTPUT) & AC_AMPCAP_NUM_STEPS)
nid = dac;
else if (query_amp_caps(codec, mix, HDA_OUTPUT) & AC_AMPCAP_NUM_STEPS)
nid = mix;
else
nid = 0;
if (nid)
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_OUT_ZERO);
if (query_amp_caps(codec, mix, HDA_INPUT) & AC_AMPCAP_MUTE) {
snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_UNMUTE(0));
snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_UNMUTE(1));
}
}
static void alc880_auto_init_multi_out(struct hda_codec *codec)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment