aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorLydia Wang <lydiawang@viatech.com.cn>2011-07-04 05:01:33 -0400
committerTakashi Iwai <tiwai@suse.de>2011-07-04 08:53:25 -0400
commitb89596a160dc63043be3fda8babbca9a935af0aa (patch)
treed667140add3019de2bd02df7dfb84bb45b6f7bef /sound/pci
parentc4394f5b807289c180a486df70c1a9b1f192f1cb (diff)
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: Lydia Wang <lydiawang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_via.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 89dd29db97e3..7305f4de07ec 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -452,8 +452,9 @@ static void activate_output_path(struct hda_codec *codec, struct nid_path *path,
452 if (enable && path->multi[i]) 452 if (enable && path->multi[i])
453 snd_hda_codec_write(codec, dst, 0, 453 snd_hda_codec_write(codec, dst, 0,
454 AC_VERB_SET_CONNECT_SEL, idx); 454 AC_VERB_SET_CONNECT_SEL, idx);
455 if (get_wcaps_type(get_wcaps(codec, src)) == AC_WID_AUD_OUT && 455 if (!force
456 get_wcaps_type(get_wcaps(codec, dst)) == AC_WID_AUD_MIX) 456 && get_wcaps_type(get_wcaps(codec, src)) == AC_WID_AUD_OUT
457 && get_wcaps_type(get_wcaps(codec, dst)) == AC_WID_AUD_MIX)
457 continue; 458 continue;
458 if (have_mute(codec, dst, HDA_INPUT)) { 459 if (have_mute(codec, dst, HDA_INPUT)) {
459 int val = enable ? AMP_IN_UNMUTE(idx) : 460 int val = enable ? AMP_IN_UNMUTE(idx) :
@@ -490,8 +491,8 @@ static void via_auto_init_output(struct hda_codec *codec,
490{ 491{
491 struct via_spec *spec = codec->spec; 492 struct via_spec *spec = codec->spec;
492 unsigned int caps; 493 unsigned int caps;
493 hda_nid_t pin, nid; 494 hda_nid_t pin, nid, pre_nid;
494 int i, idx; 495 int i, idx, j, num;
495 496
496 if (!path->depth) 497 if (!path->depth)
497 return; 498 return;
@@ -513,12 +514,26 @@ static void via_auto_init_output(struct hda_codec *codec,
513 return; 514 return;
514 for (i = path->depth - 1; i > 0; i--) { 515 for (i = path->depth - 1; i > 0; i--) {
515 nid = path->path[i]; 516 nid = path->path[i];
517 pre_nid = path->path[i - 1];
516 idx = get_connection_index(codec, nid, spec->aa_mix_nid); 518 idx = get_connection_index(codec, nid, spec->aa_mix_nid);
517 if (idx >= 0) { 519 if (idx >= 0) {
518 if (have_mute(codec, nid, HDA_INPUT)) 520 if (have_mute(codec, nid, HDA_INPUT)) {
519 snd_hda_codec_write(codec, nid, 0, 521 snd_hda_codec_write(codec, nid, 0,
520 AC_VERB_SET_AMP_GAIN_MUTE, 522 AC_VERB_SET_AMP_GAIN_MUTE,
521 AMP_IN_UNMUTE(idx)); 523 AMP_IN_UNMUTE(idx));
524 if (pre_nid == spec->multiout.dac_nids[0]) {
525 num = snd_hda_get_conn_list(codec, nid,
526 NULL);
527 for (j = 0; j < num; j++) {
528 if (j == idx)
529 continue;
530 snd_hda_codec_write(codec,
531 nid, 0,
532 AC_VERB_SET_AMP_GAIN_MUTE,
533 AMP_IN_MUTE(j));
534 }
535 }
536 }
522 break; 537 break;
523 } 538 }
524 } 539 }