aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 79eb0c17d453..e484f6092c67 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -8051,43 +8051,20 @@ static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = {
8051 { } /* end */ 8051 { } /* end */
8052}; 8052};
8053 8053
8054static struct hda_bind_ctls alc262_hp_t5735_bind_front_vol = {
8055 .ops = &snd_hda_bind_vol,
8056 .values = {
8057 HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT),
8058 HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT),
8059 0
8060 },
8061};
8062
8063static struct hda_bind_ctls alc262_hp_t5735_bind_front_sw = {
8064 .ops = &snd_hda_bind_sw,
8065 .values = {
8066 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
8067 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
8068 0
8069 },
8070};
8071
8072/* mute/unmute internal speaker according to the hp jack and mute state */ 8054/* mute/unmute internal speaker according to the hp jack and mute state */
8073static void alc262_hp_t5735_automute(struct hda_codec *codec, int force) 8055static void alc262_hp_t5735_automute(struct hda_codec *codec, int force)
8074{ 8056{
8075 struct alc_spec *spec = codec->spec; 8057 struct alc_spec *spec = codec->spec;
8076 unsigned int mute;
8077 8058
8078 if (force || !spec->sense_updated) { 8059 if (force || !spec->sense_updated) {
8079 unsigned int present; 8060 unsigned int present;
8080 present = snd_hda_codec_read(codec, 0x15, 0, 8061 present = snd_hda_codec_read(codec, 0x15, 0,
8081 AC_VERB_GET_PIN_SENSE, 0); 8062 AC_VERB_GET_PIN_SENSE, 0);
8082 spec->jack_present = (present & 0x80000000) != 0; 8063 spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0;
8083 spec->sense_updated = 1; 8064 spec->sense_updated = 1;
8084 } 8065 }
8085 if (spec->jack_present) 8066 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0, HDA_AMP_MUTE,
8086 mute = (0x7080 | ((0)<<8)); /* mute internal speaker */ 8067 spec->jack_present ? HDA_AMP_MUTE : 0);
8087 else /* unmute internal speaker if necessary */
8088 mute = (0x7000 | ((0)<<8));
8089 snd_hda_codec_write(codec, 0x0c, 0,
8090 AC_VERB_SET_AMP_GAIN_MUTE, mute );
8091} 8068}
8092 8069
8093static void alc262_hp_t5735_unsol_event(struct hda_codec *codec, 8070static void alc262_hp_t5735_unsol_event(struct hda_codec *codec,
@@ -8104,10 +8081,6 @@ static void alc262_hp_t5735_init_hook(struct hda_codec *codec)
8104} 8081}
8105 8082
8106static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = { 8083static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
8107 HDA_BIND_VOL("PCM Playback Volume", &alc262_hp_t5735_bind_front_vol),
8108 HDA_BIND_SW("PCM Playback Switch",&alc262_hp_t5735_bind_front_sw),
8109 HDA_CODEC_VOLUME("LineOut Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8110 HDA_CODEC_MUTE("LineOut Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8111 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 8084 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8112 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 8085 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8113 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT), 8086 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),