aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt1
-rw-r--r--Documentation/sound/alsa/HD-Audio.txt6
-rw-r--r--sound/pci/hda/hda_intel.c5
-rw-r--r--sound/pci/hda/patch_analog.c17
-rw-r--r--sound/pci/hda/patch_realtek.c127
5 files changed, 145 insertions, 11 deletions
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index 9000cd84d076..e93affff3af8 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -126,6 +126,7 @@ ALC882/883/885/888/889
126 mb5 Macbook 5,1 126 mb5 Macbook 5,1
127 mbp3 Macbook Pro rev3 127 mbp3 Macbook Pro rev3
128 imac24 iMac 24'' with jack detection 128 imac24 iMac 24'' with jack detection
129 imac91 iMac 9,1
129 w2jc ASUS W2JC 130 w2jc ASUS W2JC
130 3stack-2ch-dig 3-jack with SPDIF I/O (ALC883) 131 3stack-2ch-dig 3-jack with SPDIF I/O (ALC883)
131 alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883) 132 alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883)
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt
index 7b8a5f947d1d..6325bec06a72 100644
--- a/Documentation/sound/alsa/HD-Audio.txt
+++ b/Documentation/sound/alsa/HD-Audio.txt
@@ -624,11 +624,13 @@ hda-verb. The program gives you an easy-to-use GUI stuff for showing
624the widget information and adjusting the amp values, as well as the 624the widget information and adjusting the amp values, as well as the
625proc-compatible output. 625proc-compatible output.
626 626
627The hda-analyzer is a part of alsa.git repository in 627The hda-analyzer:
628alsa-project.org:
629 628
630- http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer 629- http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer
631 630
631is a part of alsa.git repository in alsa-project.org:
632
633- git://git.alsa-project.org/alsa.git
632 634
633Codecgraph 635Codecgraph
634~~~~~~~~~~ 636~~~~~~~~~~
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index d822bfc6cad6..efcc4f7c57f2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2450,6 +2450,11 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2450 } 2450 }
2451 } 2451 }
2452 2452
2453 /* disable 64bit DMA address for Teradici */
2454 /* it does not work with device 6549:1200 subsys e4a2:040b */
2455 if (chip->driver_type == AZX_DRIVER_TERA)
2456 gcap &= ~ICH6_GCAP_64OK;
2457
2453 /* allow 64bit DMA address if supported by H/W */ 2458 /* allow 64bit DMA address if supported by H/W */
2454 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) 2459 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
2455 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64)); 2460 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 455a0494f907..447eda1f6770 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,7 +72,8 @@ struct ad198x_spec {
72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
73 73
74 unsigned int jack_present :1; 74 unsigned int jack_present :1;
75 unsigned int inv_jack_detect:1; 75 unsigned int inv_jack_detect:1; /* inverted jack-detection */
76 unsigned int inv_eapd:1; /* inverted EAPD implementation */
76 77
77#ifdef CONFIG_SND_HDA_POWER_SAVE 78#ifdef CONFIG_SND_HDA_POWER_SAVE
78 struct hda_loopback_check loopback; 79 struct hda_loopback_check loopback;
@@ -458,7 +459,7 @@ static struct hda_codec_ops ad198x_patch_ops = {
458 459
459/* 460/*
460 * EAPD control 461 * EAPD control
461 * the private value = nid | (invert << 8) 462 * the private value = nid
462 */ 463 */
463#define ad198x_eapd_info snd_ctl_boolean_mono_info 464#define ad198x_eapd_info snd_ctl_boolean_mono_info
464 465
@@ -467,8 +468,7 @@ static int ad198x_eapd_get(struct snd_kcontrol *kcontrol,
467{ 468{
468 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 469 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
469 struct ad198x_spec *spec = codec->spec; 470 struct ad198x_spec *spec = codec->spec;
470 int invert = (kcontrol->private_value >> 8) & 1; 471 if (spec->inv_eapd)
471 if (invert)
472 ucontrol->value.integer.value[0] = ! spec->cur_eapd; 472 ucontrol->value.integer.value[0] = ! spec->cur_eapd;
473 else 473 else
474 ucontrol->value.integer.value[0] = spec->cur_eapd; 474 ucontrol->value.integer.value[0] = spec->cur_eapd;
@@ -480,11 +480,10 @@ static int ad198x_eapd_put(struct snd_kcontrol *kcontrol,
480{ 480{
481 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 481 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
482 struct ad198x_spec *spec = codec->spec; 482 struct ad198x_spec *spec = codec->spec;
483 int invert = (kcontrol->private_value >> 8) & 1;
484 hda_nid_t nid = kcontrol->private_value & 0xff; 483 hda_nid_t nid = kcontrol->private_value & 0xff;
485 unsigned int eapd; 484 unsigned int eapd;
486 eapd = !!ucontrol->value.integer.value[0]; 485 eapd = !!ucontrol->value.integer.value[0];
487 if (invert) 486 if (spec->inv_eapd)
488 eapd = !eapd; 487 eapd = !eapd;
489 if (eapd == spec->cur_eapd) 488 if (eapd == spec->cur_eapd)
490 return 0; 489 return 0;
@@ -705,7 +704,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
705 .info = ad198x_eapd_info, 704 .info = ad198x_eapd_info,
706 .get = ad198x_eapd_get, 705 .get = ad198x_eapd_get,
707 .put = ad198x_eapd_put, 706 .put = ad198x_eapd_put,
708 .private_value = 0x1b | (1 << 8), /* port-D, inversed */ 707 .private_value = 0x1b, /* port-D */
709 }, 708 },
710 { } /* end */ 709 { } /* end */
711}; 710};
@@ -1074,6 +1073,7 @@ static int patch_ad1986a(struct hda_codec *codec)
1074 spec->loopback.amplist = ad1986a_loopbacks; 1073 spec->loopback.amplist = ad1986a_loopbacks;
1075#endif 1074#endif
1076 spec->vmaster_nid = 0x1b; 1075 spec->vmaster_nid = 0x1b;
1076 spec->inv_eapd = 1; /* AD1986A has the inverted EAPD implementation */
1077 1077
1078 codec->patch_ops = ad198x_patch_ops; 1078 codec->patch_ops = ad198x_patch_ops;
1079 1079
@@ -2124,7 +2124,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
2124 .info = ad198x_eapd_info, 2124 .info = ad198x_eapd_info,
2125 .get = ad198x_eapd_get, 2125 .get = ad198x_eapd_get,
2126 .put = ad198x_eapd_put, 2126 .put = ad198x_eapd_put,
2127 .private_value = 0x12 | (1 << 8), /* port-D, inversed */ 2127 .private_value = 0x12, /* port-D */
2128 }, 2128 },
2129 2129
2130 { } /* end */ 2130 { } /* end */
@@ -3065,6 +3065,7 @@ static int patch_ad1988(struct hda_codec *codec)
3065 spec->input_mux = &ad1988_laptop_capture_source; 3065 spec->input_mux = &ad1988_laptop_capture_source;
3066 spec->num_mixers = 1; 3066 spec->num_mixers = 1;
3067 spec->mixers[0] = ad1988_laptop_mixers; 3067 spec->mixers[0] = ad1988_laptop_mixers;
3068 spec->inv_eapd = 1; /* inverted EAPD */
3068 spec->num_init_verbs = 1; 3069 spec->num_init_verbs = 1;
3069 spec->init_verbs[0] = ad1988_laptop_init_verbs; 3070 spec->init_verbs[0] = ad1988_laptop_init_verbs;
3070 if (board_config == AD1988_LAPTOP_DIG) 3071 if (board_config == AD1988_LAPTOP_DIG)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d967836f36bb..deecdd2d5d37 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -208,6 +208,7 @@ enum {
208 ALC885_MBP3, 208 ALC885_MBP3,
209 ALC885_MB5, 209 ALC885_MB5,
210 ALC885_IMAC24, 210 ALC885_IMAC24,
211 ALC885_IMAC91,
211 ALC883_3ST_2ch_DIG, 212 ALC883_3ST_2ch_DIG,
212 ALC883_3ST_6ch_DIG, 213 ALC883_3ST_6ch_DIG,
213 ALC883_3ST_6ch, 214 ALC883_3ST_6ch,
@@ -2400,6 +2401,8 @@ static const char *alc_slave_sws[] = {
2400 "Speaker Playback Switch", 2401 "Speaker Playback Switch",
2401 "Mono Playback Switch", 2402 "Mono Playback Switch",
2402 "IEC958 Playback Switch", 2403 "IEC958 Playback Switch",
2404 "Line-Out Playback Switch",
2405 "PCM Playback Switch",
2403 NULL, 2406 NULL,
2404}; 2407};
2405 2408
@@ -7050,6 +7053,20 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = {
7050 { } /* end */ 7053 { } /* end */
7051}; 7054};
7052 7055
7056static struct snd_kcontrol_new alc885_imac91_mixer[] = {
7057 HDA_CODEC_VOLUME("Line-Out Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7058 HDA_BIND_MUTE ("Line-Out Playback Switch", 0x0c, 0x02, HDA_INPUT),
7059 HDA_CODEC_MUTE ("Speaker Playback Switch", 0x14, 0x00, HDA_OUTPUT),
7060 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
7061 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7062 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7063 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
7064 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
7065 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT),
7066 { } /* end */
7067};
7068
7069
7053static struct snd_kcontrol_new alc882_w2jc_mixer[] = { 7070static struct snd_kcontrol_new alc882_w2jc_mixer[] = {
7054 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 7071 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7055 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 7072 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
@@ -7505,6 +7522,66 @@ static struct hda_verb alc885_mbp3_init_verbs[] = {
7505 { } 7522 { }
7506}; 7523};
7507 7524
7525/* iMac 9,1 */
7526static struct hda_verb alc885_imac91_init_verbs[] = {
7527 /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
7528 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7529 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7530 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7531 /* Rear mixer */
7532 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7533 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7534 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7535 /* HP Pin: output 0 (0x0c) */
7536 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7537 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7538 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7539 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7540 /* Internal Speakers: output 0 (0x0d) */
7541 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7542 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7543 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
7544 /* Mic (rear) pin: input vref at 80% */
7545 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7546 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7547 /* Front Mic pin: input vref at 80% */
7548 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7549 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7550 /* Line In pin: use output 1 when in LineOut mode */
7551 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7552 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7553 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
7554
7555 /* FIXME: use matrix-type input source selection */
7556 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7557 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7558 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7559 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7560 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7561 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7562 /* Input mixer2 */
7563 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7564 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7565 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7566 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7567 /* Input mixer3 */
7568 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7569 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7570 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7571 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7572 /* ADC1: mute amp left and right */
7573 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7574 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
7575 /* ADC2: mute amp left and right */
7576 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7577 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
7578 /* ADC3: mute amp left and right */
7579 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7580 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7581
7582 { }
7583};
7584
7508/* iMac 24 mixer. */ 7585/* iMac 24 mixer. */
7509static struct snd_kcontrol_new alc885_imac24_mixer[] = { 7586static struct snd_kcontrol_new alc885_imac24_mixer[] = {
7510 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7587 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
@@ -7551,6 +7628,26 @@ static void alc885_mbp3_setup(struct hda_codec *codec)
7551 spec->autocfg.speaker_pins[0] = 0x14; 7628 spec->autocfg.speaker_pins[0] = 0x14;
7552} 7629}
7553 7630
7631static void alc885_imac91_automute(struct hda_codec *codec)
7632{
7633 unsigned int present;
7634
7635 present = snd_hda_codec_read(codec, 0x14, 0,
7636 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
7637 snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
7638 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
7639 snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0,
7640 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
7641
7642}
7643
7644static void alc885_imac91_unsol_event(struct hda_codec *codec,
7645 unsigned int res)
7646{
7647 /* Headphone insertion or removal. */
7648 if ((res >> 26) == ALC880_HP_EVENT)
7649 alc885_imac91_automute(codec);
7650}
7554 7651
7555static struct hda_verb alc882_targa_verbs[] = { 7652static struct hda_verb alc882_targa_verbs[] = {
7556 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7653 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
@@ -8718,6 +8815,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = {
8718 [ALC885_MB5] = "mb5", 8815 [ALC885_MB5] = "mb5",
8719 [ALC885_MBP3] = "mbp3", 8816 [ALC885_MBP3] = "mbp3",
8720 [ALC885_IMAC24] = "imac24", 8817 [ALC885_IMAC24] = "imac24",
8818 [ALC885_IMAC91] = "imac91",
8721 [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig", 8819 [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig",
8722 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig", 8820 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
8723 [ALC883_3ST_6ch] = "3stack-6ch", 8821 [ALC883_3ST_6ch] = "3stack-6ch",
@@ -8891,6 +8989,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
8891 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31), 8989 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
8892 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3), 8990 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
8893 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), 8991 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
8992 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
8894 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), 8993 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
8895 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, 8994 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
8896 * so apparently no perfect solution yet 8995 * so apparently no perfect solution yet
@@ -9002,6 +9101,20 @@ static struct alc_config_preset alc882_presets[] = {
9002 .setup = alc885_imac24_setup, 9101 .setup = alc885_imac24_setup,
9003 .init_hook = alc885_imac24_init_hook, 9102 .init_hook = alc885_imac24_init_hook,
9004 }, 9103 },
9104 [ALC885_IMAC91] = {
9105 .mixers = { alc885_imac91_mixer, alc882_chmode_mixer },
9106 .init_verbs = { alc885_imac91_init_verbs,
9107 alc880_gpio1_init_verbs },
9108 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
9109 .dac_nids = alc882_dac_nids,
9110 .channel_mode = alc885_mbp_4ch_modes,
9111 .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes),
9112 .input_mux = &alc882_capture_source,
9113 .dig_out_nid = ALC882_DIGOUT_NID,
9114 .dig_in_nid = ALC882_DIGIN_NID,
9115 .unsol_event = alc885_imac91_unsol_event,
9116 .init_hook = alc885_imac91_automute,
9117 },
9005 [ALC882_TARGA] = { 9118 [ALC882_TARGA] = {
9006 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, 9119 .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
9007 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs, 9120 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
@@ -9908,10 +10021,12 @@ static int patch_alc882(struct hda_codec *codec)
9908 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ 10021 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
9909 10022
9910 if (!spec->adc_nids && spec->input_mux) { 10023 if (!spec->adc_nids && spec->input_mux) {
9911 int i; 10024 int i, j;
9912 spec->num_adc_nids = 0; 10025 spec->num_adc_nids = 0;
9913 for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) { 10026 for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) {
10027 const struct hda_input_mux *imux = spec->input_mux;
9914 hda_nid_t cap; 10028 hda_nid_t cap;
10029 hda_nid_t items[16];
9915 hda_nid_t nid = alc882_adc_nids[i]; 10030 hda_nid_t nid = alc882_adc_nids[i];
9916 unsigned int wcap = get_wcaps(codec, nid); 10031 unsigned int wcap = get_wcaps(codec, nid);
9917 /* get type */ 10032 /* get type */
@@ -9922,6 +10037,15 @@ static int patch_alc882(struct hda_codec *codec)
9922 err = snd_hda_get_connections(codec, nid, &cap, 1); 10037 err = snd_hda_get_connections(codec, nid, &cap, 1);
9923 if (err < 0) 10038 if (err < 0)
9924 continue; 10039 continue;
10040 err = snd_hda_get_connections(codec, cap, items,
10041 ARRAY_SIZE(items));
10042 if (err < 0)
10043 continue;
10044 for (j = 0; j < imux->num_items; j++)
10045 if (imux->items[j].index >= err)
10046 break;
10047 if (j < imux->num_items)
10048 continue;
9925 spec->private_capsrc_nids[spec->num_adc_nids] = cap; 10049 spec->private_capsrc_nids[spec->num_adc_nids] = cap;
9926 spec->num_adc_nids++; 10050 spec->num_adc_nids++;
9927 } 10051 }
@@ -16846,6 +16970,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
16846 ALC662_3ST_6ch_DIG), 16970 ALC662_3ST_6ch_DIG),
16847 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x", 16971 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
16848 ALC663_ASUS_H13), 16972 ALC663_ASUS_H13),
16973 SND_PCI_QUIRK(0x8086, 0xd604, "Intel mobo", ALC662_3ST_2ch_DIG),
16849 {} 16974 {}
16850}; 16975};
16851 16976