diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-07-03 09:03:35 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-07-03 09:03:35 -0400 |
commit | e488fca79fd0e864e993745ebda99e93dffebda8 (patch) | |
tree | ff3f53a5e3f5bfeaee107b1030f7913b6aa63bbf /sound/pci/hda/patch_analog.c | |
parent | 8ab9e0af6d7709a781b60a51711ddf1d43bd22bb (diff) | |
parent | aa202455eec51699e44f658530728162cefa1307 (diff) |
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index ad700761a561..be7d25fa7f35 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3746,9 +3746,30 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { | |||
3746 | { } /* end */ | 3746 | { } /* end */ |
3747 | }; | 3747 | }; |
3748 | 3748 | ||
3749 | static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, | ||
3750 | struct snd_ctl_elem_value *ucontrol) | ||
3751 | { | ||
3752 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | ||
3753 | int ret = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | ||
3754 | int mute = (!ucontrol->value.integer.value[0] && | ||
3755 | !ucontrol->value.integer.value[1]); | ||
3756 | /* toggle GPIO1 according to the mute state */ | ||
3757 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | ||
3758 | mute ? 0x02 : 0x0); | ||
3759 | return ret; | ||
3760 | } | ||
3761 | |||
3749 | static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { | 3762 | static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { |
3750 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 3763 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
3751 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), | 3764 | /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ |
3765 | { | ||
3766 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
3767 | .name = "Master Playback Switch", | ||
3768 | .info = snd_hda_mixer_amp_switch_info, | ||
3769 | .get = snd_hda_mixer_amp_switch_get, | ||
3770 | .put = ad1884a_mobile_master_sw_put, | ||
3771 | .private_value = HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT), | ||
3772 | }, | ||
3752 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), | 3773 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), |
3753 | HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), | 3774 | HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), |
3754 | HDA_CODEC_VOLUME("Mic Capture Volume", 0x14, 0x0, HDA_INPUT), | 3775 | HDA_CODEC_VOLUME("Mic Capture Volume", 0x14, 0x0, HDA_INPUT), |
@@ -3869,6 +3890,10 @@ static struct hda_verb ad1884a_mobile_verbs[] = { | |||
3869 | /* unsolicited event for pin-sense */ | 3890 | /* unsolicited event for pin-sense */ |
3870 | {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_HP_EVENT}, | 3891 | {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_HP_EVENT}, |
3871 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_MIC_EVENT}, | 3892 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_MIC_EVENT}, |
3893 | /* allow to touch GPIO1 (for mute control) */ | ||
3894 | {0x01, AC_VERB_SET_GPIO_MASK, 0x02}, | ||
3895 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02}, | ||
3896 | {0x01, AC_VERB_SET_GPIO_DATA, 0x02}, /* first muted */ | ||
3872 | { } /* end */ | 3897 | { } /* end */ |
3873 | }; | 3898 | }; |
3874 | 3899 | ||