diff options
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 108 |
1 files changed, 41 insertions, 67 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 8c6523bbc797..a36488d94aaa 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -141,7 +141,6 @@ struct conexant_spec { | |||
141 | unsigned int hp_laptop:1; | 141 | unsigned int hp_laptop:1; |
142 | unsigned int asus:1; | 142 | unsigned int asus:1; |
143 | unsigned int pin_eapd_ctrls:1; | 143 | unsigned int pin_eapd_ctrls:1; |
144 | unsigned int single_adc_amp:1; | ||
145 | 144 | ||
146 | unsigned int adc_switching:1; | 145 | unsigned int adc_switching:1; |
147 | 146 | ||
@@ -687,27 +686,26 @@ static const struct hda_channel_mode cxt5045_modes[1] = { | |||
687 | static const struct hda_input_mux cxt5045_capture_source = { | 686 | static const struct hda_input_mux cxt5045_capture_source = { |
688 | .num_items = 2, | 687 | .num_items = 2, |
689 | .items = { | 688 | .items = { |
690 | { "IntMic", 0x1 }, | 689 | { "Internal Mic", 0x1 }, |
691 | { "ExtMic", 0x2 }, | 690 | { "Mic", 0x2 }, |
692 | } | 691 | } |
693 | }; | 692 | }; |
694 | 693 | ||
695 | static const struct hda_input_mux cxt5045_capture_source_benq = { | 694 | static const struct hda_input_mux cxt5045_capture_source_benq = { |
696 | .num_items = 5, | 695 | .num_items = 4, |
697 | .items = { | 696 | .items = { |
698 | { "IntMic", 0x1 }, | 697 | { "Internal Mic", 0x1 }, |
699 | { "ExtMic", 0x2 }, | 698 | { "Mic", 0x2 }, |
700 | { "LineIn", 0x3 }, | 699 | { "Line", 0x3 }, |
701 | { "CD", 0x4 }, | 700 | { "Mixer", 0x0 }, |
702 | { "Mixer", 0x0 }, | ||
703 | } | 701 | } |
704 | }; | 702 | }; |
705 | 703 | ||
706 | static const struct hda_input_mux cxt5045_capture_source_hp530 = { | 704 | static const struct hda_input_mux cxt5045_capture_source_hp530 = { |
707 | .num_items = 2, | 705 | .num_items = 2, |
708 | .items = { | 706 | .items = { |
709 | { "ExtMic", 0x1 }, | 707 | { "Mic", 0x1 }, |
710 | { "IntMic", 0x2 }, | 708 | { "Internal Mic", 0x2 }, |
711 | } | 709 | } |
712 | }; | 710 | }; |
713 | 711 | ||
@@ -798,10 +796,8 @@ static void cxt5045_hp_unsol_event(struct hda_codec *codec, | |||
798 | } | 796 | } |
799 | 797 | ||
800 | static const struct snd_kcontrol_new cxt5045_mixers[] = { | 798 | static const struct snd_kcontrol_new cxt5045_mixers[] = { |
801 | HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), | 799 | HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x00, HDA_INPUT), |
802 | HDA_CODEC_MUTE("Internal Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), | 800 | HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x0, HDA_INPUT), |
803 | HDA_CODEC_VOLUME("Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), | ||
804 | HDA_CODEC_MUTE("Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), | ||
805 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), | 801 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), |
806 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), | 802 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), |
807 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x1, HDA_INPUT), | 803 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x1, HDA_INPUT), |
@@ -822,27 +818,15 @@ static const struct snd_kcontrol_new cxt5045_mixers[] = { | |||
822 | }; | 818 | }; |
823 | 819 | ||
824 | static const struct snd_kcontrol_new cxt5045_benq_mixers[] = { | 820 | static const struct snd_kcontrol_new cxt5045_benq_mixers[] = { |
825 | HDA_CODEC_VOLUME("CD Capture Volume", 0x1a, 0x04, HDA_INPUT), | 821 | HDA_CODEC_VOLUME("Line Playback Volume", 0x17, 0x3, HDA_INPUT), |
826 | HDA_CODEC_MUTE("CD Capture Switch", 0x1a, 0x04, HDA_INPUT), | 822 | HDA_CODEC_MUTE("Line Playback Switch", 0x17, 0x3, HDA_INPUT), |
827 | HDA_CODEC_VOLUME("CD Playback Volume", 0x17, 0x4, HDA_INPUT), | ||
828 | HDA_CODEC_MUTE("CD Playback Switch", 0x17, 0x4, HDA_INPUT), | ||
829 | |||
830 | HDA_CODEC_VOLUME("Line In Capture Volume", 0x1a, 0x03, HDA_INPUT), | ||
831 | HDA_CODEC_MUTE("Line In Capture Switch", 0x1a, 0x03, HDA_INPUT), | ||
832 | HDA_CODEC_VOLUME("Line In Playback Volume", 0x17, 0x3, HDA_INPUT), | ||
833 | HDA_CODEC_MUTE("Line In Playback Switch", 0x17, 0x3, HDA_INPUT), | ||
834 | |||
835 | HDA_CODEC_VOLUME("Mixer Capture Volume", 0x1a, 0x0, HDA_INPUT), | ||
836 | HDA_CODEC_MUTE("Mixer Capture Switch", 0x1a, 0x0, HDA_INPUT), | ||
837 | 823 | ||
838 | {} | 824 | {} |
839 | }; | 825 | }; |
840 | 826 | ||
841 | static const struct snd_kcontrol_new cxt5045_mixers_hp530[] = { | 827 | static const struct snd_kcontrol_new cxt5045_mixers_hp530[] = { |
842 | HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), | 828 | HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x00, HDA_INPUT), |
843 | HDA_CODEC_MUTE("Internal Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), | 829 | HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x0, HDA_INPUT), |
844 | HDA_CODEC_VOLUME("Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), | ||
845 | HDA_CODEC_MUTE("Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), | ||
846 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), | 830 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), |
847 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), | 831 | HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), |
848 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x2, HDA_INPUT), | 832 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x2, HDA_INPUT), |
@@ -946,10 +930,10 @@ static const struct snd_kcontrol_new cxt5045_test_mixer[] = { | |||
946 | /* Output controls */ | 930 | /* Output controls */ |
947 | HDA_CODEC_VOLUME("Speaker Playback Volume", 0x10, 0x0, HDA_OUTPUT), | 931 | HDA_CODEC_VOLUME("Speaker Playback Volume", 0x10, 0x0, HDA_OUTPUT), |
948 | HDA_CODEC_MUTE("Speaker Playback Switch", 0x10, 0x0, HDA_OUTPUT), | 932 | HDA_CODEC_MUTE("Speaker Playback Switch", 0x10, 0x0, HDA_OUTPUT), |
949 | HDA_CODEC_VOLUME("Node 11 Playback Volume", 0x11, 0x0, HDA_OUTPUT), | 933 | HDA_CODEC_VOLUME("HP-OUT Playback Volume", 0x11, 0x0, HDA_OUTPUT), |
950 | HDA_CODEC_MUTE("Node 11 Playback Switch", 0x11, 0x0, HDA_OUTPUT), | 934 | HDA_CODEC_MUTE("HP-OUT Playback Switch", 0x11, 0x0, HDA_OUTPUT), |
951 | HDA_CODEC_VOLUME("Node 12 Playback Volume", 0x12, 0x0, HDA_OUTPUT), | 935 | HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x12, 0x0, HDA_OUTPUT), |
952 | HDA_CODEC_MUTE("Node 12 Playback Switch", 0x12, 0x0, HDA_OUTPUT), | 936 | HDA_CODEC_MUTE("LINE1 Playback Switch", 0x12, 0x0, HDA_OUTPUT), |
953 | 937 | ||
954 | /* Modes for retasking pin widgets */ | 938 | /* Modes for retasking pin widgets */ |
955 | CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT), | 939 | CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT), |
@@ -960,16 +944,16 @@ static const struct snd_kcontrol_new cxt5045_test_mixer[] = { | |||
960 | 944 | ||
961 | /* Loopback mixer controls */ | 945 | /* Loopback mixer controls */ |
962 | 946 | ||
963 | HDA_CODEC_VOLUME("Mixer-1 Volume", 0x17, 0x0, HDA_INPUT), | 947 | HDA_CODEC_VOLUME("PCM Volume", 0x17, 0x0, HDA_INPUT), |
964 | HDA_CODEC_MUTE("Mixer-1 Switch", 0x17, 0x0, HDA_INPUT), | 948 | HDA_CODEC_MUTE("PCM Switch", 0x17, 0x0, HDA_INPUT), |
965 | HDA_CODEC_VOLUME("Mixer-2 Volume", 0x17, 0x1, HDA_INPUT), | 949 | HDA_CODEC_VOLUME("MIC1 pin Volume", 0x17, 0x1, HDA_INPUT), |
966 | HDA_CODEC_MUTE("Mixer-2 Switch", 0x17, 0x1, HDA_INPUT), | 950 | HDA_CODEC_MUTE("MIC1 pin Switch", 0x17, 0x1, HDA_INPUT), |
967 | HDA_CODEC_VOLUME("Mixer-3 Volume", 0x17, 0x2, HDA_INPUT), | 951 | HDA_CODEC_VOLUME("LINE1 pin Volume", 0x17, 0x2, HDA_INPUT), |
968 | HDA_CODEC_MUTE("Mixer-3 Switch", 0x17, 0x2, HDA_INPUT), | 952 | HDA_CODEC_MUTE("LINE1 pin Switch", 0x17, 0x2, HDA_INPUT), |
969 | HDA_CODEC_VOLUME("Mixer-4 Volume", 0x17, 0x3, HDA_INPUT), | 953 | HDA_CODEC_VOLUME("HP-OUT pin Volume", 0x17, 0x3, HDA_INPUT), |
970 | HDA_CODEC_MUTE("Mixer-4 Switch", 0x17, 0x3, HDA_INPUT), | 954 | HDA_CODEC_MUTE("HP-OUT pin Switch", 0x17, 0x3, HDA_INPUT), |
971 | HDA_CODEC_VOLUME("Mixer-5 Volume", 0x17, 0x4, HDA_INPUT), | 955 | HDA_CODEC_VOLUME("CD pin Volume", 0x17, 0x4, HDA_INPUT), |
972 | HDA_CODEC_MUTE("Mixer-5 Switch", 0x17, 0x4, HDA_INPUT), | 956 | HDA_CODEC_MUTE("CD pin Switch", 0x17, 0x4, HDA_INPUT), |
973 | { | 957 | { |
974 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 958 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
975 | .name = "Input Source", | 959 | .name = "Input Source", |
@@ -978,16 +962,8 @@ static const struct snd_kcontrol_new cxt5045_test_mixer[] = { | |||
978 | .put = conexant_mux_enum_put, | 962 | .put = conexant_mux_enum_put, |
979 | }, | 963 | }, |
980 | /* Audio input controls */ | 964 | /* Audio input controls */ |
981 | HDA_CODEC_VOLUME("Input-1 Volume", 0x1a, 0x0, HDA_INPUT), | 965 | HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x0, HDA_INPUT), |
982 | HDA_CODEC_MUTE("Input-1 Switch", 0x1a, 0x0, HDA_INPUT), | 966 | HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x0, HDA_INPUT), |
983 | HDA_CODEC_VOLUME("Input-2 Volume", 0x1a, 0x1, HDA_INPUT), | ||
984 | HDA_CODEC_MUTE("Input-2 Switch", 0x1a, 0x1, HDA_INPUT), | ||
985 | HDA_CODEC_VOLUME("Input-3 Volume", 0x1a, 0x2, HDA_INPUT), | ||
986 | HDA_CODEC_MUTE("Input-3 Switch", 0x1a, 0x2, HDA_INPUT), | ||
987 | HDA_CODEC_VOLUME("Input-4 Volume", 0x1a, 0x3, HDA_INPUT), | ||
988 | HDA_CODEC_MUTE("Input-4 Switch", 0x1a, 0x3, HDA_INPUT), | ||
989 | HDA_CODEC_VOLUME("Input-5 Volume", 0x1a, 0x4, HDA_INPUT), | ||
990 | HDA_CODEC_MUTE("Input-5 Switch", 0x1a, 0x4, HDA_INPUT), | ||
991 | { } /* end */ | 967 | { } /* end */ |
992 | }; | 968 | }; |
993 | 969 | ||
@@ -1009,10 +985,6 @@ static const struct hda_verb cxt5045_test_init_verbs[] = { | |||
1009 | {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 985 | {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
1010 | {0x18, AC_VERB_SET_DIGI_CONVERT_1, 0}, | 986 | {0x18, AC_VERB_SET_DIGI_CONVERT_1, 0}, |
1011 | 987 | ||
1012 | /* Start with output sum widgets muted and their output gains at min */ | ||
1013 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
1014 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
1015 | |||
1016 | /* Unmute retasking pin widget output buffers since the default | 988 | /* Unmute retasking pin widget output buffers since the default |
1017 | * state appears to be output. As the pin mode is changed by the | 989 | * state appears to be output. As the pin mode is changed by the |
1018 | * user the pin mode control will take care of enabling the pin's | 990 | * user the pin mode control will take care of enabling the pin's |
@@ -1027,11 +999,11 @@ static const struct hda_verb cxt5045_test_init_verbs[] = { | |||
1027 | /* Set ADC connection select to match default mixer setting (mic1 | 999 | /* Set ADC connection select to match default mixer setting (mic1 |
1028 | * pin) | 1000 | * pin) |
1029 | */ | 1001 | */ |
1030 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00}, | 1002 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, |
1031 | {0x17, AC_VERB_SET_CONNECT_SEL, 0x00}, | 1003 | {0x17, AC_VERB_SET_CONNECT_SEL, 0x01}, |
1032 | 1004 | ||
1033 | /* Mute all inputs to mixer widget (even unconnected ones) */ | 1005 | /* Mute all inputs to mixer widget (even unconnected ones) */ |
1034 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* Mixer pin */ | 1006 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* Mixer */ |
1035 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* Mic1 pin */ | 1007 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* Mic1 pin */ |
1036 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* Line pin */ | 1008 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* Line pin */ |
1037 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* HP pin */ | 1009 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* HP pin */ |
@@ -1110,7 +1082,7 @@ static int patch_cxt5045(struct hda_codec *codec) | |||
1110 | if (!spec) | 1082 | if (!spec) |
1111 | return -ENOMEM; | 1083 | return -ENOMEM; |
1112 | codec->spec = spec; | 1084 | codec->spec = spec; |
1113 | codec->pin_amp_workaround = 1; | 1085 | codec->single_adc_amp = 1; |
1114 | 1086 | ||
1115 | spec->multiout.max_channels = 2; | 1087 | spec->multiout.max_channels = 2; |
1116 | spec->multiout.num_dacs = ARRAY_SIZE(cxt5045_dac_nids); | 1088 | spec->multiout.num_dacs = ARRAY_SIZE(cxt5045_dac_nids); |
@@ -4220,7 +4192,7 @@ static int cx_auto_add_capture_volume(struct hda_codec *codec, hda_nid_t nid, | |||
4220 | int idx = get_input_connection(codec, adc_nid, nid); | 4192 | int idx = get_input_connection(codec, adc_nid, nid); |
4221 | if (idx < 0) | 4193 | if (idx < 0) |
4222 | continue; | 4194 | continue; |
4223 | if (spec->single_adc_amp) | 4195 | if (codec->single_adc_amp) |
4224 | idx = 0; | 4196 | idx = 0; |
4225 | return cx_auto_add_volume_idx(codec, label, pfx, | 4197 | return cx_auto_add_volume_idx(codec, label, pfx, |
4226 | cidx, adc_nid, HDA_INPUT, idx); | 4198 | cidx, adc_nid, HDA_INPUT, idx); |
@@ -4275,7 +4247,7 @@ static int cx_auto_build_input_controls(struct hda_codec *codec) | |||
4275 | if (cidx < 0) | 4247 | if (cidx < 0) |
4276 | continue; | 4248 | continue; |
4277 | input_conn[i] = spec->imux_info[i].adc; | 4249 | input_conn[i] = spec->imux_info[i].adc; |
4278 | if (!spec->single_adc_amp) | 4250 | if (!codec->single_adc_amp) |
4279 | input_conn[i] |= cidx << 8; | 4251 | input_conn[i] |= cidx << 8; |
4280 | if (i > 0 && input_conn[i] != input_conn[0]) | 4252 | if (i > 0 && input_conn[i] != input_conn[0]) |
4281 | multi_connection = 1; | 4253 | multi_connection = 1; |
@@ -4466,15 +4438,17 @@ static int patch_conexant_auto(struct hda_codec *codec) | |||
4466 | if (!spec) | 4438 | if (!spec) |
4467 | return -ENOMEM; | 4439 | return -ENOMEM; |
4468 | codec->spec = spec; | 4440 | codec->spec = spec; |
4469 | codec->pin_amp_workaround = 1; | ||
4470 | 4441 | ||
4471 | switch (codec->vendor_id) { | 4442 | switch (codec->vendor_id) { |
4472 | case 0x14f15045: | 4443 | case 0x14f15045: |
4473 | spec->single_adc_amp = 1; | 4444 | codec->single_adc_amp = 1; |
4474 | break; | 4445 | break; |
4475 | case 0x14f15051: | 4446 | case 0x14f15051: |
4476 | add_cx5051_fake_mutes(codec); | 4447 | add_cx5051_fake_mutes(codec); |
4448 | codec->pin_amp_workaround = 1; | ||
4477 | break; | 4449 | break; |
4450 | default: | ||
4451 | codec->pin_amp_workaround = 1; | ||
4478 | } | 4452 | } |
4479 | 4453 | ||
4480 | apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl); | 4454 | apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl); |