aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-27 10:41:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-05 00:58:37 -0400
commitcb1d0a1e91079d22cedc6d66d9c94d53ce0b0199 (patch)
tree4481e1751c0597b21d13616842f20883639e8518 /sound/pci
parent2415d01c0cb11b5471ee640b0ba5a1254be9a708 (diff)
ALSA: hda - Fix duplicated DAC assignments for Realtek
commit c48a8fb0d31d6147d8d76b8e2ad7f51a2fbb5c4d upstream. Copying hp_pins and speaker_pins from line_out_pins may confuse the parser, and it can lead to duplicated initializations for the same pin with a wrong DAC assignment. The problem appears in 3.0 kernel code. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b48fb43b544..524ff26417e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1578,13 +1578,15 @@ static void alc_init_auto_hp(struct hda_codec *codec)
1578 if (present == 3) 1578 if (present == 3)
1579 spec->automute_hp_lo = 1; /* both HP and LO automute */ 1579 spec->automute_hp_lo = 1; /* both HP and LO automute */
1580 1580
1581 if (!cfg->speaker_pins[0]) { 1581 if (!cfg->speaker_pins[0] &&
1582 cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
1582 memcpy(cfg->speaker_pins, cfg->line_out_pins, 1583 memcpy(cfg->speaker_pins, cfg->line_out_pins,
1583 sizeof(cfg->speaker_pins)); 1584 sizeof(cfg->speaker_pins));
1584 cfg->speaker_outs = cfg->line_outs; 1585 cfg->speaker_outs = cfg->line_outs;
1585 } 1586 }
1586 1587
1587 if (!cfg->hp_pins[0]) { 1588 if (!cfg->hp_pins[0] &&
1589 cfg->line_out_type == AUTO_PIN_HP_OUT) {
1588 memcpy(cfg->hp_pins, cfg->line_out_pins, 1590 memcpy(cfg->hp_pins, cfg->line_out_pins,
1589 sizeof(cfg->hp_pins)); 1591 sizeof(cfg->hp_pins));
1590 cfg->hp_outs = cfg->line_outs; 1592 cfg->hp_outs = cfg->line_outs;
@@ -1603,6 +1605,7 @@ static void alc_init_auto_hp(struct hda_codec *codec)
1603 spec->automute_mode = ALC_AUTOMUTE_PIN; 1605 spec->automute_mode = ALC_AUTOMUTE_PIN;
1604 } 1606 }
1605 if (spec->automute && cfg->line_out_pins[0] && 1607 if (spec->automute && cfg->line_out_pins[0] &&
1608 cfg->speaker_pins[0] &&
1606 cfg->line_out_pins[0] != cfg->hp_pins[0] && 1609 cfg->line_out_pins[0] != cfg->hp_pins[0] &&
1607 cfg->line_out_pins[0] != cfg->speaker_pins[0]) { 1610 cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
1608 for (i = 0; i < cfg->line_outs; i++) { 1611 for (i = 0; i < cfg->line_outs; i++) {