]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.0.1/alsa-hda-fix-duplicated-dac-assignments-for-realtek.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.0.1 / alsa-hda-fix-duplicated-dac-assignments-for-realtek.patch
CommitLineData
7cb15094
GKH
1From c48a8fb0d31d6147d8d76b8e2ad7f51a2fbb5c4d Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Wed, 27 Jul 2011 16:41:57 +0200
4Subject: ALSA: hda - Fix duplicated DAC assignments for Realtek
5
6From: Takashi Iwai <tiwai@suse.de>
7
8commit c48a8fb0d31d6147d8d76b8e2ad7f51a2fbb5c4d upstream.
9
10Copying hp_pins and speaker_pins from line_out_pins may confuse the
11parser, and it can lead to duplicated initializations for the same pin
12with a wrong DAC assignment. The problem appears in 3.0 kernel code.
13
14Signed-off-by: Takashi Iwai <tiwai@suse.de>
15Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17---
18 sound/pci/hda/patch_realtek.c | 7 +++++--
19 1 file changed, 5 insertions(+), 2 deletions(-)
20
21--- a/sound/pci/hda/patch_realtek.c
22+++ b/sound/pci/hda/patch_realtek.c
23@@ -1578,13 +1578,15 @@ static void alc_init_auto_hp(struct hda_
24 if (present == 3)
25 spec->automute_hp_lo = 1; /* both HP and LO automute */
26
27- if (!cfg->speaker_pins[0]) {
28+ if (!cfg->speaker_pins[0] &&
29+ cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
30 memcpy(cfg->speaker_pins, cfg->line_out_pins,
31 sizeof(cfg->speaker_pins));
32 cfg->speaker_outs = cfg->line_outs;
33 }
34
35- if (!cfg->hp_pins[0]) {
36+ if (!cfg->hp_pins[0] &&
37+ cfg->line_out_type == AUTO_PIN_HP_OUT) {
38 memcpy(cfg->hp_pins, cfg->line_out_pins,
39 sizeof(cfg->hp_pins));
40 cfg->hp_outs = cfg->line_outs;
41@@ -1603,6 +1605,7 @@ static void alc_init_auto_hp(struct hda_
42 spec->automute_mode = ALC_AUTOMUTE_PIN;
43 }
44 if (spec->automute && cfg->line_out_pins[0] &&
45+ cfg->speaker_pins[0] &&
46 cfg->line_out_pins[0] != cfg->hp_pins[0] &&
47 cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
48 for (i = 0; i < cfg->line_outs; i++) {