aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-07-04 08:32:16 -0400
committerTakashi Iwai <tiwai@suse.de>2013-07-04 08:32:16 -0400
commit1a39b5e1f932b0ab292c1737724f17bd6a73d630 (patch)
treecf1b84fc643da0cdf380f6522887a3ade2b5d546 /sound/pci/hda/patch_analog.c
parent8f0b3b7e222383a21f7d58bd97d5552b3a5dbced (diff)
ALSA: hda - Add GPIO control to AD1884 HP fixup
The AD1884 HP laptop/mobile quirks control GPIO1 bit as the primary mute as well. Add the similar control to ad1884 fixup for auto parser, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index d97f0d61a15b..2ae7dc54ab1d 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3599,14 +3599,34 @@ static void ad1884_fixup_amp_override(struct hda_codec *codec,
3599 (1 << AC_AMPCAP_MUTE_SHIFT)); 3599 (1 << AC_AMPCAP_MUTE_SHIFT));
3600} 3600}
3601 3601
3602/* toggle GPIO1 according to the mute state */
3603static void ad1884_vmaster_hp_gpio_hook(void *private_data, int enabled)
3604{
3605 struct hda_codec *codec = private_data;
3606 struct ad198x_spec *spec = codec->spec;
3607
3608 if (spec->eapd_nid)
3609 ad_vmaster_eapd_hook(private_data, enabled);
3610 snd_hda_codec_update_cache(codec, 0x01, 0,
3611 AC_VERB_SET_GPIO_DATA,
3612 enabled ? 0x00 : 0x02);
3613}
3614
3602static void ad1884_fixup_hp_eapd(struct hda_codec *codec, 3615static void ad1884_fixup_hp_eapd(struct hda_codec *codec,
3603 const struct hda_fixup *fix, int action) 3616 const struct hda_fixup *fix, int action)
3604{ 3617{
3605 struct ad198x_spec *spec = codec->spec; 3618 struct ad198x_spec *spec = codec->spec;
3619 static const struct hda_verb gpio_init_verbs[] = {
3620 {0x01, AC_VERB_SET_GPIO_MASK, 0x02},
3621 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02},
3622 {0x01, AC_VERB_SET_GPIO_DATA, 0x02},
3623 {},
3624 };
3606 3625
3607 switch (action) { 3626 switch (action) {
3608 case HDA_FIXUP_ACT_PRE_PROBE: 3627 case HDA_FIXUP_ACT_PRE_PROBE:
3609 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; 3628 spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook;
3629 snd_hda_sequence_write_cache(codec, gpio_init_verbs);
3610 break; 3630 break;
3611 case HDA_FIXUP_ACT_PROBE: 3631 case HDA_FIXUP_ACT_PROBE:
3612 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) 3632 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)