aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-08-13 12:14:02 -0400
committerTakashi Iwai <tiwai@suse.de>2009-08-13 12:14:02 -0400
commita6cd7a71fde47e19738e7791c75584e2aca15187 (patch)
tree4fb4e7cc61839a1064c9279e637bf8b6bf92a9cd /sound/pci
parent1c4bdf9be010ae7c2324c0a90dd2296e0d1a775e (diff)
parent5207e10ed49c515e7432d0b1a7561ccc7b71f9df (diff)
Merge branch 'topic/hda-dmic-fix' into topic/hda
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_sigmatel.c168
1 files changed, 59 insertions, 109 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 3ac0112566b1..f6d7ef452d78 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -247,6 +247,7 @@ struct sigmatel_spec {
247 unsigned int num_dmuxes; 247 unsigned int num_dmuxes;
248 hda_nid_t *smux_nids; 248 hda_nid_t *smux_nids;
249 unsigned int num_smuxes; 249 unsigned int num_smuxes;
250 unsigned int num_analog_muxes;
250 251
251 unsigned long *capvols; /* amp-volume attr: HDA_COMPOSE_AMP_VAL() */ 252 unsigned long *capvols; /* amp-volume attr: HDA_COMPOSE_AMP_VAL() */
252 unsigned long *capsws; /* amp-mute attr: HDA_COMPOSE_AMP_VAL() */ 253 unsigned long *capsws; /* amp-mute attr: HDA_COMPOSE_AMP_VAL() */
@@ -766,9 +767,35 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
766 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 767 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
767 struct sigmatel_spec *spec = codec->spec; 768 struct sigmatel_spec *spec = codec->spec;
768 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 769 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
769 770 const struct hda_input_mux *imux = spec->input_mux;
770 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, 771 unsigned int idx, prev_idx;
771 spec->mux_nids[adc_idx], &spec->cur_mux[adc_idx]); 772
773 idx = ucontrol->value.enumerated.item[0];
774 if (idx >= imux->num_items)
775 idx = imux->num_items - 1;
776 prev_idx = spec->cur_mux[adc_idx];
777 if (prev_idx == idx)
778 return 0;
779 if (idx < spec->num_analog_muxes) {
780 snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0,
781 AC_VERB_SET_CONNECT_SEL,
782 imux->items[idx].index);
783 if (prev_idx >= spec->num_analog_muxes) {
784 imux = spec->dinput_mux;
785 /* 0 = analog */
786 snd_hda_codec_write_cache(codec,
787 spec->dmux_nids[adc_idx], 0,
788 AC_VERB_SET_CONNECT_SEL,
789 imux->items[0].index);
790 }
791 } else {
792 imux = spec->dinput_mux;
793 snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0,
794 AC_VERB_SET_CONNECT_SEL,
795 imux->items[idx - 1].index);
796 }
797 spec->cur_mux[adc_idx] = idx;
798 return 1;
772} 799}
773 800
774static int stac92xx_mono_mux_enum_info(struct snd_kcontrol *kcontrol, 801static int stac92xx_mono_mux_enum_info(struct snd_kcontrol *kcontrol,
@@ -1205,21 +1232,6 @@ static struct snd_kcontrol_new stac92hd83xxx_mixer[] = {
1205 { } /* end */ 1232 { } /* end */
1206}; 1233};
1207 1234
1208static struct snd_kcontrol_new stac92hd71bxx_analog_mixer[] = {
1209 HDA_CODEC_MUTE("Import0 Mux Capture Switch", 0x17, 0x0, HDA_INPUT),
1210 HDA_CODEC_VOLUME("Import0 Mux Capture Volume", 0x17, 0x0, HDA_INPUT),
1211
1212 HDA_CODEC_MUTE("Import1 Mux Capture Switch", 0x17, 0x1, HDA_INPUT),
1213 HDA_CODEC_VOLUME("Import1 Mux Capture Volume", 0x17, 0x1, HDA_INPUT),
1214
1215 HDA_CODEC_MUTE("DAC0 Capture Switch", 0x17, 0x3, HDA_INPUT),
1216 HDA_CODEC_VOLUME("DAC0 Capture Volume", 0x17, 0x3, HDA_INPUT),
1217
1218 HDA_CODEC_MUTE("DAC1 Capture Switch", 0x17, 0x4, HDA_INPUT),
1219 HDA_CODEC_VOLUME("DAC1 Capture Volume", 0x17, 0x4, HDA_INPUT),
1220 { } /* end */
1221};
1222
1223static struct snd_kcontrol_new stac92hd71bxx_loopback[] = { 1235static struct snd_kcontrol_new stac92hd71bxx_loopback[] = {
1224 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2) 1236 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2)
1225}; 1237};
@@ -1303,7 +1315,8 @@ static int stac92xx_build_controls(struct hda_codec *codec)
1303 if (err < 0) 1315 if (err < 0)
1304 return err; 1316 return err;
1305 } 1317 }
1306 if (!spec->auto_mic && spec->num_dmuxes > 0) { 1318 if (!spec->auto_mic && spec->num_dmuxes > 0 &&
1319 snd_hda_get_bool_hint(codec, "separate_dmux") == 1) {
1307 stac_dmux_mixer.count = spec->num_dmuxes; 1320 stac_dmux_mixer.count = spec->num_dmuxes;
1308 err = snd_hda_ctl_add(codec, 1321 err = snd_hda_ctl_add(codec,
1309 snd_ctl_new1(&stac_dmux_mixer, codec)); 1322 snd_ctl_new1(&stac_dmux_mixer, codec));
@@ -3580,19 +3593,28 @@ static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec,
3580 const struct auto_pin_cfg *cfg) 3593 const struct auto_pin_cfg *cfg)
3581{ 3594{
3582 struct sigmatel_spec *spec = codec->spec; 3595 struct sigmatel_spec *spec = codec->spec;
3596 struct hda_input_mux *imux = &spec->private_imux;
3583 struct hda_input_mux *dimux = &spec->private_dimux; 3597 struct hda_input_mux *dimux = &spec->private_dimux;
3584 int err, i; 3598 int err, i, active_mics;
3599 unsigned int def_conf;
3585 char name[32]; 3600 char name[32];
3586 3601
3587 dimux->items[dimux->num_items].label = stac92xx_dmic_labels[0]; 3602 dimux->items[dimux->num_items].label = stac92xx_dmic_labels[0];
3588 dimux->items[dimux->num_items].index = 0; 3603 dimux->items[dimux->num_items].index = 0;
3589 dimux->num_items++; 3604 dimux->num_items++;
3590 3605
3606 active_mics = 0;
3607 for (i = 0; i < spec->num_dmics; i++) {
3608 def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]);
3609 if (get_defcfg_connect(def_conf) != AC_JACK_PORT_NONE)
3610 active_mics++;
3611 }
3612
3591 for (i = 0; i < spec->num_dmics; i++) { 3613 for (i = 0; i < spec->num_dmics; i++) {
3592 hda_nid_t nid; 3614 hda_nid_t nid;
3593 int index; 3615 int index;
3594 unsigned int wcaps; 3616 unsigned int wcaps;
3595 unsigned int def_conf; 3617 const char *label;
3596 3618
3597 def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]); 3619 def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]);
3598 if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) 3620 if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE)
@@ -3603,12 +3625,16 @@ static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec,
3603 if (index < 0) 3625 if (index < 0)
3604 continue; 3626 continue;
3605 3627
3628 if (active_mics == 1)
3629 label = "Digital Mic";
3630 else
3631 label = stac92xx_dmic_labels[dimux->num_items];
3632
3606 wcaps = get_wcaps(codec, nid) & 3633 wcaps = get_wcaps(codec, nid) &
3607 (AC_WCAP_OUT_AMP | AC_WCAP_IN_AMP); 3634 (AC_WCAP_OUT_AMP | AC_WCAP_IN_AMP);
3608 3635
3609 if (wcaps) { 3636 if (wcaps) {
3610 sprintf(name, "%s Capture Volume", 3637 sprintf(name, "%s Capture Volume", label);
3611 stac92xx_dmic_labels[dimux->num_items]);
3612 3638
3613 err = stac92xx_add_control(spec, 3639 err = stac92xx_add_control(spec,
3614 STAC_CTL_WIDGET_VOL, 3640 STAC_CTL_WIDGET_VOL,
@@ -3620,10 +3646,14 @@ static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec,
3620 return err; 3646 return err;
3621 } 3647 }
3622 3648
3623 dimux->items[dimux->num_items].label = 3649 dimux->items[dimux->num_items].label = label;
3624 stac92xx_dmic_labels[dimux->num_items];
3625 dimux->items[dimux->num_items].index = index; 3650 dimux->items[dimux->num_items].index = index;
3626 dimux->num_items++; 3651 dimux->num_items++;
3652 if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1) {
3653 imux->items[imux->num_items].label = label;
3654 imux->items[imux->num_items].index = index;
3655 imux->num_items++;
3656 }
3627 } 3657 }
3628 3658
3629 return 0; 3659 return 0;
@@ -3743,6 +3773,7 @@ static int stac92xx_auto_create_analog_input_ctls(struct hda_codec *codec, const
3743 imux->items[imux->num_items].index = index; 3773 imux->items[imux->num_items].index = index;
3744 imux->num_items++; 3774 imux->num_items++;
3745 } 3775 }
3776 spec->num_analog_muxes = imux->num_items;
3746 3777
3747 if (imux->num_items) { 3778 if (imux->num_items) {
3748 /* 3779 /*
@@ -5105,16 +5136,6 @@ static int patch_stac925x(struct hda_codec *codec)
5105 return 0; 5136 return 0;
5106} 5137}
5107 5138
5108static struct hda_input_mux stac92hd73xx_dmux = {
5109 .num_items = 4,
5110 .items = {
5111 { "Analog Inputs", 0x0b },
5112 { "Digital Mic 1", 0x09 },
5113 { "Digital Mic 2", 0x0a },
5114 { "CD", 0x08 },
5115 }
5116};
5117
5118static int patch_stac92hd73xx(struct hda_codec *codec) 5139static int patch_stac92hd73xx(struct hda_codec *codec)
5119{ 5140{
5120 struct sigmatel_spec *spec; 5141 struct sigmatel_spec *spec;
@@ -5184,8 +5205,6 @@ again:
5184 spec->num_muxes = ARRAY_SIZE(stac92hd73xx_mux_nids); 5205 spec->num_muxes = ARRAY_SIZE(stac92hd73xx_mux_nids);
5185 spec->num_adcs = ARRAY_SIZE(stac92hd73xx_adc_nids); 5206 spec->num_adcs = ARRAY_SIZE(stac92hd73xx_adc_nids);
5186 spec->num_dmuxes = ARRAY_SIZE(stac92hd73xx_dmux_nids); 5207 spec->num_dmuxes = ARRAY_SIZE(stac92hd73xx_dmux_nids);
5187 memcpy(&spec->private_dimux, &stac92hd73xx_dmux,
5188 sizeof(stac92hd73xx_dmux));
5189 5208
5190 spec->num_caps = STAC92HD73XX_NUM_CAPS; 5209 spec->num_caps = STAC92HD73XX_NUM_CAPS;
5191 spec->capvols = stac92hd73xx_capvols; 5210 spec->capvols = stac92hd73xx_capvols;
@@ -5210,18 +5229,15 @@ again:
5210 case STAC_DELL_M6_AMIC: /* Analog Mics */ 5229 case STAC_DELL_M6_AMIC: /* Analog Mics */
5211 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); 5230 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
5212 spec->num_dmics = 0; 5231 spec->num_dmics = 0;
5213 spec->private_dimux.num_items = 1;
5214 break; 5232 break;
5215 case STAC_DELL_M6_DMIC: /* Digital Mics */ 5233 case STAC_DELL_M6_DMIC: /* Digital Mics */
5216 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); 5234 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
5217 spec->num_dmics = 1; 5235 spec->num_dmics = 1;
5218 spec->private_dimux.num_items = 2;
5219 break; 5236 break;
5220 case STAC_DELL_M6_BOTH: /* Both */ 5237 case STAC_DELL_M6_BOTH: /* Both */
5221 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); 5238 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
5222 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); 5239 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
5223 spec->num_dmics = 1; 5240 spec->num_dmics = 1;
5224 spec->private_dimux.num_items = 2;
5225 break; 5241 break;
5226 } 5242 }
5227 break; 5243 break;
@@ -5229,13 +5245,13 @@ again:
5229 spec->num_dmics = STAC92HD73XX_NUM_DMICS; 5245 spec->num_dmics = STAC92HD73XX_NUM_DMICS;
5230 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); 5246 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids);
5231 spec->eapd_switch = 1; 5247 spec->eapd_switch = 1;
5248 break;
5232 } 5249 }
5233 if (spec->board_config > STAC_92HD73XX_REF) { 5250 if (spec->board_config > STAC_92HD73XX_REF) {
5234 /* GPIO0 High = Enable EAPD */ 5251 /* GPIO0 High = Enable EAPD */
5235 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; 5252 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
5236 spec->gpio_data = 0x01; 5253 spec->gpio_data = 0x01;
5237 } 5254 }
5238 spec->dinput_mux = &spec->private_dimux;
5239 5255
5240 spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids); 5256 spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
5241 spec->pwr_nids = stac92hd73xx_pwr_nids; 5257 spec->pwr_nids = stac92hd73xx_pwr_nids;
@@ -5267,15 +5283,6 @@ again:
5267 return 0; 5283 return 0;
5268} 5284}
5269 5285
5270static struct hda_input_mux stac92hd83xxx_dmux = {
5271 .num_items = 3,
5272 .items = {
5273 { "Analog Inputs", 0x03 },
5274 { "Digital Mic 1", 0x04 },
5275 { "Digital Mic 2", 0x05 },
5276 }
5277};
5278
5279static int patch_stac92hd83xxx(struct hda_codec *codec) 5286static int patch_stac92hd83xxx(struct hda_codec *codec)
5280{ 5287{
5281 struct sigmatel_spec *spec; 5288 struct sigmatel_spec *spec;
@@ -5308,7 +5315,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
5308 spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); 5315 spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids);
5309 spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids); 5316 spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids);
5310 spec->num_dmics = STAC92HD83XXX_NUM_DMICS; 5317 spec->num_dmics = STAC92HD83XXX_NUM_DMICS;
5311 spec->dinput_mux = &stac92hd83xxx_dmux;
5312 spec->pin_nids = stac92hd83xxx_pin_nids; 5318 spec->pin_nids = stac92hd83xxx_pin_nids;
5313 spec->num_caps = STAC92HD83XXX_NUM_CAPS; 5319 spec->num_caps = STAC92HD83XXX_NUM_CAPS;
5314 spec->capvols = stac92hd83xxx_capvols; 5320 spec->capvols = stac92hd83xxx_capvols;
@@ -5378,25 +5384,6 @@ again:
5378 return 0; 5384 return 0;
5379} 5385}
5380 5386
5381static struct hda_input_mux stac92hd71bxx_dmux_nomixer = {
5382 .num_items = 3,
5383 .items = {
5384 { "Analog Inputs", 0x00 },
5385 { "Digital Mic 1", 0x02 },
5386 { "Digital Mic 2", 0x03 },
5387 }
5388};
5389
5390static struct hda_input_mux stac92hd71bxx_dmux_amixer = {
5391 .num_items = 4,
5392 .items = {
5393 { "Analog Inputs", 0x00 },
5394 { "Mixer", 0x01 },
5395 { "Digital Mic 1", 0x02 },
5396 { "Digital Mic 2", 0x03 },
5397 }
5398};
5399
5400/* get the pin connection (fixed, none, etc) */ 5387/* get the pin connection (fixed, none, etc) */
5401static unsigned int stac_get_defcfg_connect(struct hda_codec *codec, int idx) 5388static unsigned int stac_get_defcfg_connect(struct hda_codec *codec, int idx)
5402{ 5389{
@@ -5457,7 +5444,6 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
5457 struct sigmatel_spec *spec; 5444 struct sigmatel_spec *spec;
5458 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init; 5445 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init;
5459 int err = 0; 5446 int err = 0;
5460 unsigned int ndmic_nids = 0;
5461 5447
5462 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5448 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
5463 if (spec == NULL) 5449 if (spec == NULL)
@@ -5513,21 +5499,13 @@ again:
5513 /* fallthru */ 5499 /* fallthru */
5514 case 0x111d76b4: /* 6 Port without Analog Mixer */ 5500 case 0x111d76b4: /* 6 Port without Analog Mixer */
5515 case 0x111d76b5: 5501 case 0x111d76b5:
5516 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_nomixer,
5517 sizeof(stac92hd71bxx_dmux_nomixer));
5518 spec->init = stac92hd71bxx_core_init; 5502 spec->init = stac92hd71bxx_core_init;
5519 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5503 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5520 spec->num_dmics = stac92hd71bxx_connected_ports(codec, 5504 spec->num_dmics = stac92hd71bxx_connected_ports(codec,
5521 stac92hd71bxx_dmic_nids, 5505 stac92hd71bxx_dmic_nids,
5522 STAC92HD71BXX_NUM_DMICS); 5506 STAC92HD71BXX_NUM_DMICS);
5523 if (spec->num_dmics) {
5524 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
5525 spec->dinput_mux = &spec->private_dimux;
5526 ndmic_nids = ARRAY_SIZE(stac92hd71bxx_dmic_nids) - 1;
5527 }
5528 break; 5507 break;
5529 case 0x111d7608: /* 5 Port with Analog Mixer */ 5508 case 0x111d7608: /* 5 Port with Analog Mixer */
5530 spec->private_dimux.num_items--;
5531 switch (spec->board_config) { 5509 switch (spec->board_config) {
5532 case STAC_HP_M4: 5510 case STAC_HP_M4:
5533 /* Enable VREF power saving on GPIO1 detect */ 5511 /* Enable VREF power saving on GPIO1 detect */
@@ -5549,15 +5527,6 @@ again:
5549 5527
5550 /* no output amps */ 5528 /* no output amps */
5551 spec->num_pwrs = 0; 5529 spec->num_pwrs = 0;
5552 if (snd_hda_get_bool_hint(codec, "analog_mixer") == 1) {
5553 spec->mixer = stac92hd71bxx_analog_mixer;
5554 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
5555 sizeof(stac92hd71bxx_dmux_amixer));
5556 } else {
5557 memcpy(&spec->private_dimux,
5558 &stac92hd71bxx_dmux_nomixer,
5559 sizeof(stac92hd71bxx_dmux_nomixer));
5560 }
5561 /* disable VSW */ 5530 /* disable VSW */
5562 spec->init = stac92hd71bxx_core_init; 5531 spec->init = stac92hd71bxx_core_init;
5563 unmute_init++; 5532 unmute_init++;
@@ -5567,11 +5536,6 @@ again:
5567 spec->num_dmics = stac92hd71bxx_connected_ports(codec, 5536 spec->num_dmics = stac92hd71bxx_connected_ports(codec,
5568 stac92hd71bxx_dmic_nids, 5537 stac92hd71bxx_dmic_nids,
5569 STAC92HD71BXX_NUM_DMICS - 1); 5538 STAC92HD71BXX_NUM_DMICS - 1);
5570 if (spec->num_dmics) {
5571 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
5572 spec->dinput_mux = &spec->private_dimux;
5573 ndmic_nids = ARRAY_SIZE(stac92hd71bxx_dmic_nids) - 2;
5574 }
5575 break; 5539 break;
5576 case 0x111d7603: /* 6 Port with Analog Mixer */ 5540 case 0x111d7603: /* 6 Port with Analog Mixer */
5577 if ((codec->revision_id & 0xf) == 1) 5541 if ((codec->revision_id & 0xf) == 1)
@@ -5581,25 +5545,12 @@ again:
5581 spec->num_pwrs = 0; 5545 spec->num_pwrs = 0;
5582 /* fallthru */ 5546 /* fallthru */
5583 default: 5547 default:
5584 if (snd_hda_get_bool_hint(codec, "analog_mixer") == 1) {
5585 spec->mixer = stac92hd71bxx_analog_mixer;
5586 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
5587 sizeof(stac92hd71bxx_dmux_amixer));
5588 } else {
5589 memcpy(&spec->private_dimux,
5590 &stac92hd71bxx_dmux_nomixer,
5591 sizeof(stac92hd71bxx_dmux_nomixer));
5592 }
5593 spec->init = stac92hd71bxx_core_init; 5548 spec->init = stac92hd71bxx_core_init;
5594 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5549 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5595 spec->num_dmics = stac92hd71bxx_connected_ports(codec, 5550 spec->num_dmics = stac92hd71bxx_connected_ports(codec,
5596 stac92hd71bxx_dmic_nids, 5551 stac92hd71bxx_dmic_nids,
5597 STAC92HD71BXX_NUM_DMICS); 5552 STAC92HD71BXX_NUM_DMICS);
5598 if (spec->num_dmics) { 5553 break;
5599 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
5600 spec->dinput_mux = &spec->private_dimux;
5601 ndmic_nids = ARRAY_SIZE(stac92hd71bxx_dmic_nids) - 1;
5602 }
5603 } 5554 }
5604 5555
5605 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) 5556 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP)
@@ -5627,6 +5578,7 @@ again:
5627 5578
5628 spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids); 5579 spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids);
5629 spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids); 5580 spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);
5581 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
5630 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); 5582 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
5631 5583
5632 switch (spec->board_config) { 5584 switch (spec->board_config) {
@@ -5681,8 +5633,6 @@ again:
5681#endif 5633#endif
5682 5634
5683 spec->multiout.dac_nids = spec->dac_nids; 5635 spec->multiout.dac_nids = spec->dac_nids;
5684 if (spec->dinput_mux)
5685 spec->private_dimux.num_items += spec->num_dmics - ndmic_nids;
5686 5636
5687 err = stac92xx_parse_auto_config(codec, 0x21, 0); 5637 err = stac92xx_parse_auto_config(codec, 0x21, 0);
5688 if (!err) { 5638 if (!err) {