aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-03 09:03:35 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-03 09:03:35 -0400
commite488fca79fd0e864e993745ebda99e93dffebda8 (patch)
treeff3f53a5e3f5bfeaee107b1030f7913b6aa63bbf /sound
parent8ab9e0af6d7709a781b60a51711ddf1d43bd22bb (diff)
parentaa202455eec51699e44f658530728162cefa1307 (diff)
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_analog.c27
-rw-r--r--sound/pci/hda/patch_realtek.c24
2 files changed, 31 insertions, 20 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
3749static 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
3749static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { 3762static 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
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 07e260a5ddf0..de72b72f58f4 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -12427,20 +12427,11 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = {
12427 { } 12427 { }
12428}; 12428};
12429 12429
12430/* bind volumes of both NID 0x0c and 0x0d */
12431static struct hda_bind_ctls alc269_epc_bind_vol = {
12432 .ops = &snd_hda_bind_vol,
12433 .values = {
12434 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
12435 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT),
12436 0
12437 },
12438};
12439
12440static struct snd_kcontrol_new alc269_eeepc_mixer[] = { 12430static struct snd_kcontrol_new alc269_eeepc_mixer[] = {
12441 HDA_CODEC_MUTE("iSpeaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 12431 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12442 HDA_BIND_VOL("LineOut Playback Volume", &alc269_epc_bind_vol), 12432 HDA_CODEC_MUTE("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
12443 HDA_CODEC_MUTE("LineOut Playback Switch", 0x15, 0x0, HDA_OUTPUT), 12433 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12434 HDA_CODEC_MUTE("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
12444 { } /* end */ 12435 { } /* end */
12445}; 12436};
12446 12437
@@ -12453,12 +12444,7 @@ static struct snd_kcontrol_new alc269_epc_capture_mixer[] = {
12453}; 12444};
12454 12445
12455/* FSC amilo */ 12446/* FSC amilo */
12456static struct snd_kcontrol_new alc269_fujitsu_mixer[] = { 12447#define alc269_fujitsu_mixer alc269_eeepc_mixer
12457 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12458 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12459 HDA_BIND_VOL("PCM Playback Volume", &alc269_epc_bind_vol),
12460 { } /* end */
12461};
12462 12448
12463static struct hda_verb alc269_quanta_fl1_verbs[] = { 12449static struct hda_verb alc269_quanta_fl1_verbs[] = {
12464 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 12450 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},