aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-04 11:35:51 -0400
committerTakashi Iwai <tiwai@suse.de>2011-07-04 11:37:57 -0400
commitbac4b92cf7a444c0af8dd7b269c8791595c44052 (patch)
tree211fe93c005b5337fa72e6de548b244bcfa5bcdb /sound
parent18bd2c44b9c7f0ee775e756dd59e12e0939f7ab9 (diff)
ALSA: hda - Don't add aa-mix for VIA surrounds
Since we now route the front DAC via aa-mix widget, adding the aa-mix to surrounds will result in a mix-up of both front and surround PCM signals. For avoiding this, the aa-mix routes have to be disabled for surround paths. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_via.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 8d46a0f937a9..42d5a91781fc 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -489,7 +489,7 @@ static void init_output_pin(struct hda_codec *codec, hda_nid_t pin,
489 489
490static void via_auto_init_output(struct hda_codec *codec, 490static void via_auto_init_output(struct hda_codec *codec,
491 struct nid_path *path, int pin_type, 491 struct nid_path *path, int pin_type,
492 bool force) 492 bool with_aa_mix, bool force)
493{ 493{
494 struct via_spec *spec = codec->spec; 494 struct via_spec *spec = codec->spec;
495 unsigned int caps; 495 unsigned int caps;
@@ -520,9 +520,12 @@ static void via_auto_init_output(struct hda_codec *codec,
520 idx = get_connection_index(codec, nid, spec->aa_mix_nid); 520 idx = get_connection_index(codec, nid, spec->aa_mix_nid);
521 if (idx >= 0) { 521 if (idx >= 0) {
522 if (have_mute(codec, nid, HDA_INPUT)) { 522 if (have_mute(codec, nid, HDA_INPUT)) {
523 unsigned int mute = with_aa_mix ?
524 AMP_IN_UNMUTE(idx) : AMP_IN_MUTE(idx);
523 snd_hda_codec_write(codec, nid, 0, 525 snd_hda_codec_write(codec, nid, 0,
524 AC_VERB_SET_AMP_GAIN_MUTE, 526 AC_VERB_SET_AMP_GAIN_MUTE,
525 AMP_IN_UNMUTE(idx)); 527 mute);
528 /* exclusively via aa-mix for front */
526 if (pre_nid == spec->multiout.dac_nids[0]) { 529 if (pre_nid == spec->multiout.dac_nids[0]) {
527 num = snd_hda_get_conn_list(codec, nid, 530 num = snd_hda_get_conn_list(codec, nid,
528 NULL); 531 NULL);
@@ -547,7 +550,9 @@ static void via_auto_init_multi_out(struct hda_codec *codec)
547 int i; 550 int i;
548 551
549 for (i = 0; i < spec->autocfg.line_outs + spec->smart51_nums; i++) 552 for (i = 0; i < spec->autocfg.line_outs + spec->smart51_nums; i++)
550 via_auto_init_output(codec, &spec->out_path[i], PIN_OUT, true); 553 /* enable aa-mute only for the front channel */
554 via_auto_init_output(codec, &spec->out_path[i], PIN_OUT,
555 i == 0, true);
551} 556}
552 557
553static void via_auto_init_hp_out(struct hda_codec *codec) 558static void via_auto_init_hp_out(struct hda_codec *codec)
@@ -555,15 +560,18 @@ static void via_auto_init_hp_out(struct hda_codec *codec)
555 struct via_spec *spec = codec->spec; 560 struct via_spec *spec = codec->spec;
556 561
557 if (!spec->hp_dac_nid) { 562 if (!spec->hp_dac_nid) {
558 via_auto_init_output(codec, &spec->hp_dep_path, PIN_HP, true); 563 via_auto_init_output(codec, &spec->hp_dep_path, PIN_HP,
564 true, true);
559 return; 565 return;
560 } 566 }
561 if (spec->hp_independent_mode) { 567 if (spec->hp_independent_mode) {
562 activate_output_path(codec, &spec->hp_dep_path, false, false); 568 activate_output_path(codec, &spec->hp_dep_path, false, false);
563 via_auto_init_output(codec, &spec->hp_path, PIN_HP, true); 569 via_auto_init_output(codec, &spec->hp_path, PIN_HP,
570 true, true);
564 } else { 571 } else {
565 activate_output_path(codec, &spec->hp_path, false, false); 572 activate_output_path(codec, &spec->hp_path, false, false);
566 via_auto_init_output(codec, &spec->hp_dep_path, PIN_HP, true); 573 via_auto_init_output(codec, &spec->hp_dep_path, PIN_HP,
574 true, true);
567 } 575 }
568} 576}
569 577
@@ -572,7 +580,8 @@ static void via_auto_init_speaker_out(struct hda_codec *codec)
572 struct via_spec *spec = codec->spec; 580 struct via_spec *spec = codec->spec;
573 581
574 if (spec->autocfg.speaker_outs) 582 if (spec->autocfg.speaker_outs)
575 via_auto_init_output(codec, &spec->speaker_path, PIN_OUT, true); 583 via_auto_init_output(codec, &spec->speaker_path, PIN_OUT,
584 true, true);
576} 585}
577 586
578static bool is_smart51_pins(struct hda_codec *codec, hda_nid_t pin); 587static bool is_smart51_pins(struct hda_codec *codec, hda_nid_t pin);