diff options
author | Matthew Ranostay <mranostay@embeddedalley.com> | 2008-11-16 11:42:34 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-17 03:56:35 -0500 |
commit | c0cea0d09d15350c398e2951e7cf4d6f0fc98977 (patch) | |
tree | ea73f438dd2d6b640bb53b0c8113c1dff2d78dc6 /sound/pci/hda/patch_sigmatel.c | |
parent | 3ab909351a3c653a879a35b3342979ac483c0460 (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.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 6d9c634632d4..1aa3f6cbcb96 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -147,6 +147,7 @@ struct sigmatel_spec { | |||
147 | unsigned int num_mixers; | 147 | unsigned int num_mixers; |
148 | 148 | ||
149 | int board_config; | 149 | int board_config; |
150 | unsigned int eapd_switch: 1; | ||
150 | unsigned int surr_switch: 1; | 151 | unsigned int surr_switch: 1; |
151 | unsigned int line_switch: 1; | 152 | unsigned int line_switch: 1; |
152 | unsigned int mic_switch: 1; | 153 | unsigned int mic_switch: 1; |
@@ -4001,7 +4002,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | |||
4001 | for (i = 0; i < cfg->speaker_outs; i++) | 4002 | for (i = 0; i < cfg->speaker_outs; i++) |
4002 | stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], | 4003 | stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], |
4003 | AC_PINCTL_OUT_EN); | 4004 | AC_PINCTL_OUT_EN); |
4004 | if (spec->eapd_mask) | 4005 | if (spec->eapd_mask && spec->eapd_switch) |
4005 | stac_gpio_set(codec, spec->gpio_mask, | 4006 | stac_gpio_set(codec, spec->gpio_mask, |
4006 | spec->gpio_dir, spec->gpio_data & | 4007 | spec->gpio_dir, spec->gpio_data & |
4007 | ~spec->eapd_mask); | 4008 | ~spec->eapd_mask); |
@@ -4016,7 +4017,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | |||
4016 | for (i = 0; i < cfg->speaker_outs; i++) | 4017 | for (i = 0; i < cfg->speaker_outs; i++) |
4017 | stac92xx_set_pinctl(codec, cfg->speaker_pins[i], | 4018 | stac92xx_set_pinctl(codec, cfg->speaker_pins[i], |
4018 | AC_PINCTL_OUT_EN); | 4019 | AC_PINCTL_OUT_EN); |
4019 | if (spec->eapd_mask) | 4020 | if (spec->eapd_mask && spec->eapd_switch) |
4020 | stac_gpio_set(codec, spec->gpio_mask, | 4021 | stac_gpio_set(codec, spec->gpio_mask, |
4021 | spec->gpio_dir, spec->gpio_data | | 4022 | spec->gpio_dir, spec->gpio_data | |
4022 | spec->eapd_mask); | 4023 | spec->eapd_mask); |
@@ -4376,6 +4377,7 @@ again: | |||
4376 | spec->num_smuxes = 0; | 4377 | spec->num_smuxes = 0; |
4377 | spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; | 4378 | spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; |
4378 | spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; | 4379 | spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; |
4380 | spec->eapd_switch = 0; | ||
4379 | spec->num_amps = 1; | 4381 | spec->num_amps = 1; |
4380 | 4382 | ||
4381 | if (!spec->init) | 4383 | if (!spec->init) |
@@ -4407,6 +4409,7 @@ again: | |||
4407 | default: | 4409 | default: |
4408 | spec->num_dmics = STAC92HD73XX_NUM_DMICS; | 4410 | spec->num_dmics = STAC92HD73XX_NUM_DMICS; |
4409 | spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); | 4411 | spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); |
4412 | spec->eapd_switch = 1; | ||
4410 | } | 4413 | } |
4411 | if (spec->board_config > STAC_92HD73XX_REF) { | 4414 | if (spec->board_config > STAC_92HD73XX_REF) { |
4412 | /* GPIO0 High = Enable EAPD */ | 4415 | /* GPIO0 High = Enable EAPD */ |
@@ -4552,7 +4555,13 @@ static int stac92hd71xx_resume(struct hda_codec *codec) | |||
4552 | 4555 | ||
4553 | static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) | 4556 | static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) |
4554 | { | 4557 | { |
4558 | struct sigmatel_spec *spec = codec->spec; | ||
4559 | |||
4555 | stac92hd71xx_set_power_state(codec, AC_PWRST_D3); | 4560 | stac92hd71xx_set_power_state(codec, AC_PWRST_D3); |
4561 | if (spec->eapd_mask) | ||
4562 | stac_gpio_set(codec, spec->gpio_mask, | ||
4563 | spec->gpio_dir, spec->gpio_data & | ||
4564 | ~spec->eapd_mask); | ||
4556 | return 0; | 4565 | return 0; |
4557 | }; | 4566 | }; |
4558 | 4567 | ||
@@ -4942,6 +4951,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
4942 | spec->num_pwrs = 0; | 4951 | spec->num_pwrs = 0; |
4943 | spec->aloopback_mask = 0x40; | 4952 | spec->aloopback_mask = 0x40; |
4944 | spec->aloopback_shift = 0; | 4953 | spec->aloopback_shift = 0; |
4954 | spec->eapd_switch = 1; | ||
4945 | 4955 | ||
4946 | err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); | 4956 | err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); |
4947 | if (!err) { | 4957 | if (!err) { |
@@ -5022,6 +5032,7 @@ static int patch_stac9205(struct hda_codec *codec) | |||
5022 | 5032 | ||
5023 | spec->aloopback_mask = 0x40; | 5033 | spec->aloopback_mask = 0x40; |
5024 | spec->aloopback_shift = 0; | 5034 | spec->aloopback_shift = 0; |
5035 | spec->eapd_switch = 1; | ||
5025 | spec->multiout.dac_nids = spec->dac_nids; | 5036 | spec->multiout.dac_nids = spec->dac_nids; |
5026 | 5037 | ||
5027 | switch (spec->board_config){ | 5038 | switch (spec->board_config){ |