diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a91757316765..f857e963ff45 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -90,6 +90,7 @@ enum { | |||
90 | ALC660_3ST, | 90 | ALC660_3ST, |
91 | ALC861_3ST_DIG, | 91 | ALC861_3ST_DIG, |
92 | ALC861_6ST_DIG, | 92 | ALC861_6ST_DIG, |
93 | ALC861_UNIWILL_M31, | ||
93 | ALC861_AUTO, | 94 | ALC861_AUTO, |
94 | ALC861_MODEL_LAST, | 95 | ALC861_MODEL_LAST, |
95 | }; | 96 | }; |
@@ -6021,6 +6022,23 @@ static struct hda_channel_mode alc861_threestack_modes[2] = { | |||
6021 | { 2, alc861_threestack_ch2_init }, | 6022 | { 2, alc861_threestack_ch2_init }, |
6022 | { 6, alc861_threestack_ch6_init }, | 6023 | { 6, alc861_threestack_ch6_init }, |
6023 | }; | 6024 | }; |
6025 | /* Set mic1 as input and unmute the mixer */ | ||
6026 | static struct hda_verb alc861_uniwill_m31_ch2_init[] = { | ||
6027 | { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, | ||
6028 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8)) }, /*mic*/ | ||
6029 | { } /* end */ | ||
6030 | }; | ||
6031 | /* Set mic1 as output and mute mixer */ | ||
6032 | static struct hda_verb alc861_uniwill_m31_ch4_init[] = { | ||
6033 | { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 }, | ||
6034 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8)) }, /*mic*/ | ||
6035 | { } /* end */ | ||
6036 | }; | ||
6037 | |||
6038 | static struct hda_channel_mode alc861_uniwill_m31_modes[2] = { | ||
6039 | { 2, alc861_uniwill_m31_ch2_init }, | ||
6040 | { 4, alc861_uniwill_m31_ch4_init }, | ||
6041 | }; | ||
6024 | 6042 | ||
6025 | /* patch-ALC861 */ | 6043 | /* patch-ALC861 */ |
6026 | 6044 | ||
@@ -6099,6 +6117,47 @@ static struct snd_kcontrol_new alc861_3ST_mixer[] = { | |||
6099 | }, | 6117 | }, |
6100 | { } /* end */ | 6118 | { } /* end */ |
6101 | }; | 6119 | }; |
6120 | static struct snd_kcontrol_new alc861_uniwill_m31_mixer[] = { | ||
6121 | /* output mixer control */ | ||
6122 | HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT), | ||
6123 | HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT), | ||
6124 | HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT), | ||
6125 | HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT), | ||
6126 | /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */ | ||
6127 | |||
6128 | /* Input mixer control */ | ||
6129 | /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT), | ||
6130 | HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */ | ||
6131 | HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT), | ||
6132 | HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT), | ||
6133 | HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT), | ||
6134 | HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT), | ||
6135 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT), | ||
6136 | HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT), | ||
6137 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT), | ||
6138 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), | ||
6139 | |||
6140 | /* Capture mixer control */ | ||
6141 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), | ||
6142 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), | ||
6143 | { | ||
6144 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
6145 | .name = "Capture Source", | ||
6146 | .count = 1, | ||
6147 | .info = alc_mux_enum_info, | ||
6148 | .get = alc_mux_enum_get, | ||
6149 | .put = alc_mux_enum_put, | ||
6150 | }, | ||
6151 | { | ||
6152 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
6153 | .name = "Channel Mode", | ||
6154 | .info = alc_ch_mode_info, | ||
6155 | .get = alc_ch_mode_get, | ||
6156 | .put = alc_ch_mode_put, | ||
6157 | .private_value = ARRAY_SIZE(alc861_uniwill_m31_modes), | ||
6158 | }, | ||
6159 | { } /* end */ | ||
6160 | }; | ||
6102 | 6161 | ||
6103 | /* | 6162 | /* |
6104 | * generic initialization of ADC, input mixers and output mixers | 6163 | * generic initialization of ADC, input mixers and output mixers |
@@ -6227,6 +6286,67 @@ static struct hda_verb alc861_threestack_init_verbs[] = { | |||
6227 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, | 6286 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, |
6228 | { } | 6287 | { } |
6229 | }; | 6288 | }; |
6289 | |||
6290 | static struct hda_verb alc861_uniwill_m31_init_verbs[] = { | ||
6291 | /* | ||
6292 | * Unmute ADC0 and set the default input to mic-in | ||
6293 | */ | ||
6294 | /* port-A for surround (rear panel) */ | ||
6295 | { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 }, | ||
6296 | /* port-B for mic-in (rear panel) with vref */ | ||
6297 | { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, | ||
6298 | /* port-C for line-in (rear panel) */ | ||
6299 | { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 }, | ||
6300 | /* port-D for Front */ | ||
6301 | { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 }, | ||
6302 | { 0x0b, AC_VERB_SET_CONNECT_SEL, 0x00 }, | ||
6303 | /* port-E for HP out (front panel) */ | ||
6304 | { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, // this has to be set to VREF80 | ||
6305 | /* route front PCM to HP */ | ||
6306 | { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x01 }, | ||
6307 | /* port-F for mic-in (front panel) with vref */ | ||
6308 | { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, | ||
6309 | /* port-G for CLFE (rear panel) */ | ||
6310 | { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 }, | ||
6311 | /* port-H for side (rear panel) */ | ||
6312 | { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 }, | ||
6313 | /* CD-in */ | ||
6314 | { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 }, | ||
6315 | /* route front mic to ADC1*/ | ||
6316 | {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
6317 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6318 | /* Unmute DAC0~3 & spdif out*/ | ||
6319 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6320 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6321 | {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6322 | {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6323 | {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6324 | |||
6325 | /* Unmute Mixer 14 (mic) 1c (Line in)*/ | ||
6326 | {0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6327 | {0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6328 | {0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6329 | {0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6330 | |||
6331 | /* Unmute Stereo Mixer 15 */ | ||
6332 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6333 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6334 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, | ||
6335 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c }, //Output 0~12 step | ||
6336 | |||
6337 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6338 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6339 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6340 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6341 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6342 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6343 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
6344 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6345 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, // hp used DAC 3 (Front) | ||
6346 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, | ||
6347 | { } | ||
6348 | }; | ||
6349 | |||
6230 | /* | 6350 | /* |
6231 | * generic initialization of ADC, input mixers and output mixers | 6351 | * generic initialization of ADC, input mixers and output mixers |
6232 | */ | 6352 | */ |
@@ -6561,6 +6681,9 @@ static struct hda_board_config alc861_cfg_tbl[] = { | |||
6561 | .config = ALC660_3ST }, | 6681 | .config = ALC660_3ST }, |
6562 | { .modelname = "3stack-dig", .config = ALC861_3ST_DIG }, | 6682 | { .modelname = "3stack-dig", .config = ALC861_3ST_DIG }, |
6563 | { .modelname = "6stack-dig", .config = ALC861_6ST_DIG }, | 6683 | { .modelname = "6stack-dig", .config = ALC861_6ST_DIG }, |
6684 | { .modelname = "uniwill-m31", .config = ALC861_UNIWILL_M31}, | ||
6685 | { .pci_subvendor = 0x1584, .pci_subdevice = 0x9072, | ||
6686 | .config = ALC861_UNIWILL_M31 }, | ||
6564 | { .modelname = "auto", .config = ALC861_AUTO }, | 6687 | { .modelname = "auto", .config = ALC861_AUTO }, |
6565 | {} | 6688 | {} |
6566 | }; | 6689 | }; |
@@ -6615,6 +6738,20 @@ static struct alc_config_preset alc861_presets[] = { | |||
6615 | .adc_nids = alc861_adc_nids, | 6738 | .adc_nids = alc861_adc_nids, |
6616 | .input_mux = &alc861_capture_source, | 6739 | .input_mux = &alc861_capture_source, |
6617 | }, | 6740 | }, |
6741 | [ALC861_UNIWILL_M31] = { | ||
6742 | .mixers = { alc861_uniwill_m31_mixer }, | ||
6743 | .init_verbs = { alc861_uniwill_m31_init_verbs }, | ||
6744 | .num_dacs = ARRAY_SIZE(alc861_dac_nids), | ||
6745 | .dac_nids = alc861_dac_nids, | ||
6746 | .dig_out_nid = ALC861_DIGOUT_NID, | ||
6747 | .num_channel_mode = ARRAY_SIZE(alc861_uniwill_m31_modes), | ||
6748 | .channel_mode = alc861_uniwill_m31_modes, | ||
6749 | .need_dac_fix = 1, | ||
6750 | .num_adc_nids = ARRAY_SIZE(alc861_adc_nids), | ||
6751 | .adc_nids = alc861_adc_nids, | ||
6752 | .input_mux = &alc861_capture_source, | ||
6753 | }, | ||
6754 | |||
6618 | }; | 6755 | }; |
6619 | 6756 | ||
6620 | 6757 | ||