diff options
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 108 |
1 files changed, 53 insertions, 55 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 76bd58a0e2b6..e96581fcdbdb 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -869,16 +869,16 @@ static void cxt5045_hp_unsol_event(struct hda_codec *codec, | |||
869 | } | 869 | } |
870 | 870 | ||
871 | static struct snd_kcontrol_new cxt5045_mixers[] = { | 871 | static struct snd_kcontrol_new cxt5045_mixers[] = { |
872 | HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), | 872 | HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), |
873 | HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), | 873 | HDA_CODEC_MUTE("Internal Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), |
874 | HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), | 874 | HDA_CODEC_VOLUME("Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), |
875 | HDA_CODEC_MUTE("Ext Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), | 875 | HDA_CODEC_MUTE("Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), |
876 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), | 876 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), |
877 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), | 877 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), |
878 | HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x17, 0x1, HDA_INPUT), | 878 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x1, HDA_INPUT), |
879 | HDA_CODEC_MUTE("Int Mic Playback Switch", 0x17, 0x1, HDA_INPUT), | 879 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x1, HDA_INPUT), |
880 | HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x17, 0x2, HDA_INPUT), | 880 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x17, 0x2, HDA_INPUT), |
881 | HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x17, 0x2, HDA_INPUT), | 881 | HDA_CODEC_MUTE("Mic Playback Switch", 0x17, 0x2, HDA_INPUT), |
882 | HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), | 882 | HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), |
883 | { | 883 | { |
884 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 884 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -910,16 +910,16 @@ static struct snd_kcontrol_new cxt5045_benq_mixers[] = { | |||
910 | }; | 910 | }; |
911 | 911 | ||
912 | static struct snd_kcontrol_new cxt5045_mixers_hp530[] = { | 912 | static struct snd_kcontrol_new cxt5045_mixers_hp530[] = { |
913 | HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), | 913 | HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), |
914 | HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), | 914 | HDA_CODEC_MUTE("Internal Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), |
915 | HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), | 915 | HDA_CODEC_VOLUME("Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), |
916 | HDA_CODEC_MUTE("Ext Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), | 916 | HDA_CODEC_MUTE("Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), |
917 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), | 917 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), |
918 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), | 918 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), |
919 | HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x17, 0x2, HDA_INPUT), | 919 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x2, HDA_INPUT), |
920 | HDA_CODEC_MUTE("Int Mic Playback Switch", 0x17, 0x2, HDA_INPUT), | 920 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x2, HDA_INPUT), |
921 | HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x17, 0x1, HDA_INPUT), | 921 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x17, 0x1, HDA_INPUT), |
922 | HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x17, 0x1, HDA_INPUT), | 922 | HDA_CODEC_MUTE("Mic Playback Switch", 0x17, 0x1, HDA_INPUT), |
923 | HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), | 923 | HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), |
924 | { | 924 | { |
925 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 925 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -947,7 +947,7 @@ static struct hda_verb cxt5045_init_verbs[] = { | |||
947 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | 947 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, |
948 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | 948 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, |
949 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | 949 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, |
950 | /* Record selector: Int mic */ | 950 | /* Record selector: Internal mic */ |
951 | {0x1a, AC_VERB_SET_CONNECT_SEL,0x1}, | 951 | {0x1a, AC_VERB_SET_CONNECT_SEL,0x1}, |
952 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, | 952 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, |
953 | AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, | 953 | AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, |
@@ -960,7 +960,7 @@ static struct hda_verb cxt5045_init_verbs[] = { | |||
960 | }; | 960 | }; |
961 | 961 | ||
962 | static struct hda_verb cxt5045_benq_init_verbs[] = { | 962 | static struct hda_verb cxt5045_benq_init_verbs[] = { |
963 | /* Int Mic, Mic */ | 963 | /* Internal Mic, Mic */ |
964 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, | 964 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, |
965 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, | 965 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, |
966 | /* Line In,HP, Amp */ | 966 | /* Line In,HP, Amp */ |
@@ -973,7 +973,7 @@ static struct hda_verb cxt5045_benq_init_verbs[] = { | |||
973 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | 973 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, |
974 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | 974 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, |
975 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | 975 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, |
976 | /* Record selector: Int mic */ | 976 | /* Record selector: Internal mic */ |
977 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x1}, | 977 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x1}, |
978 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, | 978 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, |
979 | AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, | 979 | AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, |
@@ -1376,7 +1376,7 @@ static void cxt5047_hp_unsol_event(struct hda_codec *codec, | |||
1376 | static struct snd_kcontrol_new cxt5047_base_mixers[] = { | 1376 | static struct snd_kcontrol_new cxt5047_base_mixers[] = { |
1377 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x19, 0x02, HDA_INPUT), | 1377 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x19, 0x02, HDA_INPUT), |
1378 | HDA_CODEC_MUTE("Mic Playback Switch", 0x19, 0x02, HDA_INPUT), | 1378 | HDA_CODEC_MUTE("Mic Playback Switch", 0x19, 0x02, HDA_INPUT), |
1379 | HDA_CODEC_VOLUME("Mic Boost", 0x1a, 0x0, HDA_OUTPUT), | 1379 | HDA_CODEC_VOLUME("Mic Boost Volume", 0x1a, 0x0, HDA_OUTPUT), |
1380 | HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT), | 1380 | HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT), |
1381 | HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT), | 1381 | HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT), |
1382 | HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT), | 1382 | HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT), |
@@ -1796,8 +1796,8 @@ static struct snd_kcontrol_new cxt5051_playback_mixers[] = { | |||
1796 | static struct snd_kcontrol_new cxt5051_capture_mixers[] = { | 1796 | static struct snd_kcontrol_new cxt5051_capture_mixers[] = { |
1797 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), | 1797 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), |
1798 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), | 1798 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), |
1799 | HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), | 1799 | HDA_CODEC_VOLUME("Mic Volume", 0x14, 0x01, HDA_INPUT), |
1800 | HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), | 1800 | HDA_CODEC_MUTE("Mic Switch", 0x14, 0x01, HDA_INPUT), |
1801 | HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT), | 1801 | HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT), |
1802 | HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT), | 1802 | HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT), |
1803 | {} | 1803 | {} |
@@ -1806,8 +1806,8 @@ static struct snd_kcontrol_new cxt5051_capture_mixers[] = { | |||
1806 | static struct snd_kcontrol_new cxt5051_hp_mixers[] = { | 1806 | static struct snd_kcontrol_new cxt5051_hp_mixers[] = { |
1807 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), | 1807 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), |
1808 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), | 1808 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), |
1809 | HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT), | 1809 | HDA_CODEC_VOLUME("Mic Volume", 0x15, 0x00, HDA_INPUT), |
1810 | HDA_CODEC_MUTE("External Mic Switch", 0x15, 0x00, HDA_INPUT), | 1810 | HDA_CODEC_MUTE("Mic Switch", 0x15, 0x00, HDA_INPUT), |
1811 | {} | 1811 | {} |
1812 | }; | 1812 | }; |
1813 | 1813 | ||
@@ -1826,8 +1826,8 @@ static struct snd_kcontrol_new cxt5051_f700_mixers[] = { | |||
1826 | static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = { | 1826 | static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = { |
1827 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), | 1827 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), |
1828 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), | 1828 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), |
1829 | HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), | 1829 | HDA_CODEC_VOLUME("Mic Volume", 0x14, 0x01, HDA_INPUT), |
1830 | HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), | 1830 | HDA_CODEC_MUTE("Mic Switch", 0x14, 0x01, HDA_INPUT), |
1831 | {} | 1831 | {} |
1832 | }; | 1832 | }; |
1833 | 1833 | ||
@@ -1847,7 +1847,7 @@ static struct hda_verb cxt5051_init_verbs[] = { | |||
1847 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, | 1847 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, |
1848 | /* DAC1 */ | 1848 | /* DAC1 */ |
1849 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 1849 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
1850 | /* Record selector: Int mic */ | 1850 | /* Record selector: Internal mic */ |
1851 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, | 1851 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, |
1852 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, | 1852 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, |
1853 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, | 1853 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, |
@@ -1874,7 +1874,7 @@ static struct hda_verb cxt5051_hp_dv6736_init_verbs[] = { | |||
1874 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, | 1874 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, |
1875 | /* DAC1 */ | 1875 | /* DAC1 */ |
1876 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 1876 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
1877 | /* Record selector: Int mic */ | 1877 | /* Record selector: Internal mic */ |
1878 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, | 1878 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, |
1879 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x1}, | 1879 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x1}, |
1880 | /* SPDIF route: PCM */ | 1880 | /* SPDIF route: PCM */ |
@@ -1904,7 +1904,7 @@ static struct hda_verb cxt5051_lenovo_x200_init_verbs[] = { | |||
1904 | {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, | 1904 | {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, |
1905 | /* DAC1 */ | 1905 | /* DAC1 */ |
1906 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 1906 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
1907 | /* Record selector: Int mic */ | 1907 | /* Record selector: Internal mic */ |
1908 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, | 1908 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, |
1909 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, | 1909 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, |
1910 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, | 1910 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, |
@@ -1932,7 +1932,7 @@ static struct hda_verb cxt5051_f700_init_verbs[] = { | |||
1932 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, | 1932 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, |
1933 | /* DAC1 */ | 1933 | /* DAC1 */ |
1934 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 1934 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
1935 | /* Record selector: Int mic */ | 1935 | /* Record selector: Internal mic */ |
1936 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, | 1936 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, |
1937 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x1}, | 1937 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x1}, |
1938 | /* SPDIF route: PCM */ | 1938 | /* SPDIF route: PCM */ |
@@ -2111,6 +2111,11 @@ static struct hda_channel_mode cxt5066_modes[1] = { | |||
2111 | { 2, NULL }, | 2111 | { 2, NULL }, |
2112 | }; | 2112 | }; |
2113 | 2113 | ||
2114 | #define HP_PRESENT_PORT_A (1 << 0) | ||
2115 | #define HP_PRESENT_PORT_D (1 << 1) | ||
2116 | #define hp_port_a_present(spec) ((spec)->hp_present & HP_PRESENT_PORT_A) | ||
2117 | #define hp_port_d_present(spec) ((spec)->hp_present & HP_PRESENT_PORT_D) | ||
2118 | |||
2114 | static void cxt5066_update_speaker(struct hda_codec *codec) | 2119 | static void cxt5066_update_speaker(struct hda_codec *codec) |
2115 | { | 2120 | { |
2116 | struct conexant_spec *spec = codec->spec; | 2121 | struct conexant_spec *spec = codec->spec; |
@@ -2120,24 +2125,20 @@ static void cxt5066_update_speaker(struct hda_codec *codec) | |||
2120 | spec->hp_present, spec->cur_eapd); | 2125 | spec->hp_present, spec->cur_eapd); |
2121 | 2126 | ||
2122 | /* Port A (HP) */ | 2127 | /* Port A (HP) */ |
2123 | pinctl = ((spec->hp_present & 1) && spec->cur_eapd) ? PIN_HP : 0; | 2128 | pinctl = (hp_port_a_present(spec) && spec->cur_eapd) ? PIN_HP : 0; |
2124 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 2129 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
2125 | pinctl); | 2130 | pinctl); |
2126 | 2131 | ||
2127 | /* Port D (HP/LO) */ | 2132 | /* Port D (HP/LO) */ |
2128 | if (spec->dell_automute) { | 2133 | pinctl = spec->cur_eapd ? spec->port_d_mode : 0; |
2129 | /* DELL AIO Port Rule: PortA> PortD> IntSpk */ | 2134 | if (spec->dell_automute || spec->thinkpad) { |
2130 | pinctl = (!(spec->hp_present & 1) && spec->cur_eapd) | 2135 | /* Mute if Port A is connected */ |
2131 | ? PIN_OUT : 0; | 2136 | if (hp_port_a_present(spec)) |
2132 | } else if (spec->thinkpad) { | ||
2133 | if (spec->cur_eapd) | ||
2134 | pinctl = spec->port_d_mode; | ||
2135 | /* Mute dock line-out if Port A (laptop HP) is present */ | ||
2136 | if (spec->hp_present& 1) | ||
2137 | pinctl = 0; | 2137 | pinctl = 0; |
2138 | } else { | 2138 | } else { |
2139 | pinctl = ((spec->hp_present & 2) && spec->cur_eapd) | 2139 | /* Thinkpad/Dell doesn't give pin-D status */ |
2140 | ? spec->port_d_mode : 0; | 2140 | if (!hp_port_d_present(spec)) |
2141 | pinctl = 0; | ||
2141 | } | 2142 | } |
2142 | snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 2143 | snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
2143 | pinctl); | 2144 | pinctl); |
@@ -2379,8 +2380,8 @@ static void cxt5066_hp_automute(struct hda_codec *codec) | |||
2379 | /* Port D */ | 2380 | /* Port D */ |
2380 | portD = snd_hda_jack_detect(codec, 0x1c); | 2381 | portD = snd_hda_jack_detect(codec, 0x1c); |
2381 | 2382 | ||
2382 | spec->hp_present = !!(portA); | 2383 | spec->hp_present = portA ? HP_PRESENT_PORT_A : 0; |
2383 | spec->hp_present |= portD ? 2 : 0; | 2384 | spec->hp_present |= portD ? HP_PRESENT_PORT_D : 0; |
2384 | snd_printdd("CXT5066: hp automute portA=%x portD=%x present=%d\n", | 2385 | snd_printdd("CXT5066: hp automute portA=%x portD=%x present=%d\n", |
2385 | portA, portD, spec->hp_present); | 2386 | portA, portD, spec->hp_present); |
2386 | cxt5066_update_speaker(codec); | 2387 | cxt5066_update_speaker(codec); |
@@ -2728,7 +2729,7 @@ static struct snd_kcontrol_new cxt5066_mixers[] = { | |||
2728 | static struct snd_kcontrol_new cxt5066_vostro_mixers[] = { | 2729 | static struct snd_kcontrol_new cxt5066_vostro_mixers[] = { |
2729 | { | 2730 | { |
2730 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2731 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2731 | .name = "Int Mic Boost Capture Enum", | 2732 | .name = "Internal Mic Boost Capture Enum", |
2732 | .info = cxt5066_mic_boost_mux_enum_info, | 2733 | .info = cxt5066_mic_boost_mux_enum_info, |
2733 | .get = cxt5066_mic_boost_mux_enum_get, | 2734 | .get = cxt5066_mic_boost_mux_enum_get, |
2734 | .put = cxt5066_mic_boost_mux_enum_put, | 2735 | .put = cxt5066_mic_boost_mux_enum_put, |
@@ -2954,7 +2955,7 @@ static struct hda_verb cxt5066_init_verbs_ideapad[] = { | |||
2954 | {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 2955 | {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
2955 | 2956 | ||
2956 | /* internal microphone */ | 2957 | /* internal microphone */ |
2957 | {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable int mic */ | 2958 | {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable internal mic */ |
2958 | 2959 | ||
2959 | /* EAPD */ | 2960 | /* EAPD */ |
2960 | {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ | 2961 | {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ |
@@ -3009,7 +3010,7 @@ static struct hda_verb cxt5066_init_verbs_thinkpad[] = { | |||
3009 | {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 3010 | {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
3010 | 3011 | ||
3011 | /* internal microphone */ | 3012 | /* internal microphone */ |
3012 | {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable int mic */ | 3013 | {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable internal mic */ |
3013 | 3014 | ||
3014 | /* EAPD */ | 3015 | /* EAPD */ |
3015 | {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ | 3016 | {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ |
@@ -3097,6 +3098,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3097 | SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), | 3098 | SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), |
3098 | SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3099 | SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), |
3099 | SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), | 3100 | SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), |
3101 | SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), | ||
3100 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3102 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), |
3101 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | 3103 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), |
3102 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), | 3104 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), |
@@ -3108,16 +3110,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3108 | CXT5066_LAPTOP), | 3110 | CXT5066_LAPTOP), |
3109 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), | 3111 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), |
3110 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), | 3112 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), |
3111 | SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD), | ||
3112 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), | 3113 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), |
3113 | SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD), | ||
3114 | SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), | ||
3115 | SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD), | ||
3116 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), | 3114 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), |
3117 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD), | 3115 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ |
3118 | SND_PCI_QUIRK(0x17aa, 0x390a, "Lenovo S10-3t", CXT5066_IDEAPAD), | ||
3119 | SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G series (AMD)", CXT5066_IDEAPAD), | ||
3120 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD), | ||
3121 | {} | 3116 | {} |
3122 | }; | 3117 | }; |
3123 | 3118 | ||
@@ -3422,6 +3417,9 @@ static void cx_auto_hp_automute(struct hda_codec *codec) | |||
3422 | AC_VERB_SET_PIN_WIDGET_CONTROL, | 3417 | AC_VERB_SET_PIN_WIDGET_CONTROL, |
3423 | present ? 0 : PIN_OUT); | 3418 | present ? 0 : PIN_OUT); |
3424 | } | 3419 | } |
3420 | for (i = 0; !present && i < cfg->line_outs; i++) | ||
3421 | if (snd_hda_jack_detect(codec, cfg->line_out_pins[i])) | ||
3422 | present = 1; | ||
3425 | for (i = 0; i < cfg->speaker_outs; i++) { | 3423 | for (i = 0; i < cfg->speaker_outs; i++) { |
3426 | snd_hda_codec_write(codec, cfg->speaker_pins[i], 0, | 3424 | snd_hda_codec_write(codec, cfg->speaker_pins[i], 0, |
3427 | AC_VERB_SET_PIN_WIDGET_CONTROL, | 3425 | AC_VERB_SET_PIN_WIDGET_CONTROL, |