aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_realtek.c85
1 files changed, 83 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 3e594b2e1930..834dae74d7ee 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -72,6 +72,7 @@ enum {
72enum { 72enum {
73 ALC260_BASIC, 73 ALC260_BASIC,
74 ALC260_HP, 74 ALC260_HP,
75 ALC260_HP_DC7600,
75 ALC260_HP_3013, 76 ALC260_HP_3013,
76 ALC260_FUJITSU_S702X, 77 ALC260_FUJITSU_S702X,
77 ALC260_ACER, 78 ALC260_ACER,
@@ -4130,6 +4131,33 @@ static struct snd_kcontrol_new alc260_hp_3013_mixer[] = {
4130 { } /* end */ 4131 { } /* end */
4131}; 4132};
4132 4133
4134static struct hda_bind_ctls alc260_dc7600_bind_master_vol = {
4135 .ops = &snd_hda_bind_vol,
4136 .values = {
4137 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_OUTPUT),
4138 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_OUTPUT),
4139 HDA_COMPOSE_AMP_VAL(0x0a, 3, 0, HDA_OUTPUT),
4140 0
4141 },
4142};
4143
4144static struct hda_bind_ctls alc260_dc7600_bind_switch = {
4145 .ops = &snd_hda_bind_sw,
4146 .values = {
4147 HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT),
4148 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
4149 0
4150 },
4151};
4152
4153static struct snd_kcontrol_new alc260_hp_dc7600_mixer[] = {
4154 HDA_BIND_VOL("Master Playback Volume", &alc260_dc7600_bind_master_vol),
4155 HDA_BIND_SW("LineOut Playback Switch", &alc260_dc7600_bind_switch),
4156 HDA_CODEC_MUTE("Speaker Playback Switch", 0x0f, 0x0, HDA_OUTPUT),
4157 HDA_CODEC_MUTE("Headphone Playback Switch", 0x10, 0x0, HDA_OUTPUT),
4158 { } /* end */
4159};
4160
4133static struct hda_verb alc260_hp_3013_unsol_verbs[] = { 4161static struct hda_verb alc260_hp_3013_unsol_verbs[] = {
4134 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 4162 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
4135 {}, 4163 {},
@@ -4153,7 +4181,30 @@ static void alc260_hp_3013_unsol_event(struct hda_codec *codec,
4153 alc260_hp_3013_automute(codec); 4181 alc260_hp_3013_automute(codec);
4154} 4182}
4155 4183
4156/* Fujitsu S702x series laptops. ALC260 pin usage: Mic/Line jack = 0x12, 4184static void alc260_hp_3012_automute(struct hda_codec *codec)
4185{
4186 unsigned int present, bits;
4187
4188 present = snd_hda_codec_read(codec, 0x10, 0,
4189 AC_VERB_GET_PIN_SENSE, 0) & AC_PINSENSE_PRESENCE;
4190
4191 bits = present ? 0 : PIN_OUT;
4192 snd_hda_codec_write(codec, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4193 bits);
4194 snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4195 bits);
4196 snd_hda_codec_write(codec, 0x15, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4197 bits);
4198}
4199
4200static void alc260_hp_3012_unsol_event(struct hda_codec *codec,
4201 unsigned int res)
4202{
4203 if ((res >> 26) == ALC880_HP_EVENT)
4204 alc260_hp_3012_automute(codec);
4205}
4206
4207/* Fujitsu S702x series laptops. ALC260 pin usage: Mic/Line jack = 0x12,
4157 * HP jack = 0x14, CD audio = 0x16, internal speaker = 0x10. 4208 * HP jack = 0x14, CD audio = 0x16, internal speaker = 0x10.
4158 */ 4209 */
4159static struct snd_kcontrol_new alc260_fujitsu_mixer[] = { 4210static struct snd_kcontrol_new alc260_fujitsu_mixer[] = {
@@ -4681,6 +4732,20 @@ static void alc260_replacer_672v_unsol_event(struct hda_codec *codec,
4681 alc260_replacer_672v_automute(codec); 4732 alc260_replacer_672v_automute(codec);
4682} 4733}
4683 4734
4735static struct hda_verb alc260_hp_dc7600_verbs[] = {
4736 {0x05, AC_VERB_SET_CONNECT_SEL, 0x01},
4737 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
4738 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4739 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
4740 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4741 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4742 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
4743 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
4744 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
4745 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
4746 {}
4747};
4748
4684/* Test configuration for debugging, modelled after the ALC880 test 4749/* Test configuration for debugging, modelled after the ALC880 test
4685 * configuration. 4750 * configuration.
4686 */ 4751 */
@@ -5178,7 +5243,7 @@ static struct snd_pci_quirk alc260_cfg_tbl[] = {
5178 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013), 5243 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013),
5179 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013), 5244 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
5180 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013), 5245 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013),
5181 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013), 5246 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600),
5182 SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013), 5247 SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013),
5183 SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP), 5248 SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP),
5184 SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP), 5249 SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP),
@@ -5224,6 +5289,22 @@ static struct alc_config_preset alc260_presets[] = {
5224 .unsol_event = alc260_hp_unsol_event, 5289 .unsol_event = alc260_hp_unsol_event,
5225 .init_hook = alc260_hp_automute, 5290 .init_hook = alc260_hp_automute,
5226 }, 5291 },
5292 [ALC260_HP_DC7600] = {
5293 .mixers = { alc260_hp_dc7600_mixer,
5294 alc260_input_mixer,
5295 alc260_capture_alt_mixer },
5296 .init_verbs = { alc260_init_verbs,
5297 alc260_hp_dc7600_verbs },
5298 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5299 .dac_nids = alc260_dac_nids,
5300 .num_adc_nids = ARRAY_SIZE(alc260_hp_adc_nids),
5301 .adc_nids = alc260_hp_adc_nids,
5302 .num_channel_mode = ARRAY_SIZE(alc260_modes),
5303 .channel_mode = alc260_modes,
5304 .input_mux = &alc260_capture_source,
5305 .unsol_event = alc260_hp_3012_unsol_event,
5306 .init_hook = alc260_hp_3012_automute,
5307 },
5227 [ALC260_HP_3013] = { 5308 [ALC260_HP_3013] = {
5228 .mixers = { alc260_hp_3013_mixer, 5309 .mixers = { alc260_hp_3013_mixer,
5229 alc260_input_mixer, 5310 alc260_input_mixer,