]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Matthew Ranostay <mranostay@embeddedalley.com> |
2 | Subject: ALSA: hda: STAC_DELL_M6 EAPD | |
3 | Patch-mainline: | |
4 | References: bnc#446025 | |
5 | ||
6 | Add support for EAPD on system suspend and disabling EAPD on headphone jack | |
7 | detection for STAC_DELL_M6 laptops. | |
8 | ||
9 | This patch fixes the regressions, the silent output on HP of some Dell | |
10 | laptops (see Novell bnc#446025): | |
11 | https://bugzilla.novell.com/show_bug.cgi?id=446025 | |
12 | ||
13 | Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com> | |
14 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | |
15 | ||
16 | --- | |
17 | sound/pci/hda/patch_sigmatel.c | 15 +++++++++++++-- | |
18 | 1 file changed, 13 insertions(+), 2 deletions(-) | |
19 | ||
20 | --- a/sound/pci/hda/patch_sigmatel.c | |
21 | +++ b/sound/pci/hda/patch_sigmatel.c | |
22 | @@ -137,6 +137,7 @@ struct sigmatel_spec { | |
23 | unsigned int num_mixers; | |
24 | ||
25 | int board_config; | |
26 | + unsigned int eapd_switch: 1; | |
27 | unsigned int surr_switch: 1; | |
28 | unsigned int line_switch: 1; | |
29 | unsigned int mic_switch: 1; | |
30 | @@ -3906,7 +3907,7 @@ static void stac92xx_hp_detect(struct hd | |
31 | for (i = 0; i < cfg->speaker_outs; i++) | |
32 | stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], | |
33 | AC_PINCTL_OUT_EN); | |
34 | - if (spec->eapd_mask) | |
35 | + if (spec->eapd_mask && spec->eapd_switch) | |
36 | stac_gpio_set(codec, spec->gpio_mask, | |
37 | spec->gpio_dir, spec->gpio_data & | |
38 | ~spec->eapd_mask); | |
39 | @@ -3921,7 +3922,7 @@ static void stac92xx_hp_detect(struct hd | |
40 | for (i = 0; i < cfg->speaker_outs; i++) | |
41 | stac92xx_set_pinctl(codec, cfg->speaker_pins[i], | |
42 | AC_PINCTL_OUT_EN); | |
43 | - if (spec->eapd_mask) | |
44 | + if (spec->eapd_mask && spec->eapd_switch) | |
45 | stac_gpio_set(codec, spec->gpio_mask, | |
46 | spec->gpio_dir, spec->gpio_data | | |
47 | spec->eapd_mask); | |
48 | @@ -4250,6 +4251,7 @@ again: | |
49 | spec->num_smuxes = 0; | |
50 | spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; | |
51 | spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; | |
52 | + spec->eapd_switch = 0; | |
53 | spec->num_amps = 1; | |
54 | switch (codec->subsystem_id) { | |
55 | case 0x1028025e: /* Analog Mics */ | |
56 | @@ -4278,6 +4280,7 @@ again: | |
57 | default: | |
58 | spec->num_dmics = STAC92HD73XX_NUM_DMICS; | |
59 | spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); | |
60 | + spec->eapd_switch = 1; | |
61 | } | |
62 | if (spec->board_config > STAC_92HD73XX_REF) { | |
63 | /* GPIO0 High = Enable EAPD */ | |
64 | @@ -4423,7 +4426,13 @@ static int stac92hd71xx_resume(struct hd | |
65 | ||
66 | static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) | |
67 | { | |
68 | + struct sigmatel_spec *spec = codec->spec; | |
69 | + | |
70 | stac92hd71xx_set_power_state(codec, AC_PWRST_D3); | |
71 | + if (spec->eapd_mask) | |
72 | + stac_gpio_set(codec, spec->gpio_mask, | |
73 | + spec->gpio_dir, spec->gpio_data & | |
74 | + ~spec->eapd_mask); | |
75 | return 0; | |
76 | }; | |
77 | ||
78 | @@ -4810,6 +4819,7 @@ static int patch_stac927x(struct hda_cod | |
79 | spec->num_pwrs = 0; | |
80 | spec->aloopback_mask = 0x40; | |
81 | spec->aloopback_shift = 0; | |
82 | + spec->eapd_switch = 1; | |
83 | ||
84 | err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); | |
85 | if (!err) { | |
86 | @@ -4890,6 +4900,7 @@ static int patch_stac9205(struct hda_cod | |
87 | ||
88 | spec->aloopback_mask = 0x40; | |
89 | spec->aloopback_shift = 0; | |
90 | + spec->eapd_switch = 1; | |
91 | spec->multiout.dac_nids = spec->dac_nids; | |
92 | ||
93 | switch (spec->board_config){ |