Commit b89596a1 authored by Lydia Wang's avatar Lydia Wang Committed by Takashi Iwai

ALSA: hda - Fix invalid multi-channel amplifiers for VT1718S

For VT1718S, the multi-channel path should be like following:
DAC 0-->Mixer 9(index 5)-->Mixer 0(index 1)-->Front Pin;
DAC 1-->Mixer 1(index 0)-->Surround Pin;
DAC 2-->C/LFE Pin;
DAC 3-->Mixer 2(index 0)-->Side Pin;

But current code built Surround and Side path through index 1 of
Mixer 1 and 2. So Adjusting Surround and Side channel amplifier is
invalid. This patch fixes the issue.
Signed-off-by: default avatarLydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c4394f5b
...@@ -452,8 +452,9 @@ static void activate_output_path(struct hda_codec *codec, struct nid_path *path, ...@@ -452,8 +452,9 @@ static void activate_output_path(struct hda_codec *codec, struct nid_path *path,
if (enable && path->multi[i]) if (enable && path->multi[i])
snd_hda_codec_write(codec, dst, 0, snd_hda_codec_write(codec, dst, 0,
AC_VERB_SET_CONNECT_SEL, idx); AC_VERB_SET_CONNECT_SEL, idx);
if (get_wcaps_type(get_wcaps(codec, src)) == AC_WID_AUD_OUT && if (!force
get_wcaps_type(get_wcaps(codec, dst)) == AC_WID_AUD_MIX) && get_wcaps_type(get_wcaps(codec, src)) == AC_WID_AUD_OUT
&& get_wcaps_type(get_wcaps(codec, dst)) == AC_WID_AUD_MIX)
continue; continue;
if (have_mute(codec, dst, HDA_INPUT)) { if (have_mute(codec, dst, HDA_INPUT)) {
int val = enable ? AMP_IN_UNMUTE(idx) : int val = enable ? AMP_IN_UNMUTE(idx) :
...@@ -490,8 +491,8 @@ static void via_auto_init_output(struct hda_codec *codec, ...@@ -490,8 +491,8 @@ static void via_auto_init_output(struct hda_codec *codec,
{ {
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
unsigned int caps; unsigned int caps;
hda_nid_t pin, nid; hda_nid_t pin, nid, pre_nid;
int i, idx; int i, idx, j, num;
if (!path->depth) if (!path->depth)
return; return;
...@@ -513,12 +514,26 @@ static void via_auto_init_output(struct hda_codec *codec, ...@@ -513,12 +514,26 @@ static void via_auto_init_output(struct hda_codec *codec,
return; return;
for (i = path->depth - 1; i > 0; i--) { for (i = path->depth - 1; i > 0; i--) {
nid = path->path[i]; nid = path->path[i];
pre_nid = path->path[i - 1];
idx = get_connection_index(codec, nid, spec->aa_mix_nid); idx = get_connection_index(codec, nid, spec->aa_mix_nid);
if (idx >= 0) { if (idx >= 0) {
if (have_mute(codec, nid, HDA_INPUT)) if (have_mute(codec, nid, HDA_INPUT)) {
snd_hda_codec_write(codec, nid, 0, snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_UNMUTE(idx)); AMP_IN_UNMUTE(idx));
if (pre_nid == spec->multiout.dac_nids[0]) {
num = snd_hda_get_conn_list(codec, nid,
NULL);
for (j = 0; j < num; j++) {
if (j == idx)
continue;
snd_hda_codec_write(codec,
nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_MUTE(j));
}
}
}
break; break;
} }
} }
......
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