]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.1.10/alsa-hda-fix-the-lost-power-setup-of-seconary-pins-after-pm-resume.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.10 / alsa-hda-fix-the-lost-power-setup-of-seconary-pins-after-pm-resume.patch
1 From f2cbba7602383cd9cdd21f0a5d0b8bd1aad47b33 Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Wed, 11 Jan 2012 12:34:11 +0100
4 Subject: ALSA: hda - Fix the lost power-setup of seconary pins after PM resume
5
6 From: Takashi Iwai <tiwai@suse.de>
7
8 commit f2cbba7602383cd9cdd21f0a5d0b8bd1aad47b33 upstream.
9
10 When multiple headphone or other detectable output pins are present,
11 the power-map has to be updated after resume appropriately, but the
12 current driver doesn't check all pins but only the first pin (since
13 it's enough to check it for the mute-behavior). This resulted in the
14 silent output from the secondary outputs after PM resume.
15
16 This patch fixes the problem by checking all pins at (re-)init time.
17
18 Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=740347
19
20 Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23 ---
24 sound/pci/hda/patch_sigmatel.c | 36 +++++++++++++++++++++++-------------
25 1 file changed, 23 insertions(+), 13 deletions(-)
26
27 --- a/sound/pci/hda/patch_sigmatel.c
28 +++ b/sound/pci/hda/patch_sigmatel.c
29 @@ -4306,6 +4306,27 @@ static void stac_store_hints(struct hda_
30 }
31 }
32
33 +static void stac_issue_unsol_events(struct hda_codec *codec, int num_pins,
34 + const hda_nid_t *pins)
35 +{
36 + while (num_pins--)
37 + stac_issue_unsol_event(codec, *pins++);
38 +}
39 +
40 +/* fake event to set up pins */
41 +static void stac_fake_hp_events(struct hda_codec *codec)
42 +{
43 + struct sigmatel_spec *spec = codec->spec;
44 +
45 + if (spec->autocfg.hp_outs)
46 + stac_issue_unsol_events(codec, spec->autocfg.hp_outs,
47 + spec->autocfg.hp_pins);
48 + if (spec->autocfg.line_outs &&
49 + spec->autocfg.line_out_pins[0] != spec->autocfg.hp_pins[0])
50 + stac_issue_unsol_events(codec, spec->autocfg.line_outs,
51 + spec->autocfg.line_out_pins);
52 +}
53 +
54 static int stac92xx_init(struct hda_codec *codec)
55 {
56 struct sigmatel_spec *spec = codec->spec;
57 @@ -4356,10 +4377,7 @@ static int stac92xx_init(struct hda_code
58 stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0],
59 AC_PINCTL_OUT_EN);
60 /* fake event to set up pins */
61 - if (cfg->hp_pins[0])
62 - stac_issue_unsol_event(codec, cfg->hp_pins[0]);
63 - else if (cfg->line_out_pins[0])
64 - stac_issue_unsol_event(codec, cfg->line_out_pins[0]);
65 + stac_fake_hp_events(codec);
66 } else {
67 stac92xx_auto_init_multi_out(codec);
68 stac92xx_auto_init_hp_out(codec);
69 @@ -5000,19 +5018,11 @@ static void stac927x_proc_hook(struct sn
70 #ifdef CONFIG_PM
71 static int stac92xx_resume(struct hda_codec *codec)
72 {
73 - struct sigmatel_spec *spec = codec->spec;
74 -
75 stac92xx_init(codec);
76 snd_hda_codec_resume_amp(codec);
77 snd_hda_codec_resume_cache(codec);
78 /* fake event to set up pins again to override cached values */
79 - if (spec->hp_detect) {
80 - if (spec->autocfg.hp_pins[0])
81 - stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
82 - else if (spec->autocfg.line_out_pins[0])
83 - stac_issue_unsol_event(codec,
84 - spec->autocfg.line_out_pins[0]);
85 - }
86 + stac_fake_hp_events(codec);
87 return 0;
88 }
89