aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMatthew Ranostay <mranostay@embeddedalley.com>2008-11-16 11:42:34 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-20 11:11:10 -0500
commit0253fdcd8aec2f954c2950a7454c0a2f3207e9a1 (patch)
tree7611a3ea5c5c4f42365fd29081b638e1810dd0d7 /sound
parentc5d08bb567874e410210cf7d21a25f28fcceb0a7 (diff)
ALSA: hda: STAC_DELL_M6 EAPD
Add support for EAPD on system suspend and disabling EAPD on headphone jack detection for STAC_DELL_M6 laptops. This patch fixes the regressions, the silent output on HP of some Dell laptops (see Novell bnc#446025): https://bugzilla.novell.com/show_bug.cgi?id=446025 Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 9563b5bbb272..31a234afe1af 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -137,6 +137,7 @@ struct sigmatel_spec {
137 unsigned int num_mixers; 137 unsigned int num_mixers;
138 138
139 int board_config; 139 int board_config;
140 unsigned int eapd_switch: 1;
140 unsigned int surr_switch: 1; 141 unsigned int surr_switch: 1;
141 unsigned int line_switch: 1; 142 unsigned int line_switch: 1;
142 unsigned int mic_switch: 1; 143 unsigned int mic_switch: 1;
@@ -3901,7 +3902,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
3901 for (i = 0; i < cfg->speaker_outs; i++) 3902 for (i = 0; i < cfg->speaker_outs; i++)
3902 stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], 3903 stac92xx_reset_pinctl(codec, cfg->speaker_pins[i],
3903 AC_PINCTL_OUT_EN); 3904 AC_PINCTL_OUT_EN);
3904 if (spec->eapd_mask) 3905 if (spec->eapd_mask && spec->eapd_switch)
3905 stac_gpio_set(codec, spec->gpio_mask, 3906 stac_gpio_set(codec, spec->gpio_mask,
3906 spec->gpio_dir, spec->gpio_data & 3907 spec->gpio_dir, spec->gpio_data &
3907 ~spec->eapd_mask); 3908 ~spec->eapd_mask);
@@ -3916,7 +3917,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
3916 for (i = 0; i < cfg->speaker_outs; i++) 3917 for (i = 0; i < cfg->speaker_outs; i++)
3917 stac92xx_set_pinctl(codec, cfg->speaker_pins[i], 3918 stac92xx_set_pinctl(codec, cfg->speaker_pins[i],
3918 AC_PINCTL_OUT_EN); 3919 AC_PINCTL_OUT_EN);
3919 if (spec->eapd_mask) 3920 if (spec->eapd_mask && spec->eapd_switch)
3920 stac_gpio_set(codec, spec->gpio_mask, 3921 stac_gpio_set(codec, spec->gpio_mask,
3921 spec->gpio_dir, spec->gpio_data | 3922 spec->gpio_dir, spec->gpio_data |
3922 spec->eapd_mask); 3923 spec->eapd_mask);
@@ -4243,6 +4244,7 @@ again:
4243 spec->num_smuxes = 0; 4244 spec->num_smuxes = 0;
4244 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; 4245 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER];
4245 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; 4246 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
4247 spec->eapd_switch = 0;
4246 spec->num_amps = 1; 4248 spec->num_amps = 1;
4247 4249
4248 if (!spec->init) 4250 if (!spec->init)
@@ -4274,6 +4276,7 @@ again:
4274 default: 4276 default:
4275 spec->num_dmics = STAC92HD73XX_NUM_DMICS; 4277 spec->num_dmics = STAC92HD73XX_NUM_DMICS;
4276 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); 4278 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids);
4279 spec->eapd_switch = 1;
4277 } 4280 }
4278 if (spec->board_config > STAC_92HD73XX_REF) { 4281 if (spec->board_config > STAC_92HD73XX_REF) {
4279 /* GPIO0 High = Enable EAPD */ 4282 /* GPIO0 High = Enable EAPD */
@@ -4419,7 +4422,13 @@ static int stac92hd71xx_resume(struct hda_codec *codec)
4419 4422
4420static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) 4423static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state)
4421{ 4424{
4425 struct sigmatel_spec *spec = codec->spec;
4426
4422 stac92hd71xx_set_power_state(codec, AC_PWRST_D3); 4427 stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
4428 if (spec->eapd_mask)
4429 stac_gpio_set(codec, spec->gpio_mask,
4430 spec->gpio_dir, spec->gpio_data &
4431 ~spec->eapd_mask);
4423 return 0; 4432 return 0;
4424}; 4433};
4425 4434
@@ -4806,6 +4815,7 @@ static int patch_stac927x(struct hda_codec *codec)
4806 spec->num_pwrs = 0; 4815 spec->num_pwrs = 0;
4807 spec->aloopback_mask = 0x40; 4816 spec->aloopback_mask = 0x40;
4808 spec->aloopback_shift = 0; 4817 spec->aloopback_shift = 0;
4818 spec->eapd_switch = 1;
4809 4819
4810 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); 4820 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20);
4811 if (!err) { 4821 if (!err) {
@@ -4886,6 +4896,7 @@ static int patch_stac9205(struct hda_codec *codec)
4886 4896
4887 spec->aloopback_mask = 0x40; 4897 spec->aloopback_mask = 0x40;
4888 spec->aloopback_shift = 0; 4898 spec->aloopback_shift = 0;
4899 spec->eapd_switch = 1;
4889 spec->multiout.dac_nids = spec->dac_nids; 4900 spec->multiout.dac_nids = spec->dac_nids;
4890 4901
4891 switch (spec->board_config){ 4902 switch (spec->board_config){