[ALSA] hda-codec - Fix ALC882/861VD codec support on some laptops

Fixed some platform no sound and Add JD Function for below platform list:
Sony(0x104d) 0x9015, 0x900e, 0x1f00
Toshiba(0x1179) DALLAS 0xff00, 0xff01
Targa(0x1462) 0x28fb
Asus(0x1043) A7J 0x060d
Lenovo(0x17aa) 0x3bfd, 0x2085
MEDION(0x17c0) MD2 0x4071

Signed-off-by: Kailang Yang <kailang@realtek.com.tw>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>

authored by Kailang Yang and committed by Jaroslav Kysela 272a527c a68660e0

+515 -17
+515 -17
sound/pci/hda/patch_realtek.c
··· 93 ALC262_HP_BPC_D7000_WL, 94 ALC262_HP_BPC_D7000_WF, 95 ALC262_BENQ_ED8, 96 ALC262_AUTO, 97 ALC262_MODEL_LAST /* last tag */ 98 }; ··· 119 ALC861VD_3ST_DIG, 120 ALC861VD_6ST_DIG, 121 ALC861VD_LENOVO, 122 ALC861VD_AUTO, 123 ALC861VD_MODEL_LAST, 124 }; ··· 141 ALC882_6ST_DIG, 142 ALC882_ARIMA, 143 ALC882_W2JC, 144 - ALC882_AUTO, 145 ALC885_MACPRO, 146 ALC882_MODEL_LAST, 147 }; 148 ··· 156 ALC883_6ST_DIG, 157 ALC883_TARGA_DIG, 158 ALC883_TARGA_2ch_DIG, 159 - ALC888_DEMO_BOARD, 160 ALC883_ACER, 161 ALC883_MEDION, 162 ALC883_LAPTOP_EAPD, 163 ALC883_LENOVO_101E_2ch, 164 ALC883_AUTO, 165 ALC883_MODEL_LAST, 166 }; ··· 4759 } 4760 4761 /* 4762 * 6ch mode 4763 */ 4764 static struct hda_verb alc882_sixstack_ch6_init[] = { ··· 4856 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4857 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 4858 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 4859 { } /* end */ 4860 }; 4861 ··· 5052 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 5053 5054 { } 5055 }; 5056 5057 static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) ··· 5281 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG), 5282 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), 5283 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), 5284 SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), 5285 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), 5286 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), 5287 {} ··· 5345 .channel_mode = alc882_ch_modes, 5346 .input_mux = &alc882_capture_source, 5347 }, 5348 }; 5349 5350 ··· 5599 .items = { 5600 { "Mic", 0x1 }, 5601 { "Line", 0x2 }, 5602 }, 5603 }; 5604 ··· 5943 { } /* end */ 5944 }; 5945 5946 static struct snd_kcontrol_new alc883_chmode_mixer[] = { 5947 { 5948 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ··· 6108 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT|AC_USRSP_EN}, 6109 { } /* end */ 6110 }; 6111 6112 /* toggle speaker-output according to the hp-jack state */ 6113 static void alc883_tagra_automute(struct hda_codec *codec) ··· 6361 [ALC883_6ST_DIG] = "6stack-dig", 6362 [ALC883_TARGA_DIG] = "targa-dig", 6363 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", 6364 - [ALC888_DEMO_BOARD] = "6stack-dig-demo", 6365 [ALC883_ACER] = "acer", 6366 [ALC883_MEDION] = "medion", 6367 [ALC883_LAPTOP_EAPD] = "laptop-eapd", 6368 [ALC883_LENOVO_101E_2ch] = "lenovo-101e", 6369 [ALC883_AUTO] = "auto", 6370 }; 6371 ··· 6394 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 6395 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 6396 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 6397 - SND_PCI_QUIRK(0x17aa, 0x101e, "lenovo 101e", ALC883_LENOVO_101E_2ch), 6398 {} 6399 }; 6400 ··· 6483 .unsol_event = alc883_tagra_unsol_event, 6484 .init_hook = alc883_tagra_automute, 6485 }, 6486 - [ALC888_DEMO_BOARD] = { 6487 - .mixers = { alc883_base_mixer, alc883_chmode_mixer }, 6488 - .init_verbs = { alc883_init_verbs }, 6489 - .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6490 - .dac_nids = alc883_dac_nids, 6491 - .dig_out_nid = ALC883_DIGOUT_NID, 6492 - .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6493 - .adc_nids = alc883_adc_nids, 6494 - .dig_in_nid = ALC883_DIGIN_NID, 6495 - .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 6496 - .channel_mode = alc883_sixstack_modes, 6497 - .input_mux = &alc883_capture_source, 6498 - }, 6499 [ALC883_ACER] = { 6500 .mixers = { alc883_base_mixer, 6501 alc883_chmode_mixer }, ··· 6513 .channel_mode = alc883_sixstack_modes, 6514 .input_mux = &alc883_capture_source, 6515 }, 6516 [ALC883_LAPTOP_EAPD] = { 6517 .mixers = { alc883_base_mixer, 6518 alc883_chmode_mixer }, ··· 6552 .unsol_event = alc883_lenovo_101e_unsol_event, 6553 .init_hook = alc883_lenovo_101e_all_automute, 6554 }, 6555 }; 6556 6557 ··· 6844 { } /* end */ 6845 }; 6846 6847 #define alc262_capture_mixer alc882_capture_mixer 6848 #define alc262_capture_alt_mixer alc882_capture_alt_mixer 6849 ··· 6952 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 6953 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 6954 {} 6955 }; 6956 6957 /* mute/unmute internal speaker according to the hp jack and mute state */ ··· 7581 [ALC262_HP_BPC] = "hp-bpc", 7582 [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", 7583 [ALC262_BENQ_ED8] = "benq", 7584 [ALC262_AUTO] = "auto", 7585 }; 7586 ··· 7603 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), 7604 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), 7605 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), 7606 {} 7607 }; 7608 ··· 7697 .channel_mode = alc262_modes, 7698 .input_mux = &alc262_capture_source, 7699 }, 7700 }; 7701 7702 static int patch_alc262(struct hda_codec *codec) ··· 8980 }, 8981 }; 8982 8983 #define alc861vd_mux_enum_info alc_mux_enum_info 8984 #define alc861vd_mux_enum_get alc_mux_enum_get 8985 ··· 9169 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 9170 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 9171 9172 { } /* end */ 9173 }; 9174 ··· 9387 } 9388 } 9389 9390 /* pcm configuration: identiacal with ALC880 */ 9391 #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback 9392 #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture ··· 9466 [ALC861VD_3ST_DIG] = "3stack-digout", 9467 [ALC861VD_6ST_DIG] = "6stack-digout", 9468 [ALC861VD_LENOVO] = "lenovo", 9469 [ALC861VD_AUTO] = "auto", 9470 }; 9471 ··· 9476 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 9477 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), 9478 9479 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), 9480 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), 9481 {} ··· 9544 .unsol_event = alc861vd_lenovo_unsol_event, 9545 .init_hook = alc861vd_lenovo_automute, 9546 }, 9547 }; 9548 9549 /*
··· 93 ALC262_HP_BPC_D7000_WL, 94 ALC262_HP_BPC_D7000_WF, 95 ALC262_BENQ_ED8, 96 + ALC262_SONY_ASSAMD, 97 ALC262_AUTO, 98 ALC262_MODEL_LAST /* last tag */ 99 }; ··· 118 ALC861VD_3ST_DIG, 119 ALC861VD_6ST_DIG, 120 ALC861VD_LENOVO, 121 + ALC861VD_DALLAS, 122 ALC861VD_AUTO, 123 ALC861VD_MODEL_LAST, 124 }; ··· 139 ALC882_6ST_DIG, 140 ALC882_ARIMA, 141 ALC882_W2JC, 142 + ALC882_TARGA, 143 + ALC882_ASUS_A7J, 144 ALC885_MACPRO, 145 + ALC882_AUTO, 146 ALC882_MODEL_LAST, 147 }; 148 ··· 152 ALC883_6ST_DIG, 153 ALC883_TARGA_DIG, 154 ALC883_TARGA_2ch_DIG, 155 ALC883_ACER, 156 ALC883_MEDION, 157 + ALC883_MEDION_MD2, 158 ALC883_LAPTOP_EAPD, 159 ALC883_LENOVO_101E_2ch, 160 + ALC883_LENOVO_NB0763, 161 + ALC888_LENOVO_MS7195_DIG, 162 ALC883_AUTO, 163 ALC883_MODEL_LAST, 164 }; ··· 4753 } 4754 4755 /* 4756 + * 2ch mode 4757 + */ 4758 + static struct hda_verb alc882_3ST_ch2_init[] = { 4759 + { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, 4760 + { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 4761 + { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 4762 + { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 4763 + { } /* end */ 4764 + }; 4765 + 4766 + /* 4767 + * 6ch mode 4768 + */ 4769 + static struct hda_verb alc882_3ST_ch6_init[] = { 4770 + { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 4771 + { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 4772 + { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 }, 4773 + { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 4774 + { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 4775 + { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 }, 4776 + { } /* end */ 4777 + }; 4778 + 4779 + static struct hda_channel_mode alc882_3ST_6ch_modes[2] = { 4780 + { 2, alc882_3ST_ch2_init }, 4781 + { 6, alc882_3ST_ch6_init }, 4782 + }; 4783 + 4784 + /* 4785 * 6ch mode 4786 */ 4787 static struct hda_verb alc882_sixstack_ch6_init[] = { ··· 4821 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4822 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 4823 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 4824 + { } /* end */ 4825 + }; 4826 + 4827 + static struct snd_kcontrol_new alc882_targa_mixer[] = { 4828 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 4829 + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 4830 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), 4831 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 4832 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 4833 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 4834 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 4835 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 4836 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4837 + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 4838 + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 4839 + { } /* end */ 4840 + }; 4841 + 4842 + /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ??? 4843 + * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c 4844 + */ 4845 + static struct snd_kcontrol_new alc882_asus_a7j_mixer[] = { 4846 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 4847 + HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), 4848 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), 4849 + HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT), 4850 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 4851 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 4852 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 4853 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 4854 + HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT), 4855 + HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT), 4856 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 4857 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4858 { } /* end */ 4859 }; 4860 ··· 4983 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 4984 4985 { } 4986 + }; 4987 + 4988 + static struct hda_verb alc882_targa_verbs[] = { 4989 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4990 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4991 + 4992 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 4993 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 4994 + 4995 + {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ 4996 + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */ 4997 + {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 4998 + 4999 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5000 + {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, 5001 + {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03}, 5002 + {0x01, AC_VERB_SET_GPIO_DATA, 0x03}, 5003 + { } /* end */ 5004 + }; 5005 + 5006 + /* toggle speaker-output according to the hp-jack state */ 5007 + static void alc882_targa_automute(struct hda_codec *codec) 5008 + { 5009 + unsigned int present; 5010 + 5011 + present = snd_hda_codec_read(codec, 0x14, 0, 5012 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5013 + snd_hda_codec_amp_update(codec, 0x1b, 0, HDA_OUTPUT, 0, 5014 + 0x80, present ? 0x80 : 0); 5015 + snd_hda_codec_amp_update(codec, 0x1b, 1, HDA_OUTPUT, 0, 5016 + 0x80, present ? 0x80 : 0); 5017 + snd_hda_codec_write(codec, 1, 0, AC_VERB_SET_GPIO_DATA, present ? 1 : 3); 5018 + } 5019 + 5020 + static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res) 5021 + { 5022 + /* Looks like the unsol event is incompatible with the standard 5023 + * definition. 4bit tag is placed at 26 bit! 5024 + */ 5025 + if (((res >> 26) == ALC880_HP_EVENT)) { 5026 + alc882_targa_automute(codec); 5027 + } 5028 + } 5029 + 5030 + static struct hda_verb alc882_asus_a7j_verbs[] = { 5031 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5032 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5033 + 5034 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5035 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 5036 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 5037 + 5038 + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */ 5039 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 5040 + {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */ 5041 + 5042 + {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ 5043 + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */ 5044 + {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 5045 + { } /* end */ 5046 }; 5047 5048 static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) ··· 5152 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG), 5153 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), 5154 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), 5155 + SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ 5156 SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), 5157 + SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J), 5158 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), 5159 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), 5160 {} ··· 5214 .channel_mode = alc882_ch_modes, 5215 .input_mux = &alc882_capture_source, 5216 }, 5217 + [ALC882_TARGA] = { 5218 + .mixers = { alc882_targa_mixer, alc882_chmode_mixer, 5219 + alc882_capture_mixer }, 5220 + .init_verbs = { alc882_init_verbs, alc882_targa_verbs}, 5221 + .num_dacs = ARRAY_SIZE(alc882_dac_nids), 5222 + .dac_nids = alc882_dac_nids, 5223 + .dig_out_nid = ALC882_DIGOUT_NID, 5224 + .num_adc_nids = ARRAY_SIZE(alc882_adc_nids), 5225 + .adc_nids = alc882_adc_nids, 5226 + .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes), 5227 + .channel_mode = alc882_3ST_6ch_modes, 5228 + .need_dac_fix = 1, 5229 + .input_mux = &alc882_capture_source, 5230 + .unsol_event = alc882_targa_unsol_event, 5231 + .init_hook = alc882_targa_automute, 5232 + }, 5233 + [ALC882_ASUS_A7J] = { 5234 + .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer, 5235 + alc882_capture_mixer }, 5236 + .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs}, 5237 + .num_dacs = ARRAY_SIZE(alc882_dac_nids), 5238 + .dac_nids = alc882_dac_nids, 5239 + .dig_out_nid = ALC882_DIGOUT_NID, 5240 + .num_adc_nids = ARRAY_SIZE(alc882_adc_nids), 5241 + .adc_nids = alc882_adc_nids, 5242 + .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes), 5243 + .channel_mode = alc882_3ST_6ch_modes, 5244 + .need_dac_fix = 1, 5245 + .input_mux = &alc882_capture_source, 5246 + }, 5247 }; 5248 5249 ··· 5438 .items = { 5439 { "Mic", 0x1 }, 5440 { "Line", 0x2 }, 5441 + }, 5442 + }; 5443 + 5444 + static struct hda_input_mux alc883_lenovo_nb0763_capture_source = { 5445 + .num_items = 4, 5446 + .items = { 5447 + { "Mic", 0x0 }, 5448 + { "iMic", 0x1 }, 5449 + { "Line", 0x2 }, 5450 + { "CD", 0x4 }, 5451 }, 5452 }; 5453 ··· 5772 { } /* end */ 5773 }; 5774 5775 + static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = { 5776 + HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 5777 + HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT), 5778 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), 5779 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 5780 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 5781 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5782 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5783 + HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT), 5784 + HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT), 5785 + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 5786 + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 5787 + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 5788 + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), 5789 + { 5790 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 5791 + /* .name = "Capture Source", */ 5792 + .name = "Input Source", 5793 + .count = 2, 5794 + .info = alc883_mux_enum_info, 5795 + .get = alc883_mux_enum_get, 5796 + .put = alc883_mux_enum_put, 5797 + }, 5798 + { } /* end */ 5799 + }; 5800 + 5801 + static struct snd_kcontrol_new alc883_medion_md2_mixer[] = { 5802 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 5803 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), 5804 + HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), 5805 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 5806 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 5807 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5808 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5809 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 5810 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 5811 + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 5812 + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 5813 + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 5814 + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), 5815 + { 5816 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 5817 + /* .name = "Capture Source", */ 5818 + .name = "Input Source", 5819 + .count = 2, 5820 + .info = alc883_mux_enum_info, 5821 + .get = alc883_mux_enum_get, 5822 + .put = alc883_mux_enum_put, 5823 + }, 5824 + { } /* end */ 5825 + }; 5826 + 5827 static struct snd_kcontrol_new alc883_chmode_mixer[] = { 5828 { 5829 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ··· 5885 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT|AC_USRSP_EN}, 5886 { } /* end */ 5887 }; 5888 + 5889 + static struct hda_verb alc883_lenovo_nb0763_verbs[] = { 5890 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 5891 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5892 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5893 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5894 + { } /* end */ 5895 + }; 5896 + 5897 + static struct hda_verb alc888_lenovo_ms7195_verbs[] = { 5898 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5899 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5900 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 5901 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_FRONT_EVENT | AC_USRSP_EN}, 5902 + {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5903 + { } /* end */ 5904 + }; 5905 + 5906 + /* toggle front-jack and RCA according to the hp-jack state */ 5907 + static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec) 5908 + { 5909 + unsigned int present; 5910 + 5911 + present = snd_hda_codec_read(codec, 0x1b, 0, 5912 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5913 + snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 5914 + 0x80, present ? 0x80 : 0); 5915 + snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, 5916 + 0x80, present ? 0x80 : 0); 5917 + snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, 5918 + 0x80, present ? 0x80 : 0); 5919 + snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, 5920 + 0x80, present ? 0x80 : 0); 5921 + 5922 + } 5923 + 5924 + /* toggle RCA according to the front-jack state */ 5925 + static void alc888_lenovo_ms7195_rca_automute(struct hda_codec *codec) 5926 + { 5927 + unsigned int present; 5928 + 5929 + present = snd_hda_codec_read(codec, 0x14, 0, 5930 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5931 + snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, 5932 + 0x80, present ? 0x80 : 0); 5933 + snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, 5934 + 0x80, present ? 0x80 : 0); 5935 + 5936 + } 5937 + static void alc883_lenovo_ms7195_unsol_event(struct hda_codec *codec, 5938 + unsigned int res) 5939 + { 5940 + if ((res >> 26) == ALC880_HP_EVENT) 5941 + alc888_lenovo_ms7195_front_automute(codec); 5942 + if ((res >> 26) == ALC880_FRONT_EVENT) 5943 + alc888_lenovo_ms7195_rca_automute(codec); 5944 + } 5945 + 5946 + static struct hda_verb alc883_medion_md2_verbs[] = { 5947 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5948 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5949 + 5950 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5951 + 5952 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5953 + { } /* end */ 5954 + }; 5955 + 5956 + /* toggle speaker-output according to the hp-jack state */ 5957 + static void alc883_medion_md2_automute(struct hda_codec *codec) 5958 + { 5959 + unsigned int present; 5960 + 5961 + present = snd_hda_codec_read(codec, 0x14, 0, 5962 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5963 + snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, 5964 + 0x80, present ? 0x80 : 0); 5965 + snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, 5966 + 0x80, present ? 0x80 : 0); 5967 + } 5968 + 5969 + static void alc883_medion_md2_unsol_event(struct hda_codec *codec, 5970 + unsigned int res) 5971 + { 5972 + if ((res >> 26) == ALC880_HP_EVENT) 5973 + alc883_medion_md2_automute(codec); 5974 + } 5975 5976 /* toggle speaker-output according to the hp-jack state */ 5977 static void alc883_tagra_automute(struct hda_codec *codec) ··· 6051 [ALC883_6ST_DIG] = "6stack-dig", 6052 [ALC883_TARGA_DIG] = "targa-dig", 6053 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", 6054 [ALC883_ACER] = "acer", 6055 [ALC883_MEDION] = "medion", 6056 + [ALC883_MEDION_MD2] = "medion-md2", 6057 [ALC883_LAPTOP_EAPD] = "laptop-eapd", 6058 [ALC883_LENOVO_101E_2ch] = "lenovo-101e", 6059 + [ALC883_LENOVO_NB0763] = "lenovo-nb0763", 6060 + [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig", 6061 [ALC883_AUTO] = "auto", 6062 }; 6063 ··· 6082 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 6083 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 6084 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 6085 + SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), 6086 + SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), 6087 + SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), 6088 + SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), 6089 {} 6090 }; 6091 ··· 6168 .unsol_event = alc883_tagra_unsol_event, 6169 .init_hook = alc883_tagra_automute, 6170 }, 6171 [ALC883_ACER] = { 6172 .mixers = { alc883_base_mixer, 6173 alc883_chmode_mixer }, ··· 6211 .channel_mode = alc883_sixstack_modes, 6212 .input_mux = &alc883_capture_source, 6213 }, 6214 + [ALC883_MEDION_MD2] = { 6215 + .mixers = { alc883_medion_md2_mixer}, 6216 + .init_verbs = { alc883_init_verbs, alc883_medion_md2_verbs}, 6217 + .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6218 + .dac_nids = alc883_dac_nids, 6219 + .dig_out_nid = ALC883_DIGOUT_NID, 6220 + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6221 + .adc_nids = alc883_adc_nids, 6222 + .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 6223 + .channel_mode = alc883_3ST_2ch_modes, 6224 + .input_mux = &alc883_capture_source, 6225 + .unsol_event = alc883_medion_md2_unsol_event, 6226 + .init_hook = alc883_medion_md2_automute, 6227 + }, 6228 [ALC883_LAPTOP_EAPD] = { 6229 .mixers = { alc883_base_mixer, 6230 alc883_chmode_mixer }, ··· 6236 .unsol_event = alc883_lenovo_101e_unsol_event, 6237 .init_hook = alc883_lenovo_101e_all_automute, 6238 }, 6239 + [ALC883_LENOVO_NB0763] = { 6240 + .mixers = { alc883_lenovo_nb0763_mixer }, 6241 + .init_verbs = { alc883_init_verbs, alc883_lenovo_nb0763_verbs}, 6242 + .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6243 + .dac_nids = alc883_dac_nids, 6244 + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6245 + .adc_nids = alc883_adc_nids, 6246 + .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 6247 + .channel_mode = alc883_3ST_2ch_modes, 6248 + .need_dac_fix = 1, 6249 + .input_mux = &alc883_lenovo_nb0763_capture_source, 6250 + .unsol_event = alc883_medion_md2_unsol_event, 6251 + .init_hook = alc883_medion_md2_automute, 6252 + }, 6253 + [ALC888_LENOVO_MS7195_DIG] = { 6254 + .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer }, 6255 + .init_verbs = { alc883_init_verbs, alc888_lenovo_ms7195_verbs}, 6256 + .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6257 + .dac_nids = alc883_dac_nids, 6258 + .dig_out_nid = ALC883_DIGOUT_NID, 6259 + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6260 + .adc_nids = alc883_adc_nids, 6261 + .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), 6262 + .channel_mode = alc883_3ST_6ch_modes, 6263 + .need_dac_fix = 1, 6264 + .input_mux = &alc883_capture_source, 6265 + .unsol_event = alc883_lenovo_ms7195_unsol_event, 6266 + .init_hook = alc888_lenovo_ms7195_front_automute, 6267 + }, 6268 }; 6269 6270 ··· 6499 { } /* end */ 6500 }; 6501 6502 + static struct snd_kcontrol_new alc262_sony_mixer[] = { 6503 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 6504 + HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), 6505 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 6506 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 6507 + HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), 6508 + HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 6509 + { } /* end */ 6510 + }; 6511 + 6512 + 6513 + 6514 #define alc262_capture_mixer alc882_capture_mixer 6515 #define alc262_capture_alt_mixer alc882_capture_alt_mixer 6516 ··· 6595 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 6596 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 6597 {} 6598 + }; 6599 + 6600 + static struct hda_verb alc262_sony_unsol_verbs[] = { 6601 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, 6602 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 6603 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic 6604 + 6605 + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 6606 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 6607 }; 6608 6609 /* mute/unmute internal speaker according to the hp jack and mute state */ ··· 7215 [ALC262_HP_BPC] = "hp-bpc", 7216 [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", 7217 [ALC262_BENQ_ED8] = "benq", 7218 + [ALC262_BENQ_ED8] = "sony-assamd", 7219 [ALC262_AUTO] = "auto", 7220 }; 7221 ··· 7236 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), 7237 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), 7238 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), 7239 + SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), 7240 + SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), 7241 + SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), 7242 {} 7243 }; 7244 ··· 7327 .channel_mode = alc262_modes, 7328 .input_mux = &alc262_capture_source, 7329 }, 7330 + [ALC262_SONY_ASSAMD] = { 7331 + .mixers = { alc262_sony_mixer }, 7332 + .init_verbs = { alc262_init_verbs, alc262_sony_unsol_verbs}, 7333 + .num_dacs = ARRAY_SIZE(alc262_dac_nids), 7334 + .dac_nids = alc262_dac_nids, 7335 + .hp_nid = 0x02, 7336 + .num_channel_mode = ARRAY_SIZE(alc262_modes), 7337 + .channel_mode = alc262_modes, 7338 + .input_mux = &alc262_capture_source, 7339 + .unsol_event = alc262_hippo_unsol_event, 7340 + }, 7341 }; 7342 7343 static int patch_alc262(struct hda_codec *codec) ··· 8599 }, 8600 }; 8601 8602 + static struct hda_input_mux alc861vd_dallas_capture_source = { 8603 + .num_items = 3, 8604 + .items = { 8605 + { "Front Mic", 0x0 }, 8606 + { "ATAPI Mic", 0x1 }, 8607 + { "Line In", 0x5 }, 8608 + }, 8609 + }; 8610 + 8611 #define alc861vd_mux_enum_info alc_mux_enum_info 8612 #define alc861vd_mux_enum_get alc_mux_enum_get 8613 ··· 8779 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 8780 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 8781 8782 + { } /* end */ 8783 + }; 8784 + 8785 + /* Pin assignment: Front=0x14, HP = 0x15, 8786 + * Front Mic=0x18, ATAPI Mic = 0x19, Line In = 0x1d 8787 + */ 8788 + static struct snd_kcontrol_new alc861vd_dallas_mixer[] = { 8789 + HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT), 8790 + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 8791 + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), 8792 + HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT), 8793 + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 8794 + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 8795 + HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 8796 + HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 8797 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x05, HDA_INPUT), 8798 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x05, HDA_INPUT), 8799 + HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 8800 + HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 8801 + { 8802 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 8803 + /* .name = "Capture Source", */ 8804 + .name = "Input Source", 8805 + .count = 1, 8806 + .info = alc882_mux_enum_info, 8807 + .get = alc882_mux_enum_get, 8808 + .put = alc882_mux_enum_put, 8809 + }, 8810 { } /* end */ 8811 }; 8812 ··· 8969 } 8970 } 8971 8972 + static struct hda_verb alc861vd_dallas_verbs[] = { 8973 + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8974 + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8975 + {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8976 + {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8977 + 8978 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8979 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 8980 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8981 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8982 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8983 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8984 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8985 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8986 + 8987 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8988 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8989 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8990 + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8991 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8992 + {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8993 + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8994 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8995 + 8996 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, 8997 + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 8998 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, 8999 + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 9000 + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9001 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9002 + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9003 + {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9004 + 9005 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 9006 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 9007 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 9008 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 9009 + 9010 + {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 9011 + {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 9012 + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 9013 + 9014 + { } /* end */ 9015 + }; 9016 + 9017 + /* toggle speaker-output according to the hp-jack state */ 9018 + static void alc861vd_dallas_automute(struct hda_codec *codec) 9019 + { 9020 + unsigned int present; 9021 + 9022 + present = snd_hda_codec_read(codec, 0x15, 0, 9023 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 9024 + snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 9025 + 0x80, present ? 0x80 : 0); 9026 + snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, 9027 + 0x80, present ? 0x80 : 0); 9028 + } 9029 + 9030 + static void alc861vd_dallas_unsol_event(struct hda_codec *codec, unsigned int res) 9031 + { 9032 + if ((res >> 26) == ALC880_HP_EVENT) 9033 + alc861vd_dallas_automute(codec); 9034 + } 9035 + 9036 /* pcm configuration: identiacal with ALC880 */ 9037 #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback 9038 #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture ··· 8984 [ALC861VD_3ST_DIG] = "3stack-digout", 8985 [ALC861VD_6ST_DIG] = "6stack-digout", 8986 [ALC861VD_LENOVO] = "lenovo", 8987 + [ALC861VD_DALLAS] = "dallas", 8988 [ALC861VD_AUTO] = "auto", 8989 }; 8990 ··· 8993 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 8994 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), 8995 8996 + SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS), 8997 + SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), 8998 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), 8999 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), 9000 {} ··· 9059 .unsol_event = alc861vd_lenovo_unsol_event, 9060 .init_hook = alc861vd_lenovo_automute, 9061 }, 9062 + [ALC861VD_DALLAS] = { 9063 + .mixers = { alc861vd_dallas_mixer }, 9064 + .init_verbs = { alc861vd_dallas_verbs }, 9065 + .num_dacs = ARRAY_SIZE(alc861vd_dac_nids), 9066 + .dac_nids = alc861vd_dac_nids, 9067 + .num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids), 9068 + .adc_nids = alc861vd_adc_nids, 9069 + .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes), 9070 + .channel_mode = alc861vd_3stack_2ch_modes, 9071 + .input_mux = &alc861vd_dallas_capture_source, 9072 + .unsol_event = alc861vd_dallas_unsol_event, 9073 + .init_hook = alc861vd_dallas_automute, 9074 + }, 9075 }; 9076 9077 /*