aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0fbcbeef1418..2a96bc78964d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -10021,10 +10021,12 @@ static int patch_alc882(struct hda_codec *codec)
10021 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ 10021 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
10022 10022
10023 if (!spec->adc_nids && spec->input_mux) { 10023 if (!spec->adc_nids && spec->input_mux) {
10024 int i; 10024 int i, j;
10025 spec->num_adc_nids = 0; 10025 spec->num_adc_nids = 0;
10026 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;
10027 hda_nid_t cap; 10028 hda_nid_t cap;
10029 hda_nid_t items[16];
10028 hda_nid_t nid = alc882_adc_nids[i]; 10030 hda_nid_t nid = alc882_adc_nids[i];
10029 unsigned int wcap = get_wcaps(codec, nid); 10031 unsigned int wcap = get_wcaps(codec, nid);
10030 /* get type */ 10032 /* get type */
@@ -10035,6 +10037,15 @@ static int patch_alc882(struct hda_codec *codec)
10035 err = snd_hda_get_connections(codec, nid, &cap, 1); 10037 err = snd_hda_get_connections(codec, nid, &cap, 1);
10036 if (err < 0) 10038 if (err < 0)
10037 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;
10038 spec->private_capsrc_nids[spec->num_adc_nids] = cap; 10049 spec->private_capsrc_nids[spec->num_adc_nids] = cap;
10039 spec->num_adc_nids++; 10050 spec->num_adc_nids++;
10040 } 10051 }