aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-10-31 11:37:07 -0400
committerTakashi Iwai <tiwai@suse.de>2008-10-31 12:24:39 -0400
commitf9e336f65b666b8f1764d17e9b7c21c90748a37e (patch)
treec5118e661f6058c611b9f52ed0d77ca387f3cd10 /sound
parent54cbc9abe57cf0a36619f394802448c62402599a (diff)
ALSA: hda - Unify capture mixer creation in realtek codes
Unified the capture mixer creation in patch_realtek.c. ALC268 is still an exception since it has no AMP in ADC but in MUX widget. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c744
1 files changed, 218 insertions, 526 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8477d6d46880..d511ce4b11ad 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -239,6 +239,7 @@ struct alc_spec {
239 /* codec parameterization */ 239 /* codec parameterization */
240 struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ 240 struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
241 unsigned int num_mixers; 241 unsigned int num_mixers;
242 struct snd_kcontrol_new *cap_mixer; /* capture mixer */
242 243
243 const struct hda_verb *init_verbs[5]; /* initialization verbs 244 const struct hda_verb *init_verbs[5]; /* initialization verbs
244 * don't forget NULL 245 * don't forget NULL
@@ -323,6 +324,7 @@ struct alc_config_preset {
323 struct snd_kcontrol_new *mixers[5]; /* should be identical size 324 struct snd_kcontrol_new *mixers[5]; /* should be identical size
324 * with spec 325 * with spec
325 */ 326 */
327 struct snd_kcontrol_new *cap_mixer; /* capture mixer */
326 const struct hda_verb *init_verbs[5]; 328 const struct hda_verb *init_verbs[5];
327 unsigned int num_dacs; 329 unsigned int num_dacs;
328 hda_nid_t *dac_nids; 330 hda_nid_t *dac_nids;
@@ -766,6 +768,7 @@ static void setup_preset(struct alc_spec *spec,
766 768
767 for (i = 0; i < ARRAY_SIZE(preset->mixers) && preset->mixers[i]; i++) 769 for (i = 0; i < ARRAY_SIZE(preset->mixers) && preset->mixers[i]; i++)
768 add_mixer(spec, preset->mixers[i]); 770 add_mixer(spec, preset->mixers[i]);
771 spec->cap_mixer = preset->cap_mixer;
769 for (i = 0; i < ARRAY_SIZE(preset->init_verbs) && preset->init_verbs[i]; 772 for (i = 0; i < ARRAY_SIZE(preset->init_verbs) && preset->init_verbs[i];
770 i++) 773 i++)
771 add_verb(spec, preset->init_verbs[i]); 774 add_verb(spec, preset->init_verbs[i]);
@@ -1244,48 +1247,117 @@ static struct snd_kcontrol_new alc880_three_stack_mixer[] = {
1244}; 1247};
1245 1248
1246/* capture mixer elements */ 1249/* capture mixer elements */
1247static struct snd_kcontrol_new alc880_capture_mixer[] = { 1250static int alc_cap_vol_info(struct snd_kcontrol *kcontrol,
1248 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), 1251 struct snd_ctl_elem_info *uinfo)
1249 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), 1252{
1250 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), 1253 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1251 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT), 1254 struct alc_spec *spec = codec->spec;
1252 HDA_CODEC_VOLUME_IDX("Capture Volume", 2, 0x09, 0x0, HDA_INPUT), 1255 int err;
1253 HDA_CODEC_MUTE_IDX("Capture Switch", 2, 0x09, 0x0, HDA_INPUT),
1254 {
1255 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1256 /* The multiple "Capture Source" controls confuse alsamixer
1257 * So call somewhat different..
1258 */
1259 /* .name = "Capture Source", */
1260 .name = "Input Source",
1261 .count = 3,
1262 .info = alc_mux_enum_info,
1263 .get = alc_mux_enum_get,
1264 .put = alc_mux_enum_put,
1265 },
1266 { } /* end */
1267};
1268 1256
1269/* capture mixer elements (in case NID 0x07 not available) */ 1257 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */
1270static struct snd_kcontrol_new alc880_capture_alt_mixer[] = { 1258 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
1271 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 1259 HDA_INPUT);
1272 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 1260 err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo);
1273 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 1261 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */
1274 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), 1262 return err;
1275 { 1263}
1276 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1264
1277 /* The multiple "Capture Source" controls confuse alsamixer 1265static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1278 * So call somewhat different.. 1266 unsigned int size, unsigned int __user *tlv)
1279 */ 1267{
1280 /* .name = "Capture Source", */ 1268 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1281 .name = "Input Source", 1269 struct alc_spec *spec = codec->spec;
1282 .count = 2, 1270 int err;
1283 .info = alc_mux_enum_info,
1284 .get = alc_mux_enum_get,
1285 .put = alc_mux_enum_put,
1286 },
1287};
1288 1271
1272 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */
1273 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
1274 HDA_INPUT);
1275 err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv);
1276 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */
1277 return err;
1278}
1279
1280typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol,
1281 struct snd_ctl_elem_value *ucontrol);
1282
1283static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
1284 struct snd_ctl_elem_value *ucontrol,
1285 getput_call_t func)
1286{
1287 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1288 struct alc_spec *spec = codec->spec;
1289 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
1290 int err;
1291
1292 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */
1293 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx],
1294 3, 0, HDA_INPUT);
1295 err = func(kcontrol, ucontrol);
1296 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */
1297 return err;
1298}
1299
1300static int alc_cap_vol_get(struct snd_kcontrol *kcontrol,
1301 struct snd_ctl_elem_value *ucontrol)
1302{
1303 return alc_cap_getput_caller(kcontrol, ucontrol,
1304 snd_hda_mixer_amp_volume_get);
1305}
1306
1307static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
1308 struct snd_ctl_elem_value *ucontrol)
1309{
1310 return alc_cap_getput_caller(kcontrol, ucontrol,
1311 snd_hda_mixer_amp_volume_put);
1312}
1313
1314/* capture mixer elements */
1315#define alc_cap_sw_info snd_ctl_boolean_stereo_info
1316
1317static int alc_cap_sw_get(struct snd_kcontrol *kcontrol,
1318 struct snd_ctl_elem_value *ucontrol)
1319{
1320 return alc_cap_getput_caller(kcontrol, ucontrol,
1321 snd_hda_mixer_amp_switch_get);
1322}
1323
1324static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
1325 struct snd_ctl_elem_value *ucontrol)
1326{
1327 return alc_cap_getput_caller(kcontrol, ucontrol,
1328 snd_hda_mixer_amp_switch_put);
1329}
1330
1331#define DEFINE_CAPMIX(num) \
1332static struct snd_kcontrol_new alc_capture_mixer ## num[] = { \
1333 { \
1334 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1335 .name = "Capture Switch", \
1336 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
1337 .count = num, \
1338 .info = alc_cap_sw_info, \
1339 .get = alc_cap_sw_get, \
1340 .put = alc_cap_sw_put, \
1341 }, \
1342 { \
1343 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1344 .name = "Capture Volume", \
1345 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | \
1346 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
1347 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK), \
1348 .count = num, \
1349 .info = alc_cap_vol_info, \
1350 .get = alc_cap_vol_get, \
1351 .put = alc_cap_vol_put, \
1352 .tlv = { .c = alc_cap_vol_tlv }, \
1353 }, \
1354 { } /* end */ \
1355}
1356
1357/* up to three ADCs */
1358DEFINE_CAPMIX(1);
1359DEFINE_CAPMIX(2);
1360DEFINE_CAPMIX(3);
1289 1361
1290 1362
1291/* 1363/*
@@ -1571,18 +1643,6 @@ static struct snd_kcontrol_new alc880_tcl_s700_mixer[] = {
1571 HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT), 1643 HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT),
1572 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 1644 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
1573 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 1645 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
1574 {
1575 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1576 /* The multiple "Capture Source" controls confuse alsamixer
1577 * So call somewhat different..
1578 */
1579 /* .name = "Capture Source", */
1580 .name = "Input Source",
1581 .count = 1,
1582 .info = alc_mux_enum_info,
1583 .get = alc_mux_enum_get,
1584 .put = alc_mux_enum_put,
1585 },
1586 { } /* end */ 1646 { } /* end */
1587}; 1647};
1588 1648
@@ -1690,7 +1750,11 @@ static int alc_build_controls(struct hda_codec *codec)
1690 if (err < 0) 1750 if (err < 0)
1691 return err; 1751 return err;
1692 } 1752 }
1693 1753 if (spec->cap_mixer) {
1754 err = snd_hda_add_new_ctls(codec, spec->cap_mixer);
1755 if (err < 0)
1756 return err;
1757 }
1694 if (spec->multiout.dig_out_nid) { 1758 if (spec->multiout.dig_out_nid) {
1695 err = snd_hda_create_spdif_out_ctls(codec, 1759 err = snd_hda_create_spdif_out_ctls(codec,
1696 spec->multiout.dig_out_nid); 1760 spec->multiout.dig_out_nid);
@@ -3318,6 +3382,8 @@ static struct alc_config_preset alc880_presets[] = {
3318 alc880_gpio2_init_verbs }, 3382 alc880_gpio2_init_verbs },
3319 .num_dacs = ARRAY_SIZE(alc880_dac_nids), 3383 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
3320 .dac_nids = alc880_dac_nids, 3384 .dac_nids = alc880_dac_nids,
3385 .adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */
3386 .num_adc_nids = 1, /* single ADC */
3321 .hp_nid = 0x03, 3387 .hp_nid = 0x03,
3322 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes), 3388 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
3323 .channel_mode = alc880_2_jack_modes, 3389 .channel_mode = alc880_2_jack_modes,
@@ -3958,6 +4024,17 @@ static void alc880_auto_init(struct hda_codec *codec)
3958 * OK, here we have finally the patch for ALC880 4024 * OK, here we have finally the patch for ALC880
3959 */ 4025 */
3960 4026
4027static void set_capture_mixer(struct alc_spec *spec)
4028{
4029 static struct snd_kcontrol_new *caps[3] = {
4030 alc_capture_mixer1,
4031 alc_capture_mixer2,
4032 alc_capture_mixer3,
4033 };
4034 if (spec->num_adc_nids > 0 && spec->num_adc_nids < 3)
4035 spec->cap_mixer = caps[spec->num_adc_nids - 1];
4036}
4037
3961static int patch_alc880(struct hda_codec *codec) 4038static int patch_alc880(struct hda_codec *codec)
3962{ 4039{
3963 struct alc_spec *spec; 4040 struct alc_spec *spec;
@@ -4013,13 +4090,12 @@ static int patch_alc880(struct hda_codec *codec)
4013 if (wcap != AC_WID_AUD_IN) { 4090 if (wcap != AC_WID_AUD_IN) {
4014 spec->adc_nids = alc880_adc_nids_alt; 4091 spec->adc_nids = alc880_adc_nids_alt;
4015 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids_alt); 4092 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids_alt);
4016 add_mixer(spec, alc880_capture_alt_mixer);
4017 } else { 4093 } else {
4018 spec->adc_nids = alc880_adc_nids; 4094 spec->adc_nids = alc880_adc_nids;
4019 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids); 4095 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids);
4020 add_mixer(spec, alc880_capture_mixer);
4021 } 4096 }
4022 } 4097 }
4098 set_capture_mixer(spec);
4023 4099
4024 spec->vmaster_nid = 0x0c; 4100 spec->vmaster_nid = 0x0c;
4025 4101
@@ -4054,11 +4130,6 @@ static hda_nid_t alc260_adc_nids_alt[1] = {
4054 0x05, 4130 0x05,
4055}; 4131};
4056 4132
4057static hda_nid_t alc260_hp_adc_nids[2] = {
4058 /* ADC1, 0 */
4059 0x05, 0x04
4060};
4061
4062/* NIDs used when simultaneous access to both ADCs makes sense. Note that 4133/* NIDs used when simultaneous access to both ADCs makes sense. Note that
4063 * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC. 4134 * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
4064 */ 4135 */
@@ -4457,45 +4528,6 @@ static struct snd_kcontrol_new alc260_replacer_672v_mixer[] = {
4457 { } /* end */ 4528 { } /* end */
4458}; 4529};
4459 4530
4460/* capture mixer elements */
4461static struct snd_kcontrol_new alc260_capture_mixer[] = {
4462 HDA_CODEC_VOLUME("Capture Volume", 0x04, 0x0, HDA_INPUT),
4463 HDA_CODEC_MUTE("Capture Switch", 0x04, 0x0, HDA_INPUT),
4464 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x05, 0x0, HDA_INPUT),
4465 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x05, 0x0, HDA_INPUT),
4466 {
4467 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
4468 /* The multiple "Capture Source" controls confuse alsamixer
4469 * So call somewhat different..
4470 */
4471 /* .name = "Capture Source", */
4472 .name = "Input Source",
4473 .count = 2,
4474 .info = alc_mux_enum_info,
4475 .get = alc_mux_enum_get,
4476 .put = alc_mux_enum_put,
4477 },
4478 { } /* end */
4479};
4480
4481static struct snd_kcontrol_new alc260_capture_alt_mixer[] = {
4482 HDA_CODEC_VOLUME("Capture Volume", 0x05, 0x0, HDA_INPUT),
4483 HDA_CODEC_MUTE("Capture Switch", 0x05, 0x0, HDA_INPUT),
4484 {
4485 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
4486 /* The multiple "Capture Source" controls confuse alsamixer
4487 * So call somewhat different..
4488 */
4489 /* .name = "Capture Source", */
4490 .name = "Input Source",
4491 .count = 1,
4492 .info = alc_mux_enum_info,
4493 .get = alc_mux_enum_get,
4494 .put = alc_mux_enum_put,
4495 },
4496 { } /* end */
4497};
4498
4499/* 4531/*
4500 * initialization verbs 4532 * initialization verbs
4501 */ 4533 */
@@ -5312,7 +5344,6 @@ static struct hda_verb alc260_volume_init_verbs[] = {
5312static int alc260_parse_auto_config(struct hda_codec *codec) 5344static int alc260_parse_auto_config(struct hda_codec *codec)
5313{ 5345{
5314 struct alc_spec *spec = codec->spec; 5346 struct alc_spec *spec = codec->spec;
5315 unsigned int wcap;
5316 int err; 5347 int err;
5317 static hda_nid_t alc260_ignore[] = { 0x17, 0 }; 5348 static hda_nid_t alc260_ignore[] = { 0x17, 0 };
5318 5349
@@ -5341,19 +5372,6 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
5341 spec->num_mux_defs = 1; 5372 spec->num_mux_defs = 1;
5342 spec->input_mux = &spec->private_imux; 5373 spec->input_mux = &spec->private_imux;
5343 5374
5344 /* check whether NID 0x04 is valid */
5345 wcap = get_wcaps(codec, 0x04);
5346 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; /* get type */
5347 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
5348 spec->adc_nids = alc260_adc_nids_alt;
5349 spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt);
5350 add_mixer(spec, alc260_capture_alt_mixer);
5351 } else {
5352 spec->adc_nids = alc260_adc_nids;
5353 spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids);
5354 add_mixer(spec, alc260_capture_mixer);
5355 }
5356
5357 store_pin_configs(codec); 5375 store_pin_configs(codec);
5358 return 1; 5376 return 1;
5359} 5377}
@@ -5423,12 +5441,11 @@ static struct alc_config_preset alc260_presets[] = {
5423 [ALC260_BASIC] = { 5441 [ALC260_BASIC] = {
5424 .mixers = { alc260_base_output_mixer, 5442 .mixers = { alc260_base_output_mixer,
5425 alc260_input_mixer, 5443 alc260_input_mixer,
5426 alc260_pc_beep_mixer, 5444 alc260_pc_beep_mixer },
5427 alc260_capture_mixer },
5428 .init_verbs = { alc260_init_verbs }, 5445 .init_verbs = { alc260_init_verbs },
5429 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5446 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5430 .dac_nids = alc260_dac_nids, 5447 .dac_nids = alc260_dac_nids,
5431 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids), 5448 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
5432 .adc_nids = alc260_adc_nids, 5449 .adc_nids = alc260_adc_nids,
5433 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5450 .num_channel_mode = ARRAY_SIZE(alc260_modes),
5434 .channel_mode = alc260_modes, 5451 .channel_mode = alc260_modes,
@@ -5436,14 +5453,13 @@ static struct alc_config_preset alc260_presets[] = {
5436 }, 5453 },
5437 [ALC260_HP] = { 5454 [ALC260_HP] = {
5438 .mixers = { alc260_hp_output_mixer, 5455 .mixers = { alc260_hp_output_mixer,
5439 alc260_input_mixer, 5456 alc260_input_mixer },
5440 alc260_capture_alt_mixer },
5441 .init_verbs = { alc260_init_verbs, 5457 .init_verbs = { alc260_init_verbs,
5442 alc260_hp_unsol_verbs }, 5458 alc260_hp_unsol_verbs },
5443 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5459 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5444 .dac_nids = alc260_dac_nids, 5460 .dac_nids = alc260_dac_nids,
5445 .num_adc_nids = ARRAY_SIZE(alc260_hp_adc_nids), 5461 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt),
5446 .adc_nids = alc260_hp_adc_nids, 5462 .adc_nids = alc260_adc_nids_alt,
5447 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5463 .num_channel_mode = ARRAY_SIZE(alc260_modes),
5448 .channel_mode = alc260_modes, 5464 .channel_mode = alc260_modes,
5449 .input_mux = &alc260_capture_source, 5465 .input_mux = &alc260_capture_source,
@@ -5452,14 +5468,13 @@ static struct alc_config_preset alc260_presets[] = {
5452 }, 5468 },
5453 [ALC260_HP_DC7600] = { 5469 [ALC260_HP_DC7600] = {
5454 .mixers = { alc260_hp_dc7600_mixer, 5470 .mixers = { alc260_hp_dc7600_mixer,
5455 alc260_input_mixer, 5471 alc260_input_mixer },
5456 alc260_capture_alt_mixer },
5457 .init_verbs = { alc260_init_verbs, 5472 .init_verbs = { alc260_init_verbs,
5458 alc260_hp_dc7600_verbs }, 5473 alc260_hp_dc7600_verbs },
5459 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5474 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5460 .dac_nids = alc260_dac_nids, 5475 .dac_nids = alc260_dac_nids,
5461 .num_adc_nids = ARRAY_SIZE(alc260_hp_adc_nids), 5476 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt),
5462 .adc_nids = alc260_hp_adc_nids, 5477 .adc_nids = alc260_adc_nids_alt,
5463 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5478 .num_channel_mode = ARRAY_SIZE(alc260_modes),
5464 .channel_mode = alc260_modes, 5479 .channel_mode = alc260_modes,
5465 .input_mux = &alc260_capture_source, 5480 .input_mux = &alc260_capture_source,
@@ -5468,14 +5483,13 @@ static struct alc_config_preset alc260_presets[] = {
5468 }, 5483 },
5469 [ALC260_HP_3013] = { 5484 [ALC260_HP_3013] = {
5470 .mixers = { alc260_hp_3013_mixer, 5485 .mixers = { alc260_hp_3013_mixer,
5471 alc260_input_mixer, 5486 alc260_input_mixer },
5472 alc260_capture_alt_mixer },
5473 .init_verbs = { alc260_hp_3013_init_verbs, 5487 .init_verbs = { alc260_hp_3013_init_verbs,
5474 alc260_hp_3013_unsol_verbs }, 5488 alc260_hp_3013_unsol_verbs },
5475 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5489 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5476 .dac_nids = alc260_dac_nids, 5490 .dac_nids = alc260_dac_nids,
5477 .num_adc_nids = ARRAY_SIZE(alc260_hp_adc_nids), 5491 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt),
5478 .adc_nids = alc260_hp_adc_nids, 5492 .adc_nids = alc260_adc_nids_alt,
5479 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5493 .num_channel_mode = ARRAY_SIZE(alc260_modes),
5480 .channel_mode = alc260_modes, 5494 .channel_mode = alc260_modes,
5481 .input_mux = &alc260_capture_source, 5495 .input_mux = &alc260_capture_source,
@@ -5483,8 +5497,7 @@ static struct alc_config_preset alc260_presets[] = {
5483 .init_hook = alc260_hp_3013_automute, 5497 .init_hook = alc260_hp_3013_automute,
5484 }, 5498 },
5485 [ALC260_FUJITSU_S702X] = { 5499 [ALC260_FUJITSU_S702X] = {
5486 .mixers = { alc260_fujitsu_mixer, 5500 .mixers = { alc260_fujitsu_mixer },
5487 alc260_capture_mixer },
5488 .init_verbs = { alc260_fujitsu_init_verbs }, 5501 .init_verbs = { alc260_fujitsu_init_verbs },
5489 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5502 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5490 .dac_nids = alc260_dac_nids, 5503 .dac_nids = alc260_dac_nids,
@@ -5496,8 +5509,7 @@ static struct alc_config_preset alc260_presets[] = {
5496 .input_mux = alc260_fujitsu_capture_sources, 5509 .input_mux = alc260_fujitsu_capture_sources,
5497 }, 5510 },
5498 [ALC260_ACER] = { 5511 [ALC260_ACER] = {
5499 .mixers = { alc260_acer_mixer, 5512 .mixers = { alc260_acer_mixer },
5500 alc260_capture_mixer },
5501 .init_verbs = { alc260_acer_init_verbs }, 5513 .init_verbs = { alc260_acer_init_verbs },
5502 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5514 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5503 .dac_nids = alc260_dac_nids, 5515 .dac_nids = alc260_dac_nids,
@@ -5509,8 +5521,7 @@ static struct alc_config_preset alc260_presets[] = {
5509 .input_mux = alc260_acer_capture_sources, 5521 .input_mux = alc260_acer_capture_sources,
5510 }, 5522 },
5511 [ALC260_WILL] = { 5523 [ALC260_WILL] = {
5512 .mixers = { alc260_will_mixer, 5524 .mixers = { alc260_will_mixer },
5513 alc260_capture_mixer },
5514 .init_verbs = { alc260_init_verbs, alc260_will_verbs }, 5525 .init_verbs = { alc260_init_verbs, alc260_will_verbs },
5515 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5526 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5516 .dac_nids = alc260_dac_nids, 5527 .dac_nids = alc260_dac_nids,
@@ -5522,8 +5533,7 @@ static struct alc_config_preset alc260_presets[] = {
5522 .input_mux = &alc260_capture_source, 5533 .input_mux = &alc260_capture_source,
5523 }, 5534 },
5524 [ALC260_REPLACER_672V] = { 5535 [ALC260_REPLACER_672V] = {
5525 .mixers = { alc260_replacer_672v_mixer, 5536 .mixers = { alc260_replacer_672v_mixer },
5526 alc260_capture_mixer },
5527 .init_verbs = { alc260_init_verbs, alc260_replacer_672v_verbs }, 5537 .init_verbs = { alc260_init_verbs, alc260_replacer_672v_verbs },
5528 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5538 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
5529 .dac_nids = alc260_dac_nids, 5539 .dac_nids = alc260_dac_nids,
@@ -5538,8 +5548,7 @@ static struct alc_config_preset alc260_presets[] = {
5538 }, 5548 },
5539#ifdef CONFIG_SND_DEBUG 5549#ifdef CONFIG_SND_DEBUG
5540 [ALC260_TEST] = { 5550 [ALC260_TEST] = {
5541 .mixers = { alc260_test_mixer, 5551 .mixers = { alc260_test_mixer },
5542 alc260_capture_mixer },
5543 .init_verbs = { alc260_test_init_verbs }, 5552 .init_verbs = { alc260_test_init_verbs },
5544 .num_dacs = ARRAY_SIZE(alc260_test_dac_nids), 5553 .num_dacs = ARRAY_SIZE(alc260_test_dac_nids),
5545 .dac_nids = alc260_test_dac_nids, 5554 .dac_nids = alc260_test_dac_nids,
@@ -5598,6 +5607,8 @@ static int patch_alc260(struct hda_codec *codec)
5598 spec->stream_digital_playback = &alc260_pcm_digital_playback; 5607 spec->stream_digital_playback = &alc260_pcm_digital_playback;
5599 spec->stream_digital_capture = &alc260_pcm_digital_capture; 5608 spec->stream_digital_capture = &alc260_pcm_digital_capture;
5600 5609
5610 set_capture_mixer(spec);
5611
5601 spec->vmaster_nid = 0x08; 5612 spec->vmaster_nid = 0x08;
5602 5613
5603 codec->patch_ops = alc_patch_ops; 5614 codec->patch_ops = alc_patch_ops;
@@ -6336,9 +6347,6 @@ static struct hda_verb alc882_auto_init_verbs[] = {
6336 { } 6347 { }
6337}; 6348};
6338 6349
6339#define alc882_capture_alt_mixer alc880_capture_alt_mixer
6340#define alc882_capture_mixer alc880_capture_mixer
6341
6342#ifdef CONFIG_SND_HDA_POWER_SAVE 6350#ifdef CONFIG_SND_HDA_POWER_SAVE
6343#define alc882_loopbacks alc880_loopbacks 6351#define alc882_loopbacks alc880_loopbacks
6344#endif 6352#endif
@@ -6467,8 +6475,7 @@ static struct alc_config_preset alc882_presets[] = {
6467 .init_hook = alc885_imac24_init_hook, 6475 .init_hook = alc885_imac24_init_hook,
6468 }, 6476 },
6469 [ALC882_TARGA] = { 6477 [ALC882_TARGA] = {
6470 .mixers = { alc882_targa_mixer, alc882_chmode_mixer, 6478 .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
6471 alc882_capture_mixer },
6472 .init_verbs = { alc882_init_verbs, alc882_targa_verbs}, 6479 .init_verbs = { alc882_init_verbs, alc882_targa_verbs},
6473 .num_dacs = ARRAY_SIZE(alc882_dac_nids), 6480 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
6474 .dac_nids = alc882_dac_nids, 6481 .dac_nids = alc882_dac_nids,
@@ -6484,8 +6491,7 @@ static struct alc_config_preset alc882_presets[] = {
6484 .init_hook = alc882_targa_automute, 6491 .init_hook = alc882_targa_automute,
6485 }, 6492 },
6486 [ALC882_ASUS_A7J] = { 6493 [ALC882_ASUS_A7J] = {
6487 .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer, 6494 .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer },
6488 alc882_capture_mixer },
6489 .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs}, 6495 .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs},
6490 .num_dacs = ARRAY_SIZE(alc882_dac_nids), 6496 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
6491 .dac_nids = alc882_dac_nids, 6497 .dac_nids = alc882_dac_nids,
@@ -6800,14 +6806,13 @@ static int patch_alc882(struct hda_codec *codec)
6800 spec->adc_nids = alc882_adc_nids_alt; 6806 spec->adc_nids = alc882_adc_nids_alt;
6801 spec->num_adc_nids = ARRAY_SIZE(alc882_adc_nids_alt); 6807 spec->num_adc_nids = ARRAY_SIZE(alc882_adc_nids_alt);
6802 spec->capsrc_nids = alc882_capsrc_nids_alt; 6808 spec->capsrc_nids = alc882_capsrc_nids_alt;
6803 add_mixer(spec, alc882_capture_alt_mixer);
6804 } else { 6809 } else {
6805 spec->adc_nids = alc882_adc_nids; 6810 spec->adc_nids = alc882_adc_nids;
6806 spec->num_adc_nids = ARRAY_SIZE(alc882_adc_nids); 6811 spec->num_adc_nids = ARRAY_SIZE(alc882_adc_nids);
6807 spec->capsrc_nids = alc882_capsrc_nids; 6812 spec->capsrc_nids = alc882_capsrc_nids;
6808 add_mixer(spec, alc882_capture_mixer);
6809 } 6813 }
6810 } 6814 }
6815 set_capture_mixer(spec);
6811 6816
6812 spec->vmaster_nid = 0x0c; 6817 spec->vmaster_nid = 0x0c;
6813 6818
@@ -6846,6 +6851,11 @@ static hda_nid_t alc883_adc_nids[2] = {
6846 0x08, 0x09, 6851 0x08, 0x09,
6847}; 6852};
6848 6853
6854static hda_nid_t alc883_adc_nids_alt[1] = {
6855 /* ADC1 */
6856 0x08,
6857};
6858
6849static hda_nid_t alc883_capsrc_nids[2] = { 0x23, 0x22 }; 6859static hda_nid_t alc883_capsrc_nids[2] = { 0x23, 0x22 };
6850 6860
6851/* input MUX */ 6861/* input MUX */
@@ -7067,19 +7077,6 @@ static struct snd_kcontrol_new alc883_base_mixer[] = {
7067 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7077 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7068 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7078 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
7069 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7079 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
7070 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7071 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7072 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7073 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7074 {
7075 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7076 /* .name = "Capture Source", */
7077 .name = "Input Source",
7078 .count = 2,
7079 .info = alc_mux_enum_info,
7080 .get = alc_mux_enum_get,
7081 .put = alc_mux_enum_put,
7082 },
7083 { } /* end */ 7080 { } /* end */
7084}; 7081};
7085 7082
@@ -7097,19 +7094,6 @@ static struct snd_kcontrol_new alc883_mitac_mixer[] = {
7097 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7094 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7098 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), 7095 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
7099 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7096 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7100 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7101 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7102 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7103 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7104 {
7105 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7106 /* .name = "Capture Source", */
7107 .name = "Input Source",
7108 .count = 2,
7109 .info = alc_mux_enum_info,
7110 .get = alc_mux_enum_get,
7111 .put = alc_mux_enum_put,
7112 },
7113 { } /* end */ 7097 { } /* end */
7114}; 7098};
7115 7099
@@ -7124,19 +7108,6 @@ static struct snd_kcontrol_new alc883_clevo_m720_mixer[] = {
7124 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7108 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7125 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT), 7109 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
7126 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7110 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7127 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7128 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7129 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7130 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7131 {
7132 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7133 /* .name = "Capture Source", */
7134 .name = "Input Source",
7135 .count = 2,
7136 .info = alc_mux_enum_info,
7137 .get = alc_mux_enum_get,
7138 .put = alc_mux_enum_put,
7139 },
7140 { } /* end */ 7111 { } /* end */
7141}; 7112};
7142 7113
@@ -7151,19 +7122,6 @@ static struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer[] = {
7151 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7122 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7152 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT), 7123 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
7153 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7124 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7154 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7155 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7156 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7157 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7158 {
7159 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7160 /* .name = "Capture Source", */
7161 .name = "Input Source",
7162 .count = 2,
7163 .info = alc_mux_enum_info,
7164 .get = alc_mux_enum_get,
7165 .put = alc_mux_enum_put,
7166 },
7167 { } /* end */ 7125 { } /* end */
7168}; 7126};
7169 7127
@@ -7183,19 +7141,6 @@ static struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = {
7183 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7141 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7184 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7142 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
7185 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7143 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
7186 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7187 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7188 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7189 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7190 {
7191 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7192 /* .name = "Capture Source", */
7193 .name = "Input Source",
7194 .count = 2,
7195 .info = alc_mux_enum_info,
7196 .get = alc_mux_enum_get,
7197 .put = alc_mux_enum_put,
7198 },
7199 { } /* end */ 7144 { } /* end */
7200}; 7145};
7201 7146
@@ -7221,17 +7166,6 @@ static struct snd_kcontrol_new alc883_3ST_6ch_mixer[] = {
7221 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7166 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7222 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7167 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
7223 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7168 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
7224 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7225 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7226 {
7227 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7228 /* .name = "Capture Source", */
7229 .name = "Input Source",
7230 .count = 1,
7231 .info = alc_mux_enum_info,
7232 .get = alc_mux_enum_get,
7233 .put = alc_mux_enum_put,
7234 },
7235 { } /* end */ 7169 { } /* end */
7236}; 7170};
7237 7171
@@ -7258,19 +7192,6 @@ static struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer[] = {
7258 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7192 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7259 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7193 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
7260 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7194 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
7261 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7262 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7263 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7264 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7265 {
7266 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7267 /* .name = "Capture Source", */
7268 .name = "Input Source",
7269 .count = 2,
7270 .info = alc_mux_enum_info,
7271 .get = alc_mux_enum_get,
7272 .put = alc_mux_enum_put,
7273 },
7274 { } /* end */ 7195 { } /* end */
7275}; 7196};
7276 7197
@@ -7296,18 +7217,6 @@ static struct snd_kcontrol_new alc883_fivestack_mixer[] = {
7296 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7217 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7297 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7218 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
7298 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7219 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
7299 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7300 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7301
7302 {
7303 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7304 /* .name = "Capture Source", */
7305 .name = "Input Source",
7306 .count = 1,
7307 .info = alc_mux_enum_info,
7308 .get = alc_mux_enum_get,
7309 .put = alc_mux_enum_put,
7310 },
7311 { } /* end */ 7220 { } /* end */
7312}; 7221};
7313 7222
@@ -7328,19 +7237,6 @@ static struct snd_kcontrol_new alc883_tagra_mixer[] = {
7328 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 7237 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7329 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7238 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7330 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7239 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7331 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7332 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7333 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7334 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7335 {
7336 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7337 /* .name = "Capture Source", */
7338 .name = "Input Source",
7339 .count = 2,
7340 .info = alc_mux_enum_info,
7341 .get = alc_mux_enum_get,
7342 .put = alc_mux_enum_put,
7343 },
7344 { } /* end */ 7240 { } /* end */
7345}; 7241};
7346 7242
@@ -7356,19 +7252,6 @@ static struct snd_kcontrol_new alc883_tagra_2ch_mixer[] = {
7356 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7252 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7357 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT), 7253 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
7358 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7254 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7359 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7360 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7361 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7362 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7363 {
7364 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7365 /* .name = "Capture Source", */
7366 .name = "Input Source",
7367 .count = 2,
7368 .info = alc_mux_enum_info,
7369 .get = alc_mux_enum_get,
7370 .put = alc_mux_enum_put,
7371 },
7372 { } /* end */ 7255 { } /* end */
7373}; 7256};
7374 7257
@@ -7381,17 +7264,6 @@ static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer[] = {
7381 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7264 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7382 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7265 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7383 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7266 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7384 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7385 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7386 {
7387 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7388 /* .name = "Capture Source", */
7389 .name = "Input Source",
7390 .count = 1,
7391 .info = alc_mux_enum_info,
7392 .get = alc_mux_enum_get,
7393 .put = alc_mux_enum_put,
7394 },
7395 { } /* end */ 7267 { } /* end */
7396}; 7268};
7397 7269
@@ -7405,19 +7277,6 @@ static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = {
7405 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7277 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7406 HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7278 HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7407 HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7279 HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7408 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7409 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7410 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7411 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7412 {
7413 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7414 /* .name = "Capture Source", */
7415 .name = "Input Source",
7416 .count = 2,
7417 .info = alc_mux_enum_info,
7418 .get = alc_mux_enum_get,
7419 .put = alc_mux_enum_put,
7420 },
7421 { } /* end */ 7280 { } /* end */
7422}; 7281};
7423 7282
@@ -7431,19 +7290,6 @@ static struct snd_kcontrol_new alc883_medion_md2_mixer[] = {
7431 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7290 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7432 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 7291 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7433 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 7292 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7434 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7435 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7436 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7437 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7438 {
7439 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7440 /* .name = "Capture Source", */
7441 .name = "Input Source",
7442 .count = 2,
7443 .info = alc_mux_enum_info,
7444 .get = alc_mux_enum_get,
7445 .put = alc_mux_enum_put,
7446 },
7447 { } /* end */ 7293 { } /* end */
7448}; 7294};
7449 7295
@@ -7456,19 +7302,6 @@ static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
7456 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 7302 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7457 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7303 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7458 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7304 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7459 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7460 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7461 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7462 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7463 {
7464 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7465 /* .name = "Capture Source", */
7466 .name = "Input Source",
7467 .count = 2,
7468 .info = alc_mux_enum_info,
7469 .get = alc_mux_enum_get,
7470 .put = alc_mux_enum_put,
7471 },
7472 { } /* end */ 7305 { } /* end */
7473}; 7306};
7474 7307
@@ -7496,19 +7329,6 @@ static struct snd_kcontrol_new alc888_lenovo_sky_mixer[] = {
7496 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7329 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7497 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), 7330 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
7498 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7331 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7499 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
7500 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
7501 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
7502 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
7503 {
7504 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7505 /* .name = "Capture Source", */
7506 .name = "Input Source",
7507 .count = 2,
7508 .info = alc_mux_enum_info,
7509 .get = alc_mux_enum_get,
7510 .put = alc_mux_enum_put,
7511 },
7512 { } /* end */ 7332 { } /* end */
7513}; 7333};
7514 7334
@@ -7539,6 +7359,10 @@ static struct snd_kcontrol_new alc883_asus_eee1601_mixer[] = {
7539 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 7359 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7540 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7360 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7541 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7361 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7362 { } /* end */
7363};
7364
7365static struct snd_kcontrol_new alc883_asus_eee1601_cap_mixer[] = {
7542 HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol), 7366 HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol),
7543 HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch), 7367 HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch),
7544 { 7368 {
@@ -8203,9 +8027,6 @@ static struct hda_verb alc883_auto_init_verbs[] = {
8203 { } 8027 { }
8204}; 8028};
8205 8029
8206/* capture mixer elements */
8207#define alc883_capture_mixer alc880_capture_alt_mixer /* 2 ADC ver */
8208
8209static struct hda_verb alc888_asus_m90v_verbs[] = { 8030static struct hda_verb alc888_asus_m90v_verbs[] = {
8210 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8031 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8211 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8032 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
@@ -8485,6 +8306,8 @@ static struct alc_config_preset alc883_presets[] = {
8485 .init_verbs = { alc883_init_verbs, alc883_tagra_verbs}, 8306 .init_verbs = { alc883_init_verbs, alc883_tagra_verbs},
8486 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8307 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8487 .dac_nids = alc883_dac_nids, 8308 .dac_nids = alc883_dac_nids,
8309 .adc_nids = alc883_adc_nids_alt,
8310 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
8488 .dig_out_nid = ALC883_DIGOUT_NID, 8311 .dig_out_nid = ALC883_DIGOUT_NID,
8489 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 8312 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
8490 .channel_mode = alc883_3ST_2ch_modes, 8313 .channel_mode = alc883_3ST_2ch_modes,
@@ -8525,6 +8348,8 @@ static struct alc_config_preset alc883_presets[] = {
8525 alc883_medion_eapd_verbs }, 8348 alc883_medion_eapd_verbs },
8526 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8349 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8527 .dac_nids = alc883_dac_nids, 8350 .dac_nids = alc883_dac_nids,
8351 .adc_nids = alc883_adc_nids_alt,
8352 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
8528 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 8353 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
8529 .channel_mode = alc883_sixstack_modes, 8354 .channel_mode = alc883_sixstack_modes,
8530 .input_mux = &alc883_capture_source, 8355 .input_mux = &alc883_capture_source,
@@ -8567,6 +8392,8 @@ static struct alc_config_preset alc883_presets[] = {
8567 .init_verbs = { alc883_init_verbs, alc883_lenovo_101e_verbs}, 8392 .init_verbs = { alc883_init_verbs, alc883_lenovo_101e_verbs},
8568 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8393 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8569 .dac_nids = alc883_dac_nids, 8394 .dac_nids = alc883_dac_nids,
8395 .adc_nids = alc883_adc_nids_alt,
8396 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
8570 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 8397 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
8571 .channel_mode = alc883_3ST_2ch_modes, 8398 .channel_mode = alc883_3ST_2ch_modes,
8572 .input_mux = &alc883_lenovo_101e_capture_source, 8399 .input_mux = &alc883_lenovo_101e_capture_source,
@@ -8663,8 +8490,6 @@ static struct alc_config_preset alc883_presets[] = {
8663 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8490 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8664 .dac_nids = alc883_dac_nids, 8491 .dac_nids = alc883_dac_nids,
8665 .dig_out_nid = ALC883_DIGOUT_NID, 8492 .dig_out_nid = ALC883_DIGOUT_NID,
8666 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
8667 .adc_nids = alc883_adc_nids,
8668 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 8493 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
8669 .channel_mode = alc883_sixstack_modes, 8494 .channel_mode = alc883_sixstack_modes,
8670 .need_dac_fix = 1, 8495 .need_dac_fix = 1,
@@ -8688,6 +8513,7 @@ static struct alc_config_preset alc883_presets[] = {
8688 }, 8513 },
8689 [ALC888_ASUS_EEE1601] = { 8514 [ALC888_ASUS_EEE1601] = {
8690 .mixers = { alc883_asus_eee1601_mixer }, 8515 .mixers = { alc883_asus_eee1601_mixer },
8516 .cap_mixer = alc883_asus_eee1601_cap_mixer,
8691 .init_verbs = { alc883_init_verbs, alc888_asus_eee1601_verbs }, 8517 .init_verbs = { alc883_init_verbs, alc888_asus_eee1601_verbs },
8692 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8518 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8693 .dac_nids = alc883_dac_nids, 8519 .dac_nids = alc883_dac_nids,
@@ -8794,7 +8620,6 @@ static int alc883_parse_auto_config(struct hda_codec *codec)
8794 8620
8795 /* hack - override the init verbs */ 8621 /* hack - override the init verbs */
8796 spec->init_verbs[0] = alc883_auto_init_verbs; 8622 spec->init_verbs[0] = alc883_auto_init_verbs;
8797 add_mixer(spec, alc883_capture_mixer);
8798 8623
8799 return 1; /* config found */ 8624 return 1; /* config found */
8800} 8625}
@@ -8877,10 +8702,15 @@ static int patch_alc883(struct hda_codec *codec)
8877 spec->stream_digital_playback = &alc883_pcm_digital_playback; 8702 spec->stream_digital_playback = &alc883_pcm_digital_playback;
8878 spec->stream_digital_capture = &alc883_pcm_digital_capture; 8703 spec->stream_digital_capture = &alc883_pcm_digital_capture;
8879 8704
8880 spec->num_adc_nids = ARRAY_SIZE(alc883_adc_nids); 8705 if (!spec->num_adc_nids) {
8881 spec->adc_nids = alc883_adc_nids; 8706 spec->num_adc_nids = ARRAY_SIZE(alc883_adc_nids);
8882 spec->capsrc_nids = alc883_capsrc_nids; 8707 spec->adc_nids = alc883_adc_nids;
8708 }
8709 if (!spec->capsrc_nids)
8710 spec->capsrc_nids = alc883_capsrc_nids;
8883 spec->is_mix_capture = 1; /* matrix-style capture */ 8711 spec->is_mix_capture = 1; /* matrix-style capture */
8712 if (!spec->cap_mixer)
8713 set_capture_mixer(spec);
8884 8714
8885 spec->vmaster_nid = 0x0c; 8715 spec->vmaster_nid = 0x0c;
8886 8716
@@ -9371,20 +9201,6 @@ static struct snd_kcontrol_new alc262_toshiba_s06_mixer[] = {
9371 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), 9201 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
9372 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 9202 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
9373 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 9203 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
9374 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
9375 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
9376 {
9377 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
9378 /* The multiple "Capture Source" controls confuse alsamixer
9379 * So call somewhat different..
9380 */
9381 /* .name = "Capture Source", */
9382 .name = "Input Source",
9383 .count = 1,
9384 .info = alc_mux_enum_info,
9385 .get = alc_mux_enum_get,
9386 .put = alc_mux_enum_put,
9387 },
9388 { } /* end */ 9204 { } /* end */
9389}; 9205};
9390 9206
@@ -10556,7 +10372,8 @@ static struct alc_config_preset alc262_presets[] = {
10556 .init_hook = alc262_hippo_automute, 10372 .init_hook = alc262_hippo_automute,
10557 }, 10373 },
10558 [ALC262_ULTRA] = { 10374 [ALC262_ULTRA] = {
10559 .mixers = { alc262_ultra_mixer, alc262_ultra_capture_mixer }, 10375 .mixers = { alc262_ultra_mixer },
10376 .cap_mixer = alc262_ultra_capture_mixer,
10560 .init_verbs = { alc262_ultra_verbs }, 10377 .init_verbs = { alc262_ultra_verbs },
10561 .num_dacs = ARRAY_SIZE(alc262_dac_nids), 10378 .num_dacs = ARRAY_SIZE(alc262_dac_nids),
10562 .dac_nids = alc262_dac_nids, 10379 .dac_nids = alc262_dac_nids,
@@ -10693,14 +10510,14 @@ static int patch_alc262(struct hda_codec *codec)
10693 spec->adc_nids = alc262_adc_nids_alt; 10510 spec->adc_nids = alc262_adc_nids_alt;
10694 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt); 10511 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt);
10695 spec->capsrc_nids = alc262_capsrc_nids_alt; 10512 spec->capsrc_nids = alc262_capsrc_nids_alt;
10696 add_mixer(spec, alc262_capture_alt_mixer);
10697 } else { 10513 } else {
10698 spec->adc_nids = alc262_adc_nids; 10514 spec->adc_nids = alc262_adc_nids;
10699 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids); 10515 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids);
10700 spec->capsrc_nids = alc262_capsrc_nids; 10516 spec->capsrc_nids = alc262_capsrc_nids;
10701 add_mixer(spec, alc262_capture_mixer);
10702 } 10517 }
10703 } 10518 }
10519 if (!spec->cap_mixer)
10520 set_capture_mixer(spec);
10704 10521
10705 spec->vmaster_nid = 0x0c; 10522 spec->vmaster_nid = 0x0c;
10706 10523
@@ -11833,25 +11650,6 @@ static struct snd_kcontrol_new alc269_eeepc_mixer[] = {
11833}; 11650};
11834 11651
11835/* capture mixer elements */ 11652/* capture mixer elements */
11836static struct snd_kcontrol_new alc269_capture_mixer[] = {
11837 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
11838 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
11839 {
11840 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
11841 /* The multiple "Capture Source" controls confuse alsamixer
11842 * So call somewhat different..
11843 */
11844 /* .name = "Capture Source", */
11845 .name = "Input Source",
11846 .count = 1,
11847 .info = alc_mux_enum_info,
11848 .get = alc_mux_enum_get,
11849 .put = alc_mux_enum_put,
11850 },
11851 { } /* end */
11852};
11853
11854/* capture mixer elements */
11855static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { 11653static struct snd_kcontrol_new alc269_epc_capture_mixer[] = {
11856 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 11654 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
11857 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 11655 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
@@ -12247,7 +12045,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
12247 if (err < 0) 12045 if (err < 0)
12248 return err; 12046 return err;
12249 12047
12250 add_mixer(spec, alc269_capture_mixer); 12048 if (!spec->cap_mixer)
12049 set_capture_mixer(spec);
12251 12050
12252 store_pin_configs(codec); 12051 store_pin_configs(codec);
12253 return 1; 12052 return 1;
@@ -12292,7 +12091,7 @@ static struct snd_pci_quirk alc269_cfg_tbl[] = {
12292 12091
12293static struct alc_config_preset alc269_presets[] = { 12092static struct alc_config_preset alc269_presets[] = {
12294 [ALC269_BASIC] = { 12093 [ALC269_BASIC] = {
12295 .mixers = { alc269_base_mixer, alc269_capture_mixer }, 12094 .mixers = { alc269_base_mixer },
12296 .init_verbs = { alc269_init_verbs }, 12095 .init_verbs = { alc269_init_verbs },
12297 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 12096 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
12298 .dac_nids = alc269_dac_nids, 12097 .dac_nids = alc269_dac_nids,
@@ -12314,7 +12113,8 @@ static struct alc_config_preset alc269_presets[] = {
12314 .init_hook = alc269_quanta_fl1_init_hook, 12113 .init_hook = alc269_quanta_fl1_init_hook,
12315 }, 12114 },
12316 [ALC269_ASUS_EEEPC_P703] = { 12115 [ALC269_ASUS_EEEPC_P703] = {
12317 .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer }, 12116 .mixers = { alc269_eeepc_mixer },
12117 .cap_mixer = alc269_epc_capture_mixer,
12318 .init_verbs = { alc269_init_verbs, 12118 .init_verbs = { alc269_init_verbs,
12319 alc269_eeepc_amic_init_verbs }, 12119 alc269_eeepc_amic_init_verbs },
12320 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 12120 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
@@ -12327,7 +12127,8 @@ static struct alc_config_preset alc269_presets[] = {
12327 .init_hook = alc269_eeepc_amic_inithook, 12127 .init_hook = alc269_eeepc_amic_inithook,
12328 }, 12128 },
12329 [ALC269_ASUS_EEEPC_P901] = { 12129 [ALC269_ASUS_EEEPC_P901] = {
12330 .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer}, 12130 .mixers = { alc269_eeepc_mixer },
12131 .cap_mixer = alc269_epc_capture_mixer,
12331 .init_verbs = { alc269_init_verbs, 12132 .init_verbs = { alc269_init_verbs,
12332 alc269_eeepc_dmic_init_verbs }, 12133 alc269_eeepc_dmic_init_verbs },
12333 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 12134 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
@@ -12393,6 +12194,8 @@ static int patch_alc269(struct hda_codec *codec)
12393 spec->adc_nids = alc269_adc_nids; 12194 spec->adc_nids = alc269_adc_nids;
12394 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 12195 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
12395 spec->capsrc_nids = alc269_capsrc_nids; 12196 spec->capsrc_nids = alc269_capsrc_nids;
12197 if (!spec->cap_mixer)
12198 set_capture_mixer(spec);
12396 12199
12397 codec->patch_ops = alc_patch_ops; 12200 codec->patch_ops = alc_patch_ops;
12398 if (board_config == ALC269_AUTO) 12201 if (board_config == ALC269_AUTO)
@@ -12533,17 +12336,6 @@ static struct snd_kcontrol_new alc861_base_mixer[] = {
12533 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT), 12336 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
12534 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), 12337 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT),
12535 12338
12536 /* Capture mixer control */
12537 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
12538 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
12539 {
12540 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12541 .name = "Capture Source",
12542 .count = 1,
12543 .info = alc_mux_enum_info,
12544 .get = alc_mux_enum_get,
12545 .put = alc_mux_enum_put,
12546 },
12547 { } /* end */ 12339 { } /* end */
12548}; 12340};
12549 12341
@@ -12567,17 +12359,6 @@ static struct snd_kcontrol_new alc861_3ST_mixer[] = {
12567 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT), 12359 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
12568 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), 12360 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT),
12569 12361
12570 /* Capture mixer control */
12571 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
12572 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
12573 {
12574 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12575 .name = "Capture Source",
12576 .count = 1,
12577 .info = alc_mux_enum_info,
12578 .get = alc_mux_enum_get,
12579 .put = alc_mux_enum_put,
12580 },
12581 { 12362 {
12582 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 12363 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12583 .name = "Channel Mode", 12364 .name = "Channel Mode",
@@ -12595,18 +12376,6 @@ static struct snd_kcontrol_new alc861_toshiba_mixer[] = {
12595 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT), 12376 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT),
12596 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT), 12377 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT),
12597 12378
12598 /*Capture mixer control */
12599 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
12600 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
12601 {
12602 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12603 .name = "Capture Source",
12604 .count = 1,
12605 .info = alc_mux_enum_info,
12606 .get = alc_mux_enum_get,
12607 .put = alc_mux_enum_put,
12608 },
12609
12610 { } /* end */ 12379 { } /* end */
12611}; 12380};
12612 12381
@@ -12630,17 +12399,6 @@ static struct snd_kcontrol_new alc861_uniwill_m31_mixer[] = {
12630 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT), 12399 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
12631 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), 12400 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT),
12632 12401
12633 /* Capture mixer control */
12634 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
12635 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
12636 {
12637 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12638 .name = "Capture Source",
12639 .count = 1,
12640 .info = alc_mux_enum_info,
12641 .get = alc_mux_enum_get,
12642 .put = alc_mux_enum_put,
12643 },
12644 { 12402 {
12645 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 12403 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12646 .name = "Channel Mode", 12404 .name = "Channel Mode",
@@ -12672,17 +12430,6 @@ static struct snd_kcontrol_new alc861_asus_mixer[] = {
12672 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT), 12430 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
12673 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT), 12431 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT),
12674 12432
12675 /* Capture mixer control */
12676 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
12677 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
12678 {
12679 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12680 .name = "Capture Source",
12681 .count = 1,
12682 .info = alc_mux_enum_info,
12683 .get = alc_mux_enum_get,
12684 .put = alc_mux_enum_put,
12685 },
12686 { 12433 {
12687 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 12434 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12688 .name = "Channel Mode", 12435 .name = "Channel Mode",
@@ -13214,25 +12961,6 @@ static int alc861_auto_create_analog_input_ctls(struct alc_spec *spec,
13214 return 0; 12961 return 0;
13215} 12962}
13216 12963
13217static struct snd_kcontrol_new alc861_capture_mixer[] = {
13218 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
13219 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
13220
13221 {
13222 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
13223 /* The multiple "Capture Source" controls confuse alsamixer
13224 * So call somewhat different..
13225 */
13226 /* .name = "Capture Source", */
13227 .name = "Input Source",
13228 .count = 1,
13229 .info = alc_mux_enum_info,
13230 .get = alc_mux_enum_get,
13231 .put = alc_mux_enum_put,
13232 },
13233 { } /* end */
13234};
13235
13236static void alc861_auto_set_output_and_unmute(struct hda_codec *codec, 12964static void alc861_auto_set_output_and_unmute(struct hda_codec *codec,
13237 hda_nid_t nid, 12965 hda_nid_t nid,
13238 int pin_type, int dac_idx) 12966 int pin_type, int dac_idx)
@@ -13333,7 +13061,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
13333 13061
13334 spec->adc_nids = alc861_adc_nids; 13062 spec->adc_nids = alc861_adc_nids;
13335 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids); 13063 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids);
13336 add_mixer(spec, alc861_capture_mixer); 13064 set_capture_mixer(spec);
13337 13065
13338 store_pin_configs(codec); 13066 store_pin_configs(codec);
13339 return 1; 13067 return 1;
@@ -13674,25 +13402,6 @@ static struct snd_kcontrol_new alc861vd_chmode_mixer[] = {
13674 { } /* end */ 13402 { } /* end */
13675}; 13403};
13676 13404
13677static struct snd_kcontrol_new alc861vd_capture_mixer[] = {
13678 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
13679 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
13680
13681 {
13682 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
13683 /* The multiple "Capture Source" controls confuse alsamixer
13684 * So call somewhat different..
13685 */
13686 /* .name = "Capture Source", */
13687 .name = "Input Source",
13688 .count = 1,
13689 .info = alc_mux_enum_info,
13690 .get = alc_mux_enum_get,
13691 .put = alc_mux_enum_put,
13692 },
13693 { } /* end */
13694};
13695
13696/* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17 13405/* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
13697 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b 13406 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
13698 */ 13407 */
@@ -14516,7 +14225,7 @@ static int patch_alc861vd(struct hda_codec *codec)
14516 spec->capsrc_nids = alc861vd_capsrc_nids; 14225 spec->capsrc_nids = alc861vd_capsrc_nids;
14517 spec->is_mix_capture = 1; 14226 spec->is_mix_capture = 1;
14518 14227
14519 add_mixer(spec, alc861vd_capture_mixer); 14228 set_capture_mixer(spec);
14520 14229
14521 spec->vmaster_nid = 0x02; 14230 spec->vmaster_nid = 0x02;
14522 14231
@@ -15188,25 +14897,6 @@ static struct hda_verb alc662_ecs_init_verbs[] = {
15188 {} 14897 {}
15189}; 14898};
15190 14899
15191/* capture mixer elements */
15192static struct snd_kcontrol_new alc662_capture_mixer[] = {
15193 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
15194 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
15195 {
15196 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
15197 /* The multiple "Capture Source" controls confuse alsamixer
15198 * So call somewhat different..
15199 */
15200 /* .name = "Capture Source", */
15201 .name = "Input Source",
15202 .count = 1,
15203 .info = alc_mux_enum_info,
15204 .get = alc_mux_enum_get,
15205 .put = alc_mux_enum_put,
15206 },
15207 { } /* end */
15208};
15209
15210static struct snd_kcontrol_new alc662_auto_capture_mixer[] = { 14900static struct snd_kcontrol_new alc662_auto_capture_mixer[] = {
15211 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 14901 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
15212 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 14902 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
@@ -15778,7 +15468,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
15778 15468
15779static struct alc_config_preset alc662_presets[] = { 15469static struct alc_config_preset alc662_presets[] = {
15780 [ALC662_3ST_2ch_DIG] = { 15470 [ALC662_3ST_2ch_DIG] = {
15781 .mixers = { alc662_3ST_2ch_mixer, alc662_capture_mixer }, 15471 .mixers = { alc662_3ST_2ch_mixer },
15782 .init_verbs = { alc662_init_verbs }, 15472 .init_verbs = { alc662_init_verbs },
15783 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15473 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15784 .dac_nids = alc662_dac_nids, 15474 .dac_nids = alc662_dac_nids,
@@ -15789,8 +15479,7 @@ static struct alc_config_preset alc662_presets[] = {
15789 .input_mux = &alc662_capture_source, 15479 .input_mux = &alc662_capture_source,
15790 }, 15480 },
15791 [ALC662_3ST_6ch_DIG] = { 15481 [ALC662_3ST_6ch_DIG] = {
15792 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer, 15482 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer },
15793 alc662_capture_mixer },
15794 .init_verbs = { alc662_init_verbs }, 15483 .init_verbs = { alc662_init_verbs },
15795 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15484 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15796 .dac_nids = alc662_dac_nids, 15485 .dac_nids = alc662_dac_nids,
@@ -15802,8 +15491,7 @@ static struct alc_config_preset alc662_presets[] = {
15802 .input_mux = &alc662_capture_source, 15491 .input_mux = &alc662_capture_source,
15803 }, 15492 },
15804 [ALC662_3ST_6ch] = { 15493 [ALC662_3ST_6ch] = {
15805 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer, 15494 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer },
15806 alc662_capture_mixer },
15807 .init_verbs = { alc662_init_verbs }, 15495 .init_verbs = { alc662_init_verbs },
15808 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15496 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15809 .dac_nids = alc662_dac_nids, 15497 .dac_nids = alc662_dac_nids,
@@ -15813,8 +15501,7 @@ static struct alc_config_preset alc662_presets[] = {
15813 .input_mux = &alc662_capture_source, 15501 .input_mux = &alc662_capture_source,
15814 }, 15502 },
15815 [ALC662_5ST_DIG] = { 15503 [ALC662_5ST_DIG] = {
15816 .mixers = { alc662_base_mixer, alc662_chmode_mixer, 15504 .mixers = { alc662_base_mixer, alc662_chmode_mixer },
15817 alc662_capture_mixer },
15818 .init_verbs = { alc662_init_verbs }, 15505 .init_verbs = { alc662_init_verbs },
15819 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15506 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15820 .dac_nids = alc662_dac_nids, 15507 .dac_nids = alc662_dac_nids,
@@ -15825,7 +15512,7 @@ static struct alc_config_preset alc662_presets[] = {
15825 .input_mux = &alc662_capture_source, 15512 .input_mux = &alc662_capture_source,
15826 }, 15513 },
15827 [ALC662_LENOVO_101E] = { 15514 [ALC662_LENOVO_101E] = {
15828 .mixers = { alc662_lenovo_101e_mixer, alc662_capture_mixer }, 15515 .mixers = { alc662_lenovo_101e_mixer },
15829 .init_verbs = { alc662_init_verbs, alc662_sue_init_verbs }, 15516 .init_verbs = { alc662_init_verbs, alc662_sue_init_verbs },
15830 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15517 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15831 .dac_nids = alc662_dac_nids, 15518 .dac_nids = alc662_dac_nids,
@@ -15836,7 +15523,7 @@ static struct alc_config_preset alc662_presets[] = {
15836 .init_hook = alc662_lenovo_101e_all_automute, 15523 .init_hook = alc662_lenovo_101e_all_automute,
15837 }, 15524 },
15838 [ALC662_ASUS_EEEPC_P701] = { 15525 [ALC662_ASUS_EEEPC_P701] = {
15839 .mixers = { alc662_eeepc_p701_mixer, alc662_capture_mixer }, 15526 .mixers = { alc662_eeepc_p701_mixer },
15840 .init_verbs = { alc662_init_verbs, 15527 .init_verbs = { alc662_init_verbs,
15841 alc662_eeepc_sue_init_verbs }, 15528 alc662_eeepc_sue_init_verbs },
15842 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15529 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15848,7 +15535,7 @@ static struct alc_config_preset alc662_presets[] = {
15848 .init_hook = alc662_eeepc_inithook, 15535 .init_hook = alc662_eeepc_inithook,
15849 }, 15536 },
15850 [ALC662_ASUS_EEEPC_EP20] = { 15537 [ALC662_ASUS_EEEPC_EP20] = {
15851 .mixers = { alc662_eeepc_ep20_mixer, alc662_capture_mixer, 15538 .mixers = { alc662_eeepc_ep20_mixer,
15852 alc662_chmode_mixer }, 15539 alc662_chmode_mixer },
15853 .init_verbs = { alc662_init_verbs, 15540 .init_verbs = { alc662_init_verbs,
15854 alc662_eeepc_ep20_sue_init_verbs }, 15541 alc662_eeepc_ep20_sue_init_verbs },
@@ -15861,7 +15548,7 @@ static struct alc_config_preset alc662_presets[] = {
15861 .init_hook = alc662_eeepc_ep20_inithook, 15548 .init_hook = alc662_eeepc_ep20_inithook,
15862 }, 15549 },
15863 [ALC662_ECS] = { 15550 [ALC662_ECS] = {
15864 .mixers = { alc662_ecs_mixer, alc662_capture_mixer }, 15551 .mixers = { alc662_ecs_mixer },
15865 .init_verbs = { alc662_init_verbs, 15552 .init_verbs = { alc662_init_verbs,
15866 alc662_ecs_init_verbs }, 15553 alc662_ecs_init_verbs },
15867 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15554 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15873,7 +15560,7 @@ static struct alc_config_preset alc662_presets[] = {
15873 .init_hook = alc662_eeepc_inithook, 15560 .init_hook = alc662_eeepc_inithook,
15874 }, 15561 },
15875 [ALC663_ASUS_M51VA] = { 15562 [ALC663_ASUS_M51VA] = {
15876 .mixers = { alc663_m51va_mixer, alc662_capture_mixer}, 15563 .mixers = { alc663_m51va_mixer },
15877 .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs }, 15564 .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs },
15878 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15565 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15879 .dac_nids = alc662_dac_nids, 15566 .dac_nids = alc662_dac_nids,
@@ -15885,7 +15572,7 @@ static struct alc_config_preset alc662_presets[] = {
15885 .init_hook = alc663_m51va_inithook, 15572 .init_hook = alc663_m51va_inithook,
15886 }, 15573 },
15887 [ALC663_ASUS_G71V] = { 15574 [ALC663_ASUS_G71V] = {
15888 .mixers = { alc663_g71v_mixer, alc662_capture_mixer}, 15575 .mixers = { alc663_g71v_mixer },
15889 .init_verbs = { alc662_init_verbs, alc663_g71v_init_verbs }, 15576 .init_verbs = { alc662_init_verbs, alc663_g71v_init_verbs },
15890 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15577 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15891 .dac_nids = alc662_dac_nids, 15578 .dac_nids = alc662_dac_nids,
@@ -15897,7 +15584,7 @@ static struct alc_config_preset alc662_presets[] = {
15897 .init_hook = alc663_g71v_inithook, 15584 .init_hook = alc663_g71v_inithook,
15898 }, 15585 },
15899 [ALC663_ASUS_H13] = { 15586 [ALC663_ASUS_H13] = {
15900 .mixers = { alc663_m51va_mixer, alc662_capture_mixer}, 15587 .mixers = { alc663_m51va_mixer },
15901 .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs }, 15588 .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs },
15902 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15589 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15903 .dac_nids = alc662_dac_nids, 15590 .dac_nids = alc662_dac_nids,
@@ -15908,7 +15595,7 @@ static struct alc_config_preset alc662_presets[] = {
15908 .init_hook = alc663_m51va_inithook, 15595 .init_hook = alc663_m51va_inithook,
15909 }, 15596 },
15910 [ALC663_ASUS_G50V] = { 15597 [ALC663_ASUS_G50V] = {
15911 .mixers = { alc663_g50v_mixer, alc662_capture_mixer}, 15598 .mixers = { alc663_g50v_mixer },
15912 .init_verbs = { alc662_init_verbs, alc663_g50v_init_verbs }, 15599 .init_verbs = { alc662_init_verbs, alc663_g50v_init_verbs },
15913 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15600 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
15914 .dac_nids = alc662_dac_nids, 15601 .dac_nids = alc662_dac_nids,
@@ -15920,7 +15607,8 @@ static struct alc_config_preset alc662_presets[] = {
15920 .init_hook = alc663_g50v_inithook, 15607 .init_hook = alc663_g50v_inithook,
15921 }, 15608 },
15922 [ALC663_ASUS_MODE1] = { 15609 [ALC663_ASUS_MODE1] = {
15923 .mixers = { alc663_m51va_mixer, alc662_auto_capture_mixer }, 15610 .mixers = { alc663_m51va_mixer },
15611 .cap_mixer = alc662_auto_capture_mixer,
15924 .init_verbs = { alc662_init_verbs, 15612 .init_verbs = { alc662_init_verbs,
15925 alc663_21jd_amic_init_verbs }, 15613 alc663_21jd_amic_init_verbs },
15926 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15614 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15934,7 +15622,8 @@ static struct alc_config_preset alc662_presets[] = {
15934 .init_hook = alc663_mode1_inithook, 15622 .init_hook = alc663_mode1_inithook,
15935 }, 15623 },
15936 [ALC662_ASUS_MODE2] = { 15624 [ALC662_ASUS_MODE2] = {
15937 .mixers = { alc662_1bjd_mixer, alc662_auto_capture_mixer }, 15625 .mixers = { alc662_1bjd_mixer },
15626 .cap_mixer = alc662_auto_capture_mixer,
15938 .init_verbs = { alc662_init_verbs, 15627 .init_verbs = { alc662_init_verbs,
15939 alc662_1bjd_amic_init_verbs }, 15628 alc662_1bjd_amic_init_verbs },
15940 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15629 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15947,7 +15636,8 @@ static struct alc_config_preset alc662_presets[] = {
15947 .init_hook = alc662_mode2_inithook, 15636 .init_hook = alc662_mode2_inithook,
15948 }, 15637 },
15949 [ALC663_ASUS_MODE3] = { 15638 [ALC663_ASUS_MODE3] = {
15950 .mixers = { alc663_two_hp_m1_mixer, alc662_auto_capture_mixer }, 15639 .mixers = { alc663_two_hp_m1_mixer },
15640 .cap_mixer = alc662_auto_capture_mixer,
15951 .init_verbs = { alc662_init_verbs, 15641 .init_verbs = { alc662_init_verbs,
15952 alc663_two_hp_amic_m1_init_verbs }, 15642 alc663_two_hp_amic_m1_init_verbs },
15953 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15643 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15961,8 +15651,8 @@ static struct alc_config_preset alc662_presets[] = {
15961 .init_hook = alc663_mode3_inithook, 15651 .init_hook = alc663_mode3_inithook,
15962 }, 15652 },
15963 [ALC663_ASUS_MODE4] = { 15653 [ALC663_ASUS_MODE4] = {
15964 .mixers = { alc663_asus_21jd_clfe_mixer, 15654 .mixers = { alc663_asus_21jd_clfe_mixer },
15965 alc662_auto_capture_mixer}, 15655 .cap_mixer = alc662_auto_capture_mixer,
15966 .init_verbs = { alc662_init_verbs, 15656 .init_verbs = { alc662_init_verbs,
15967 alc663_21jd_amic_init_verbs}, 15657 alc663_21jd_amic_init_verbs},
15968 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15658 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15976,8 +15666,8 @@ static struct alc_config_preset alc662_presets[] = {
15976 .init_hook = alc663_mode4_inithook, 15666 .init_hook = alc663_mode4_inithook,
15977 }, 15667 },
15978 [ALC663_ASUS_MODE5] = { 15668 [ALC663_ASUS_MODE5] = {
15979 .mixers = { alc663_asus_15jd_clfe_mixer, 15669 .mixers = { alc663_asus_15jd_clfe_mixer },
15980 alc662_auto_capture_mixer }, 15670 .cap_mixer = alc662_auto_capture_mixer,
15981 .init_verbs = { alc662_init_verbs, 15671 .init_verbs = { alc662_init_verbs,
15982 alc663_15jd_amic_init_verbs }, 15672 alc663_15jd_amic_init_verbs },
15983 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15673 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -15991,7 +15681,8 @@ static struct alc_config_preset alc662_presets[] = {
15991 .init_hook = alc663_mode5_inithook, 15681 .init_hook = alc663_mode5_inithook,
15992 }, 15682 },
15993 [ALC663_ASUS_MODE6] = { 15683 [ALC663_ASUS_MODE6] = {
15994 .mixers = { alc663_two_hp_m2_mixer, alc662_auto_capture_mixer }, 15684 .mixers = { alc663_two_hp_m2_mixer },
15685 .cap_mixer = alc662_auto_capture_mixer,
15995 .init_verbs = { alc662_init_verbs, 15686 .init_verbs = { alc662_init_verbs,
15996 alc663_two_hp_amic_m2_init_verbs }, 15687 alc663_two_hp_amic_m2_init_verbs },
15997 .num_dacs = ARRAY_SIZE(alc662_dac_nids), 15688 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
@@ -16266,8 +15957,6 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
16266 if (err < 0) 15957 if (err < 0)
16267 return err; 15958 return err;
16268 15959
16269 add_mixer(spec, alc662_capture_mixer);
16270
16271 store_pin_configs(codec); 15960 store_pin_configs(codec);
16272 return 1; 15961 return 1;
16273} 15962}
@@ -16345,6 +16034,9 @@ static int patch_alc662(struct hda_codec *codec)
16345 spec->capsrc_nids = alc662_capsrc_nids; 16034 spec->capsrc_nids = alc662_capsrc_nids;
16346 spec->is_mix_capture = 1; 16035 spec->is_mix_capture = 1;
16347 16036
16037 if (!spec->cap_mixer)
16038 set_capture_mixer(spec);
16039
16348 spec->vmaster_nid = 0x02; 16040 spec->vmaster_nid = 0x02;
16349 16041
16350 codec->patch_ops = alc_patch_ops; 16042 codec->patch_ops = alc_patch_ops;