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.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6d4df45e81e0..b0a2a262ece2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -853,6 +853,7 @@ do_sku:
853 case 0x10ec0269: 853 case 0x10ec0269:
854 case 0x10ec0862: 854 case 0x10ec0862:
855 case 0x10ec0662: 855 case 0x10ec0662:
856 case 0x10ec0889:
856 snd_hda_codec_write(codec, 0x14, 0, 857 snd_hda_codec_write(codec, 0x14, 0,
857 AC_VERB_SET_EAPD_BTLENABLE, 2); 858 AC_VERB_SET_EAPD_BTLENABLE, 2);
858 snd_hda_codec_write(codec, 0x15, 0, 859 snd_hda_codec_write(codec, 0x15, 0,
@@ -877,6 +878,7 @@ do_sku:
877 case 0x10ec0883: 878 case 0x10ec0883:
878 case 0x10ec0885: 879 case 0x10ec0885:
879 case 0x10ec0888: 880 case 0x10ec0888:
881 case 0x10ec0889:
880 snd_hda_codec_write(codec, 0x20, 0, 882 snd_hda_codec_write(codec, 0x20, 0,
881 AC_VERB_SET_COEF_INDEX, 7); 883 AC_VERB_SET_COEF_INDEX, 7);
882 tmp = snd_hda_codec_read(codec, 0x20, 0, 884 tmp = snd_hda_codec_read(codec, 0x20, 0,
@@ -940,7 +942,6 @@ do_sku:
940 AC_VERB_SET_UNSOLICITED_ENABLE, 942 AC_VERB_SET_UNSOLICITED_ENABLE,
941 AC_USRSP_EN | ALC880_HP_EVENT); 943 AC_USRSP_EN | ALC880_HP_EVENT);
942 spec->unsol_event = alc_sku_unsol_event; 944 spec->unsol_event = alc_sku_unsol_event;
943 spec->init_hook = alc_sku_automute;
944} 945}
945 946
946/* 947/*
@@ -2981,7 +2982,7 @@ static struct snd_pci_quirk alc880_cfg_tbl[] = {
2981 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */ 2982 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
2982 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG), 2983 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
2983 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG), 2984 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
2984 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS", ALC880_ASUS), 2985 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
2985 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG), 2986 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
2986 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST), 2987 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
2987 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST), 2988 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
@@ -7743,6 +7744,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
7743 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), 7744 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP),
7744 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG), 7745 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
7745 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), 7746 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
7747 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
7746 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG), 7748 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG),
7747 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC), 7749 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC),
7748 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 7750 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
@@ -8640,6 +8642,7 @@ static struct hda_verb alc262_sony_unsol_verbs[] = {
8640 8642
8641 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 8643 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
8642 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 8644 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8645 {}
8643}; 8646};
8644 8647
8645/* mute/unmute internal speaker according to the hp jack and mute state */ 8648/* mute/unmute internal speaker according to the hp jack and mute state */
@@ -8757,35 +8760,39 @@ static struct hda_input_mux alc262_HP_D7000_capture_source = {
8757 }, 8760 },
8758}; 8761};
8759 8762
8760/* mute/unmute internal speaker according to the hp jack and mute state */ 8763/* mute/unmute internal speaker according to the hp jacks and mute state */
8761static void alc262_fujitsu_automute(struct hda_codec *codec, int force) 8764static void alc262_fujitsu_automute(struct hda_codec *codec, int force)
8762{ 8765{
8763 struct alc_spec *spec = codec->spec; 8766 struct alc_spec *spec = codec->spec;
8764 unsigned int mute; 8767 unsigned int mute;
8765 8768
8766 if (force || !spec->sense_updated) { 8769 if (force || !spec->sense_updated) {
8767 unsigned int present_int_hp, present_dock_hp; 8770 unsigned int present;
8768 /* need to execute and sync at first */ 8771 /* need to execute and sync at first */
8769 snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0); 8772 snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0);
8770 present_int_hp = snd_hda_codec_read(codec, 0x14, 0, 8773 /* check laptop HP jack */
8771 AC_VERB_GET_PIN_SENSE, 0); 8774 present = snd_hda_codec_read(codec, 0x14, 0,
8772 snd_hda_codec_read(codec, 0x1B, 0, AC_VERB_SET_PIN_SENSE, 0); 8775 AC_VERB_GET_PIN_SENSE, 0);
8773 present_dock_hp = snd_hda_codec_read(codec, 0x1b, 0, 8776 /* need to execute and sync at first */
8774 AC_VERB_GET_PIN_SENSE, 0); 8777 snd_hda_codec_read(codec, 0x1b, 0, AC_VERB_SET_PIN_SENSE, 0);
8775 spec->jack_present = (present_int_hp & 0x80000000) != 0; 8778 /* check docking HP jack */
8776 spec->jack_present |= (present_dock_hp & 0x80000000) != 0; 8779 present |= snd_hda_codec_read(codec, 0x1b, 0,
8780 AC_VERB_GET_PIN_SENSE, 0);
8781 if (present & AC_PINSENSE_PRESENCE)
8782 spec->jack_present = 1;
8783 else
8784 spec->jack_present = 0;
8777 spec->sense_updated = 1; 8785 spec->sense_updated = 1;
8778 } 8786 }
8779 if (spec->jack_present) { 8787 /* unmute internal speaker only if both HPs are unplugged and
8780 /* mute internal speaker */ 8788 * master switch is on
8781 snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, 8789 */
8782 HDA_AMP_MUTE, HDA_AMP_MUTE); 8790 if (spec->jack_present)
8783 } else { 8791 mute = HDA_AMP_MUTE;
8784 /* unmute internal speaker if necessary */ 8792 else
8785 mute = snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0); 8793 mute = snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0);
8786 snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, 8794 snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
8787 HDA_AMP_MUTE, mute); 8795 HDA_AMP_MUTE, mute);
8788 }
8789} 8796}
8790 8797
8791/* unsolicited event for HP jack sensing */ 8798/* unsolicited event for HP jack sensing */
@@ -8797,6 +8804,11 @@ static void alc262_fujitsu_unsol_event(struct hda_codec *codec,
8797 alc262_fujitsu_automute(codec, 1); 8804 alc262_fujitsu_automute(codec, 1);
8798} 8805}
8799 8806
8807static void alc262_fujitsu_init_hook(struct hda_codec *codec)
8808{
8809 alc262_fujitsu_automute(codec, 1);
8810}
8811
8800/* bind volumes of both NID 0x0c and 0x0d */ 8812/* bind volumes of both NID 0x0c and 0x0d */
8801static struct hda_bind_ctls alc262_fujitsu_bind_master_vol = { 8813static struct hda_bind_ctls alc262_fujitsu_bind_master_vol = {
8802 .ops = &snd_hda_bind_vol, 8814 .ops = &snd_hda_bind_vol,
@@ -9570,6 +9582,7 @@ static struct alc_config_preset alc262_presets[] = {
9570 .channel_mode = alc262_modes, 9582 .channel_mode = alc262_modes,
9571 .input_mux = &alc262_fujitsu_capture_source, 9583 .input_mux = &alc262_fujitsu_capture_source,
9572 .unsol_event = alc262_fujitsu_unsol_event, 9584 .unsol_event = alc262_fujitsu_unsol_event,
9585 .init_hook = alc262_fujitsu_init_hook,
9573 }, 9586 },
9574 [ALC262_HP_BPC] = { 9587 [ALC262_HP_BPC] = {
9575 .mixers = { alc262_HP_BPC_mixer }, 9588 .mixers = { alc262_HP_BPC_mixer },
@@ -10500,6 +10513,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
10500 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 10513 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
10501 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), 10514 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA),
10502 SND_PCI_QUIRK(0x1179, 0xff50, "TOSHIBA A305", ALC268_TOSHIBA), 10515 SND_PCI_QUIRK(0x1179, 0xff50, "TOSHIBA A305", ALC268_TOSHIBA),
10516 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
10503 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), 10517 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
10504 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), 10518 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
10505 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), 10519 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),