aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c86
1 files changed, 67 insertions, 19 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 9f12d1fd02dc..ee1c4cd7f00a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -97,10 +97,20 @@ static hda_nid_t alc880_z71v_dac_nids[1] = {
97 0x02 97 0x02
98}; 98};
99 99
100#if 0
101/* The datasheet says the node 0x07 is connected from inputs,
102 * but it shows zero connection in the real implementation.
103 */
100static hda_nid_t alc880_adc_nids[3] = { 104static hda_nid_t alc880_adc_nids[3] = {
101 /* ADC0-2 */ 105 /* ADC0-2 */
102 0x07, 0x08, 0x09, 106 0x07, 0x08, 0x09,
103}; 107};
108#else
109static hda_nid_t alc880_adc_nids[2] = {
110 /* ADC1-2 */
111 0x08, 0x09,
112};
113#endif
104 114
105#define ALC880_DIGOUT_NID 0x06 115#define ALC880_DIGOUT_NID 0x06
106#define ALC880_DIGIN_NID 0x0a 116#define ALC880_DIGIN_NID 0x0a
@@ -380,10 +390,11 @@ static snd_kcontrol_new_t alc880_base_mixer[] = {
380 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 390 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
381 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT), 391 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
382 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT), 392 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
383 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), 393 /* We don't use NID 0x07 - see above */
384 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), 394 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
385 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), 395 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
386 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT), 396 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
397 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
387 { 398 {
388 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 399 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
389 /* The multiple "Capture Source" controls confuse alsamixer 400 /* The multiple "Capture Source" controls confuse alsamixer
@@ -434,10 +445,11 @@ static snd_kcontrol_new_t alc880_five_stack_mixer[] = {
434 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 445 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
435 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT), 446 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
436 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT), 447 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
437 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), 448 /* We don't use NID 0x07 - see above */
438 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), 449 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
439 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), 450 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
440 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT), 451 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
452 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
441 { 453 {
442 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 454 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
443 /* The multiple "Capture Source" controls confuse alsamixer 455 /* The multiple "Capture Source" controls confuse alsamixer
@@ -506,6 +518,8 @@ static snd_kcontrol_new_t alc880_z71v_mixer[] = {
506 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), 518 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
507 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), 519 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT),
508 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT), 520 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT),
521 HDA_CODEC_VOLUME_IDX("Capture Volume", 2, 0x09, 0x0, HDA_INPUT),
522 HDA_CODEC_MUTE_IDX("Capture Switch", 2, 0x09, 0x0, HDA_INPUT),
509 { 523 {
510 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 524 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
511 /* The multiple "Capture Source" controls confuse alsamixer 525 /* The multiple "Capture Source" controls confuse alsamixer
@@ -514,7 +528,7 @@ static snd_kcontrol_new_t alc880_z71v_mixer[] = {
514 */ 528 */
515 /* .name = "Capture Source", */ 529 /* .name = "Capture Source", */
516 .name = "Input Source", 530 .name = "Input Source",
517 .count = 2, 531 .count = 3,
518 .info = alc_mux_enum_info, 532 .info = alc_mux_enum_info,
519 .get = alc_mux_enum_get, 533 .get = alc_mux_enum_get,
520 .put = alc_mux_enum_put, 534 .put = alc_mux_enum_put,
@@ -564,8 +578,16 @@ static struct hda_verb alc880_init_verbs_three_stack[] = {
564 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 578 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
565 /* unmute amp left and right */ 579 /* unmute amp left and right */
566 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000}, 580 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
567 /* set connection select to line in (default select for this ADC) */ 581 /* set connection select to mic in */
568 {0x07, AC_VERB_SET_CONNECT_SEL, 0x02}, 582 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
583 /* unmute amp left and right */
584 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
585 /* set connection select to mic in */
586 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
587 /* unmute amp left and right */
588 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
589 /* set connection select to mic in */
590 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
569 /* unmute front mixer amp left (volume = 0) */ 591 /* unmute front mixer amp left (volume = 0) */
570 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, 592 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
571 /* mute pin widget amp left and right (no gain on this amp) */ 593 /* mute pin widget amp left and right (no gain on this amp) */
@@ -639,8 +661,16 @@ static struct hda_verb alc880_init_verbs_five_stack[] = {
639 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 661 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
640 /* unmute amp left and right */ 662 /* unmute amp left and right */
641 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000}, 663 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
642 /* set connection select to line in (default select for this ADC) */ 664 /* set connection select to mic in */
643 {0x07, AC_VERB_SET_CONNECT_SEL, 0x02}, 665 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
666 /* unmute amp left and right */
667 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
668 /* set connection select to mic in */
669 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
670 /* unmute amp left and right */
671 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
672 /* set connection select to mic in */
673 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
644 /* unmute front mixer amp left and right (volume = 0) */ 674 /* unmute front mixer amp left and right (volume = 0) */
645 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, 675 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
646 /* mute pin widget amp left and right (no gain on this amp) */ 676 /* mute pin widget amp left and right (no gain on this amp) */
@@ -798,9 +828,16 @@ static struct hda_verb alc880_z71v_init_verbs[] = {
798 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 828 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
799 /* unmute amp left and right */ 829 /* unmute amp left and right */
800 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000}, 830 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
801 /* set connection select to line in (default select for this ADC) */ 831 /* set connection select to mic in */
802 {0x07, AC_VERB_SET_CONNECT_SEL, 0x02}, 832 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
803 833 /* unmute amp left and right */
834 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
835 /* set connection select to mic in */
836 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
837 /* unmute amp left and right */
838 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
839 /* set connection select to mic in */
840 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
804 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) for mixer 841 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) for mixer
805 * widget(nid=0x0B) to support the input path of analog loopback 842 * widget(nid=0x0B) to support the input path of analog loopback
806 */ 843 */
@@ -941,7 +978,9 @@ static struct hda_pcm_stream alc880_pcm_analog_capture = {
941 .substreams = 2, 978 .substreams = 2,
942 .channels_min = 2, 979 .channels_min = 2,
943 .channels_max = 2, 980 .channels_max = 2,
944 .nid = 0x07, /* NID to query formats and rates */ 981 .nid = 0x08, /* NID to query formats and rates
982 * (0x07 might be broken on some devices)
983 */
945 .ops = { 984 .ops = {
946 .prepare = alc880_capture_pcm_prepare, 985 .prepare = alc880_capture_pcm_prepare,
947 .cleanup = alc880_capture_pcm_cleanup 986 .cleanup = alc880_capture_pcm_cleanup
@@ -1261,6 +1300,13 @@ static struct hda_verb alc880_test_init_verbs[] = {
1261 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1300 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1262 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1301 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1263 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1302 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1303 /* ADC set up */
1304 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
1305 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1306 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
1307 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1308 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
1309 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1264 { } 1310 { }
1265}; 1311};
1266#endif 1312#endif
@@ -1822,11 +1868,13 @@ static struct hda_verb alc882_init_verbs[] = {
1822 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))}, 1868 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
1823 /* ADC1: unmute amp left and right */ 1869 /* ADC1: unmute amp left and right */
1824 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000}, 1870 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
1871 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1825 /* ADC2: unmute amp left and right */ 1872 /* ADC2: unmute amp left and right */
1826 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000}, 1873 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
1874 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1827 /* ADC3: unmute amp left and right */ 1875 /* ADC3: unmute amp left and right */
1828 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000}, 1876 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
1829 1877 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1830 /* Unmute front loopback */ 1878 /* Unmute front loopback */
1831 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, 1879 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
1832 /* Unmute rear loopback */ 1880 /* Unmute rear loopback */