diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 96 |
1 files changed, 77 insertions, 19 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index e8003d99f0b..2b00c4afdf9 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1826,9 +1826,14 @@ static hda_nid_t ad1988_capsrc_nids[3] = { | |||
1826 | 0x0c, 0x0d, 0x0e | 1826 | 0x0c, 0x0d, 0x0e |
1827 | }; | 1827 | }; |
1828 | 1828 | ||
1829 | #define AD1988_SPDIF_OUT 0x02 | 1829 | #define AD1988_SPDIF_OUT 0x02 |
1830 | #define AD1988_SPDIF_OUT_HDMI 0x0b | ||
1830 | #define AD1988_SPDIF_IN 0x07 | 1831 | #define AD1988_SPDIF_IN 0x07 |
1831 | 1832 | ||
1833 | static hda_nid_t ad1989b_slave_dig_outs[2] = { | ||
1834 | AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI | ||
1835 | }; | ||
1836 | |||
1832 | static struct hda_input_mux ad1988_6stack_capture_source = { | 1837 | static struct hda_input_mux ad1988_6stack_capture_source = { |
1833 | .num_items = 5, | 1838 | .num_items = 5, |
1834 | .items = { | 1839 | .items = { |
@@ -2143,6 +2148,7 @@ static struct snd_kcontrol_new ad1988_spdif_in_mixers[] = { | |||
2143 | 2148 | ||
2144 | static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { | 2149 | static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { |
2145 | HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), | 2150 | HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), |
2151 | HDA_CODEC_VOLUME("HDMI Playback Volume", 0x1d, 0x0, HDA_OUTPUT), | ||
2146 | { } /* end */ | 2152 | { } /* end */ |
2147 | }; | 2153 | }; |
2148 | 2154 | ||
@@ -2207,6 +2213,8 @@ static struct hda_verb ad1988_6stack_init_verbs[] = { | |||
2207 | {0x34, AC_VERB_SET_CONNECT_SEL, 0x0}, | 2213 | {0x34, AC_VERB_SET_CONNECT_SEL, 0x0}, |
2208 | /* Analog CD Input */ | 2214 | /* Analog CD Input */ |
2209 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | 2215 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, |
2216 | /* Analog Mix output amp */ | ||
2217 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ | ||
2210 | 2218 | ||
2211 | { } | 2219 | { } |
2212 | }; | 2220 | }; |
@@ -2247,8 +2255,12 @@ static struct hda_verb ad1988_spdif_init_verbs[] = { | |||
2247 | 2255 | ||
2248 | /* AD1989 has no ADC -> SPDIF route */ | 2256 | /* AD1989 has no ADC -> SPDIF route */ |
2249 | static struct hda_verb ad1989_spdif_init_verbs[] = { | 2257 | static struct hda_verb ad1989_spdif_init_verbs[] = { |
2250 | /* SPDIF out pin */ | 2258 | /* SPDIF-1 out pin */ |
2259 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, | ||
2251 | {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ | 2260 | {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ |
2261 | /* SPDIF-2/HDMI out pin */ | ||
2262 | {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, | ||
2263 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ | ||
2252 | { } | 2264 | { } |
2253 | }; | 2265 | }; |
2254 | 2266 | ||
@@ -2336,6 +2348,8 @@ static struct hda_verb ad1988_3stack_init_verbs[] = { | |||
2336 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 2348 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
2337 | {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 2349 | {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
2338 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 2350 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
2351 | /* Analog Mix output amp */ | ||
2352 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ | ||
2339 | { } | 2353 | { } |
2340 | }; | 2354 | }; |
2341 | 2355 | ||
@@ -2409,6 +2423,8 @@ static struct hda_verb ad1988_laptop_init_verbs[] = { | |||
2409 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 2423 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
2410 | {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 2424 | {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
2411 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 2425 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
2426 | /* Analog Mix output amp */ | ||
2427 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ | ||
2412 | { } | 2428 | { } |
2413 | }; | 2429 | }; |
2414 | 2430 | ||
@@ -2868,6 +2884,7 @@ static struct snd_pci_quirk ad1988_cfg_tbl[] = { | |||
2868 | SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), | 2884 | SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), |
2869 | SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), | 2885 | SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), |
2870 | SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG), | 2886 | SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG), |
2887 | SND_PCI_QUIRK(0x1043, 0x8311, "Asus P5Q-Premium/Pro", AD1988_6STACK_DIG), | ||
2871 | {} | 2888 | {} |
2872 | }; | 2889 | }; |
2873 | 2890 | ||
@@ -2975,6 +2992,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
2975 | ad1989_spdif_out_mixers; | 2992 | ad1989_spdif_out_mixers; |
2976 | spec->init_verbs[spec->num_init_verbs++] = | 2993 | spec->init_verbs[spec->num_init_verbs++] = |
2977 | ad1989_spdif_init_verbs; | 2994 | ad1989_spdif_init_verbs; |
2995 | codec->slave_dig_outs = ad1989b_slave_dig_outs; | ||
2978 | } else { | 2996 | } else { |
2979 | spec->mixers[spec->num_mixers++] = | 2997 | spec->mixers[spec->num_mixers++] = |
2980 | ad1988_spdif_out_mixers; | 2998 | ad1988_spdif_out_mixers; |
@@ -3911,7 +3929,7 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
3911 | 3929 | ||
3912 | 3930 | ||
3913 | /* | 3931 | /* |
3914 | * AD1882 | 3932 | * AD1882 / AD1882A |
3915 | * | 3933 | * |
3916 | * port-A - front hp-out | 3934 | * port-A - front hp-out |
3917 | * port-B - front mic-in | 3935 | * port-B - front mic-in |
@@ -3948,6 +3966,18 @@ static struct hda_input_mux ad1882_capture_source = { | |||
3948 | }, | 3966 | }, |
3949 | }; | 3967 | }; |
3950 | 3968 | ||
3969 | /* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */ | ||
3970 | static struct hda_input_mux ad1882a_capture_source = { | ||
3971 | .num_items = 5, | ||
3972 | .items = { | ||
3973 | { "Front Mic", 0x1 }, | ||
3974 | { "Mic", 0x4}, | ||
3975 | { "Line", 0x2 }, | ||
3976 | { "Digital Mic", 0x06 }, | ||
3977 | { "Mix", 0x7 }, | ||
3978 | }, | ||
3979 | }; | ||
3980 | |||
3951 | static struct snd_kcontrol_new ad1882_base_mixers[] = { | 3981 | static struct snd_kcontrol_new ad1882_base_mixers[] = { |
3952 | HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), | 3982 | HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), |
3953 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), | 3983 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), |
@@ -3957,16 +3987,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = { | |||
3957 | HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT), | 3987 | HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT), |
3958 | HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT), | 3988 | HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT), |
3959 | HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT), | 3989 | HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT), |
3960 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), | 3990 | |
3961 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), | ||
3962 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), | ||
3963 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), | ||
3964 | HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x04, HDA_INPUT), | ||
3965 | HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x04, HDA_INPUT), | ||
3966 | HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT), | ||
3967 | HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT), | ||
3968 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT), | ||
3969 | HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT), | ||
3970 | HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), | 3991 | HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), |
3971 | HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), | 3992 | HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), |
3972 | HDA_CODEC_VOLUME("Line-In Boost", 0x3a, 0x0, HDA_OUTPUT), | 3993 | HDA_CODEC_VOLUME("Line-In Boost", 0x3a, 0x0, HDA_OUTPUT), |
@@ -3999,6 +4020,35 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = { | |||
3999 | { } /* end */ | 4020 | { } /* end */ |
4000 | }; | 4021 | }; |
4001 | 4022 | ||
4023 | static struct snd_kcontrol_new ad1882_loopback_mixers[] = { | ||
4024 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), | ||
4025 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), | ||
4026 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), | ||
4027 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), | ||
4028 | HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x04, HDA_INPUT), | ||
4029 | HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x04, HDA_INPUT), | ||
4030 | HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT), | ||
4031 | HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT), | ||
4032 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT), | ||
4033 | HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT), | ||
4034 | { } /* end */ | ||
4035 | }; | ||
4036 | |||
4037 | static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { | ||
4038 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), | ||
4039 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), | ||
4040 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT), | ||
4041 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x04, HDA_INPUT), | ||
4042 | HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x01, HDA_INPUT), | ||
4043 | HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x01, HDA_INPUT), | ||
4044 | HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT), | ||
4045 | HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT), | ||
4046 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT), | ||
4047 | HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT), | ||
4048 | HDA_CODEC_VOLUME("Digital Mic Boost", 0x1f, 0x0, HDA_INPUT), | ||
4049 | { } /* end */ | ||
4050 | }; | ||
4051 | |||
4002 | static struct snd_kcontrol_new ad1882_3stack_mixers[] = { | 4052 | static struct snd_kcontrol_new ad1882_3stack_mixers[] = { |
4003 | HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), | 4053 | HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), |
4004 | HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), | 4054 | HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), |
@@ -4168,9 +4218,16 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4168 | spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); | 4218 | spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); |
4169 | spec->adc_nids = ad1882_adc_nids; | 4219 | spec->adc_nids = ad1882_adc_nids; |
4170 | spec->capsrc_nids = ad1882_capsrc_nids; | 4220 | spec->capsrc_nids = ad1882_capsrc_nids; |
4171 | spec->input_mux = &ad1882_capture_source; | 4221 | if (codec->vendor_id == 0x11d1882) |
4172 | spec->num_mixers = 1; | 4222 | spec->input_mux = &ad1882_capture_source; |
4223 | else | ||
4224 | spec->input_mux = &ad1882a_capture_source; | ||
4225 | spec->num_mixers = 2; | ||
4173 | spec->mixers[0] = ad1882_base_mixers; | 4226 | spec->mixers[0] = ad1882_base_mixers; |
4227 | if (codec->vendor_id == 0x11d1882) | ||
4228 | spec->mixers[1] = ad1882_loopback_mixers; | ||
4229 | else | ||
4230 | spec->mixers[1] = ad1882a_loopback_mixers; | ||
4174 | spec->num_init_verbs = 1; | 4231 | spec->num_init_verbs = 1; |
4175 | spec->init_verbs[0] = ad1882_init_verbs; | 4232 | spec->init_verbs[0] = ad1882_init_verbs; |
4176 | spec->spdif_route = 0; | 4233 | spec->spdif_route = 0; |
@@ -4187,8 +4244,8 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4187 | switch (board_config) { | 4244 | switch (board_config) { |
4188 | default: | 4245 | default: |
4189 | case AD1882_3STACK: | 4246 | case AD1882_3STACK: |
4190 | spec->num_mixers = 2; | 4247 | spec->num_mixers = 3; |
4191 | spec->mixers[1] = ad1882_3stack_mixers; | 4248 | spec->mixers[2] = ad1882_3stack_mixers; |
4192 | spec->channel_mode = ad1882_modes; | 4249 | spec->channel_mode = ad1882_modes; |
4193 | spec->num_channel_mode = ARRAY_SIZE(ad1882_modes); | 4250 | spec->num_channel_mode = ARRAY_SIZE(ad1882_modes); |
4194 | spec->need_dac_fix = 1; | 4251 | spec->need_dac_fix = 1; |
@@ -4196,8 +4253,8 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4196 | spec->multiout.num_dacs = 1; | 4253 | spec->multiout.num_dacs = 1; |
4197 | break; | 4254 | break; |
4198 | case AD1882_6STACK: | 4255 | case AD1882_6STACK: |
4199 | spec->num_mixers = 2; | 4256 | spec->num_mixers = 3; |
4200 | spec->mixers[1] = ad1882_6stack_mixers; | 4257 | spec->mixers[2] = ad1882_6stack_mixers; |
4201 | break; | 4258 | break; |
4202 | } | 4259 | } |
4203 | return 0; | 4260 | return 0; |
@@ -4220,6 +4277,7 @@ struct hda_codec_preset snd_hda_preset_analog[] = { | |||
4220 | { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, | 4277 | { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, |
4221 | { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, | 4278 | { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, |
4222 | { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 }, | 4279 | { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 }, |
4280 | { .id = 0x11d4882a, .name = "AD1882A", .patch = patch_ad1882 }, | ||
4223 | { .id = 0x11d4989a, .name = "AD1989A", .patch = patch_ad1988 }, | 4281 | { .id = 0x11d4989a, .name = "AD1989A", .patch = patch_ad1988 }, |
4224 | { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 }, | 4282 | { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 }, |
4225 | {} /* terminator */ | 4283 | {} /* terminator */ |