Lines Matching +full:center +full:- +full:spread

1 // SPDX-License-Identifier: GPL-2.0-or-later
33 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&controls[idx], ac97));
46 kctl = snd_ctl_find_id_mixer(ac97->bus->card, name);
47 if (kctl && kctl->tlv.p)
48 kctl->tlv.p = tlv;
57 guard(mutex)(&ac97->page_mutex);
66 * shared line-in/mic controls
79 ucontrol->value.enumerated.item[0] = ac97->indep_surround;
86 unsigned char indep = !!ucontrol->value.enumerated.item[0];
88 if (indep != ac97->indep_surround) {
89 ac97->indep_surround = indep;
90 if (ac97->build_ops->update_jacks)
91 ac97->build_ops->update_jacks(ac97);
101 return snd_ctl_enum_info(uinfo, 1, kcontrol->private_value, texts);
108 ucontrol->value.enumerated.item[0] = ac97->channel_mode;
115 unsigned char mode = ucontrol->value.enumerated.item[0];
117 if (mode >= kcontrol->private_value)
118 return -EINVAL;
120 if (mode != ac97->channel_mode) {
121 ac97->channel_mode = mode;
122 if (ac97->build_ops->update_jacks)
123 ac97->build_ops->update_jacks(ac97);
170 return ac97->channel_mode >= 1;
175 return ac97->channel_mode >= 2;
181 return !ac97->indep_surround && is_surround_on(ac97);
184 /* system has shared jacks with center/lfe out enabled */
187 return !ac97->indep_surround && is_clfe_on(ac97);
193 return !ac97->indep_surround && !is_surround_on(ac97);
199 return !ac97->indep_surround && !is_clfe_on(ac97);
229 val = ac97->regs[AC97_YMF7X3_3D_MODE_SEL];
232 val--;
233 ucontrol->value.enumerated.item[0] = val;
243 if (ucontrol->value.enumerated.item[0] > 2)
244 return -EINVAL;
245 val = (ucontrol->value.enumerated.item[0] + 1) << 10;
252 .name = "3D Control - Speaker",
263 static const char * const texts[2] = { "AC-Link", "A/D Converter" };
274 val = ac97->regs[AC97_YMF7X3_DIT_CTRL];
275 ucontrol->value.enumerated.item[0] = (val >> 1) & 1;
285 if (ucontrol->value.enumerated.item[0] > 1)
286 return -EINVAL;
287 val = ucontrol->value.enumerated.item[0] << 1;
297 err = snd_ctl_add(ac97->bus->card, kctl);
300 strscpy(kctl->id.name, "3D Control - Wide");
301 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 9, 7, 0);
303 err = snd_ctl_add(ac97->bus->card,
351 ac97->build_ops = &patch_yamaha_ymf743_ops;
352 ac97->caps |= AC97_BC_BASS_TREBLE;
353 ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */
354 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */
355 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */
362 There is also a bit to mute S/PDIF output in a vendor-specific register. */
375 val = ac97->regs[AC97_YMF7X3_DIT_CTRL];
376 ucontrol->value.enumerated.item[0] = (val & 0x0008) ? 2 : (val & 0x0020) ? 1 : 0;
385 if (ucontrol->value.enumerated.item[0] > 2)
386 return -EINVAL;
387 val = (ucontrol->value.enumerated.item[0] == 2) ? 0x0008 :
388 (ucontrol->value.enumerated.item[0] == 1) ? 0x0020 : 0;
435 There is also a bit to mute S/PDIF output in a vendor-specific register.
437 ac97->build_ops = &patch_yamaha_ymf753_ops;
438 ac97->caps |= AC97_BC_BASS_TREBLE;
439 ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */
463 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm97xx_snd_ac97_controls[i], ac97));
477 ac97->build_ops = &patch_wolfson_wm9703_ops;
494 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9704_snd_ac97_controls[i], ac97));
510 ac97->build_ops = &patch_wolfson_wm9704_ops;
517 ac97->build_ops = &patch_wolfson_wm9703_ops;
520 ac97->flags |= AC97_HAS_NO_VIDEO | AC97_HAS_NO_AUX;
604 AC97_SINGLE("3D Upper Cut-off Switch", AC97_3D_CONTROL, 5, 1, 1),
605 AC97_SINGLE("3D Lower Cut-off Switch", AC97_3D_CONTROL, 4, 1, 1),
608 AC97_SINGLE("Bass Cut-off Switch", AC97_MASTER_TONE, 12, 1, 1),
609 AC97_SINGLE("Tone Cut-off Switch", AC97_MASTER_TONE, 4, 1, 1),
610 AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_MASTER_TONE, 6, 1, 0),
635 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9711_snd_ac97_controls[i], ac97));
655 ac97->build_ops = &patch_wolfson_wm9711_ops;
657 ac97->flags |= AC97_HAS_NO_REC_GAIN | AC97_STEREO_MUTES | AC97_HAS_NO_MIC |
784 AC97_SINGLE("Bass Cut-off Switch", AC97_GENERAL_PURPOSE, 12, 1, 1),
785 AC97_SINGLE("Tone Cut-off Switch", AC97_GENERAL_PURPOSE, 4, 1, 1),
786 AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_GENERAL_PURPOSE, 6, 1, 0),
793 AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
794 AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
803 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls_3d[i], ac97));
815 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls[i], ac97));
856 ac97->build_ops = &patch_wolfson_wm9713_ops;
858 ac97->flags |= AC97_HAS_NO_REC_GAIN | AC97_STEREO_MUTES | AC97_HAS_NO_PHONE |
861 ac97->scaps &= ~AC97_SCAP_MODEM;
890 err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97));
893 strscpy(kctl->id.name, "3D Control Sigmatel - Depth");
894 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 2, 3, 0);
905 err = snd_ctl_add(ac97->bus->card, kctl);
908 strscpy(kctl->id.name, "3D Control Sigmatel - Depth");
909 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 0, 3, 0);
911 err = snd_ctl_add(ac97->bus->card, kctl);
914 strscpy(kctl->id.name, "3D Control Sigmatel - Rear Depth");
915 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 2, 3, 0);
921 AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch",
969 ac97->build_ops = &patch_sigmatel_stac9700_ops;
978 guard(mutex)(&ac97->page_mutex);
981 (ucontrol->value.integer.value[0] & 1) << 4);
1018 ac97->build_ops = &patch_sigmatel_stac9708_ops;
1019 ac97->caps |= 0x10; /* HP (sigmatel surround) support */
1042 ac97->build_ops = &patch_sigmatel_stac9700_ops;
1057 ac97->build_ops = &patch_sigmatel_stac9700_ops;
1059 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */
1069 ac97->build_ops = &patch_sigmatel_stac9700_ops;
1071 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */
1082 "Rear Output", "Center/LFE Output", "Mixer Output" };
1090 int shift = kcontrol->private_value;
1093 val = ac97->regs[AC97_SIGMATEL_OUTSEL] >> shift;
1095 ucontrol->value.enumerated.item[0] = 0;
1097 ucontrol->value.enumerated.item[0] = 1 + (val & 3);
1104 int shift = kcontrol->private_value;
1107 if (ucontrol->value.enumerated.item[0] > 4)
1108 return -EINVAL;
1109 if (ucontrol->value.enumerated.item[0] == 0)
1112 val = 4 | (ucontrol->value.enumerated.item[0] - 1);
1121 "Front Jack", "Rear Jack", "Center/LFE Jack", "Mute" };
1129 int shift = kcontrol->private_value;
1132 val = ac97->regs[AC97_SIGMATEL_INSEL];
1133 ucontrol->value.enumerated.item[0] = (val >> shift) & 7;
1140 int shift = kcontrol->private_value;
1143 ucontrol->value.enumerated.item[0] << shift, 0);
1159 ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3;
1168 ucontrol->value.enumerated.item[0], 0);
1188 STAC9758_OUTPUT_JACK("Center/LFE Jack", 13),
1198 AC97_SINGLE("Exchange Center/LFE", AC97_SIGMATEL_IOMISC, 4, 1, 0),
1213 /* DAC-A direct */
1215 /* DAC-A to Mix = PCM */
1216 /* DAC-B direct = Surround */
1217 /* DAC-B to Mix */
1219 /* DAC-C direct = Center/LFE */
1253 if (ac97->pci &&
1254 ac97->subsystem_vendor == 0x107b &&
1255 ac97->subsystem_device == 0x0601)
1259 ac97->build_ops = &patch_sigmatel_stac9758_ops;
1265 ac97->flags |= AC97_STEREO_MUTES;
1274 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0)
1289 switch (ac97->id & AC97_ID_CS_MASK) {
1308 /* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers.
1310 - sp/dif EA ID is not set, but sp/dif is always present.
1311 - enable/disable is spdif register bit 15.
1312 - sp/dif control register is 0x68. differs from AC97:
1313 - valid is bit 14 (vs 15)
1314 - no DRS
1315 - only 44.1/48k [00 = 48, 01=44,1] (AC97 is 00=44.1, 10=48)
1316 - sp/dif ssource select is in 0x5e bits 0,1.
1319 ac97->build_ops = &patch_cirrus_ops;
1320 ac97->flags |= AC97_CS_SPDIF;
1321 ac97->rates[AC97_RATES_SPDIF] &= ~SNDRV_PCM_RATE_32000;
1322 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */
1330 ac97->flags |= AC97_HAS_PC_BEEP;
1367 ac97->build_ops = &patch_conexant_ops;
1368 ac97->flags |= AC97_CX_SPDIF;
1369 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */
1370 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */
1393 if (test_bit(reg, ac97->reg_accessed)) {
1394 snd_ac97_write(ac97, reg, ac97->regs[reg]);
1399 if (! (ac97->flags & AC97_AD_MULTI))
1405 if (! ac97->spec.ad18xx.id[codec])
1409 ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
1410 ac97->bus->ops->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]);
1419 if (test_bit(i, ac97->reg_accessed)) {
1423 if (! ac97->spec.ad18xx.id[codec])
1427 ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
1429 ac97->bus->ops->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]);
1439 snd_ac97_write(ac97, i, ac97->regs[i]);
1473 ac97->res_table = ad1819_restbl;
1487 ac97->spec.ad18xx.unchained[idx] = mask;
1488 ac97->spec.ad18xx.id[idx] = val;
1489 ac97->spec.ad18xx.codec_cfg[idx] = 0x0000;
1505 ac97->spec.ad18xx.chained[idx] = cfg_bits[idx];
1506 ac97->spec.ad18xx.id[idx] = val;
1507 ac97->spec.ad18xx.codec_cfg[idx] = codec_bits ? codec_bits : 0x0004;
1514 if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1])
1515 cidx1 = -1;
1516 if (ac97->spec.ad18xx.unchained[cidx2] || ac97->spec.ad18xx.chained[cidx2])
1517 cidx2 = -1;
1522 ac97->spec.ad18xx.unchained[unchained_idx]);
1524 ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002;
1566 if (ac97->spec.ad18xx.unchained[idx])
1569 if (ac97->spec.ad18xx.id[1]) {
1570 ac97->flags |= AC97_AD_MULTI;
1571 ac97->scaps |= AC97_SCAP_SURROUND_DAC;
1573 if (ac97->spec.ad18xx.id[2]) {
1574 ac97->flags |= AC97_AD_MULTI;
1575 ac97->scaps |= AC97_SCAP_CENTER_LFE_DAC;
1583 if (ac97->spec.ad18xx.id[idx])
1588 ac97->spec.ad18xx.codec_cfg[0] =
1589 ac97->spec.ad18xx.codec_cfg[1] =
1590 ac97->spec.ad18xx.codec_cfg[2] = 0x0000;
1593 ac97->ext_id = snd_ac97_read(ac97, AC97_EXTENDED_ID);
1594 if (ac97->spec.ad18xx.id[0]) {
1595 ac97->id &= 0xffff0000;
1596 ac97->id |= ac97->spec.ad18xx.id[0];
1598 ac97->build_ops = &patch_ad1881_build_ops;
1611 static const DECLARE_TLV_DB_SCALE(db_scale_6bit_6db_max, -8850, 150, 0);
1641 ac97->build_ops = &patch_ad1885_build_ops;
1665 ac97->build_ops = &patch_ad1886_build_ops;
1674 #define AC97_AD198X_VREFD 0x0004 /* VREF high-Z */
1681 #define AC97_AD198X_2MIC 0x0040 /* 2-channel mic select */
1682 #define AC97_AD198X_SPRD 0x0080 /* SPREAD enable */
1684 /* 0 = 6-to-4, 1 = 6-to-2 downmix */
1687 #define AC97_AD198X_CLDIS 0x0800 /* center/lfe disable */
1691 #define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */
1706 #define AC97_AD1986_2MIC 0x0040 /* 2-channel mic select */
1707 #define AC97_AD1986_SPRD 0x0080 /* SPREAD enable */
1709 /* 0 = 6-to-4, 1 = 6-to-2 downmix */
1711 #define AC97_AD1986_CLDIS 0x0800 /* center/lfe disable */
1715 #define AC97_AD1986_DACZ 0x8000 /* DAC zero-fill mode */
1760 #define AC97_AD1986_OMS_C 0x0200 /* Center/LFE pins are MCI sources */
1773 static const char * const texts[2] = { "AC-Link", "A/D Converter" };
1783 val = ac97->regs[AC97_AD_SERIAL_CFG];
1784 ucontrol->value.enumerated.item[0] = (val >> 2) & 1;
1793 if (ucontrol->value.enumerated.item[0] > 1)
1794 return -EINVAL;
1795 val = ucontrol->value.enumerated.item[0] << 2;
1817 /* deny list to avoid HP/Line jack-sense controls
1826 0x10140567, /* Thinkpad T43p 2668-G7U */
1827 0x10140581, /* Thinkpad X41-2527 */
1829 0x104380b0, /* Asus A7V8X-MX */
1830 0x11790241, /* Toshiba Satellite A-15 S127 */
1832 0x144dc01a, /* Samsung NP-X20C004/SEG */
1838 u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device;
1861 /* allow list to enable HP jack-sense bits
1873 0x17340088, /* FSC Scenic-W */
1887 ac97->build_ops = &patch_ad1981a_build_ops;
1889 ac97->flags |= AC97_STEREO_MUTES;
1921 ac97->build_ops = &patch_ad1981b_build_ops;
1923 ac97->flags |= AC97_STEREO_MUTES;
1935 val = ac97->regs[AC97_AD_MISC];
1936 ucontrol->value.integer.value[0] = !(val & AC97_AD198X_LOSEL);
1937 if (ac97->spec.ad18xx.lo_as_master)
1938 ucontrol->value.integer.value[0] =
1939 !ucontrol->value.integer.value[0];
1948 val = !ucontrol->value.integer.value[0];
1949 if (ac97->spec.ad18xx.lo_as_master)
1958 static const char * const texts[3] = {"Off", "6 -> 4", "6 -> 2"};
1968 val = ac97->regs[AC97_AD_MISC];
1970 ucontrol->value.enumerated.item[0] = 0;
1972 ucontrol->value.enumerated.item[0] = 1 + ((val >> 8) & 1);
1981 if (ucontrol->value.enumerated.item[0] > 2)
1982 return -EINVAL;
1983 if (ucontrol->value.enumerated.item[0] == 0)
1987 ((ucontrol->value.enumerated.item[0] - 1) << 8);
1996 if (!ac97->spec.ad18xx.lo_as_master && is_shared_linein(ac97))
2001 /* shared Line-In */
2016 AC97_SINGLE("Spread Front to Surround and Center/LFE", AC97_AD_MISC, 7, 1, 0),
2033 if (!ac97->spec.ad18xx.lo_as_master) {
2057 ac97->build_ops = &patch_ad1888_build_ops;
2060 * LO can be used as a real line-out on some devices,
2063 if (ac97->subsystem_vendor == 0x1043 &&
2064 ac97->subsystem_device == 0x1193) /* ASUS A9T laptop */
2065 ac97->spec.ad18xx.lo_as_master = 1;
2068 /* AD-compatible mode */
2071 if (!ac97->spec.ad18xx.lo_as_master)
2072 /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */
2073 /* it seems that most vendors connect line-out connector to
2079 ac97->flags |= AC97_STEREO_MUTES;
2105 ac97->build_ops = &patch_ad1980_build_ops;
2113 "High-Z", "3.7 V", "2.25 V", "0 V"
2125 val = (ac97->regs[AC97_AD_MISC] & AC97_AD198X_VREF_MASK)
2127 ucontrol->value.enumerated.item[0] = reg2ctrl[val];
2138 if (ucontrol->value.enumerated.item[0] > 3)
2139 return -EINVAL;
2140 val = ctrl2reg[ucontrol->value.enumerated.item[0]]
2147 AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0),
2156 AC97_SINGLE("Spread Front to Surround and Center/LFE",
2218 ac97->build_ops = &patch_ad1985_build_ops;
2220 /* switch front/surround line-out/hp-out */
2221 /* AD-compatible mode */
2228 ac97->flags |= AC97_STEREO_MUTES;
2234 ac97->ext_id = (ac97->ext_id & ~AC97_EI_REV_MASK) | AC97_EI_REV_23;
2246 val = ac97->regs[AC97_AD_MISC3];
2247 ucontrol->value.integer.value[0] = (val & AC97_AD1986_LOSEL) != 0;
2257 int sprd = (ac97->regs[AC97_AD_MISC] & AC97_AD1986_SPRD) != 0;
2260 ucontrol->value.integer.value[0] != 0
2265 /* SOSEL is set to values of "Spread" or "Exchange F/S" controls */
2267 (ucontrol->value.integer.value[0] != 0
2282 val = ac97->regs[AC97_AD_MISC];
2283 ucontrol->value.integer.value[0] = (val & AC97_AD1986_SPRD) != 0;
2293 int sprd = (ac97->regs[AC97_AD_MISC3] & AC97_AD1986_LOSEL) != 0;
2296 ucontrol->value.integer.value[0] != 0
2301 /* SOSEL is set to values of "Spread" or "Exchange F/S" controls */
2303 (ucontrol->value.integer.value[0] != 0
2317 ucontrol->value.integer.value[0] = ac97->spec.ad18xx.swap_mic_linein;
2325 unsigned char swap = ucontrol->value.integer.value[0] != 0;
2327 if (swap != ac97->spec.ad18xx.swap_mic_linein) {
2328 ac97->spec.ad18xx.swap_mic_linein = swap;
2329 if (ac97->build_ops->update_jacks)
2330 ac97->build_ops->update_jacks(ac97);
2342 unsigned short reg = ac97->regs[AC97_AD_MISC2];
2351 ucontrol->value.enumerated.item[0] = val;
2366 switch (ucontrol->value.enumerated.item[0])
2368 case 0: /* High-Z */
2389 return -EINVAL;
2409 AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0),
2426 .name = "Spread Front to Surround and Center/LFE",
2457 /* disable SURROUND and CENTER/LFE if not surround mode */
2466 else if (ac97->spec.ad18xx.swap_mic_linein != 0)
2473 /* select microphone input (MIC_1/2, Center/LFE or LINE_IN) */
2476 else if (ac97->spec.ad18xx.swap_mic_linein != 0)
2509 ac97->build_ops = &patch_ad1986_build_ops;
2510 ac97->flags |= AC97_STEREO_MUTES;
2519 * realtek ALC203: use mono-out for pin 37
2534 /* shared Line-In / Surround Out */
2538 /* update shared Mic In / Center/LFE Out */
2543 /* turn on/off center-on-mic */
2555 struct snd_pcm_chmap *map = ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK];
2558 if (ucontrol->value.integer.value[0])
2559 map->chmap = snd_pcm_std_chmaps;
2561 map->chmap = snd_pcm_alt_chmaps;
2569 AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0),
2570 AC97_SINGLE("Exchange Center/LFE", AC97_ALC650_MULTICH, 3, 1, 0),
2572 /* 5: Analog Input To Center/LFE */
2576 /* 9: Line-In/Surround share */
2578 /* 11-13: in IEC958 controls */
2592 AC97_SINGLE("Center/LFE DAC Switch", AC97_ALC650_LFE_DAC_VOL, 15, 1, 1),
2593 AC97_DOUBLE("Center/LFE DAC Volume", AC97_ALC650_LFE_DAC_VOL, 8, 0, 31, 1),
2606 static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_max, -4350, 150, 0);
2615 if (ac97->ext_id & AC97_EI_SPDIF) {
2620 if (ac97->id != AC97_ID_ALC650F)
2635 ac97->build_ops = &patch_alc650_ops;
2640 ac97->id = 0x414c4720; /* Old version */
2642 ac97->id = 0x414c4721; /* D version */
2644 ac97->id = 0x414c4722; /* E version */
2646 ac97->id = 0x414c4723; /* F version */
2650 ac97->spec.dev_flags = (ac97->id == 0x414c4722 ||
2651 ac97->id == 0x414c4723);
2657 /* Enable SPDIF-IN only on Rev.E and above */
2660 if (ac97->spec.dev_flags &&
2662 ! (ac97->subsystem_vendor == 0x1043 &&
2663 ac97->subsystem_device == 0x1103))
2670 spdif-in monitor off, analog-spdif off, spdif-in off
2671 center on mic off, surround on line-in off
2693 /* shared Line-In / Surround Out */
2697 /* update shared Mic In / Center/LFE Out */
2722 if (ac97->spec.dev_flags)
2733 val = ac97->regs[AC97_ALC650_MULTICH];
2735 if (ac97->spec.dev_flags && val == 3)
2737 ucontrol->value.enumerated.item[0] = val;
2746 (unsigned short)ucontrol->value.enumerated.item[0] << 12,
2770 if (ac97->ext_id & AC97_EI_SPDIF) {
2787 if (ac97->id == AC97_ID_ALC658) {
2788 ac97->spec.dev_flags = 1; /* ALC658 */
2790 ac97->id = AC97_ID_ALC658D;
2791 ac97->spec.dev_flags = 2;
2795 ac97->build_ops = &patch_alc655_ops;
2802 if (ac97->spec.dev_flags) /* ALC658 */
2805 if (ac97->subsystem_vendor == 0x1462 &&
2806 (ac97->subsystem_device == 0x0131 || /* MSI S270 laptop */
2807 ac97->subsystem_device == 0x0161 || /* LG K1 Express */
2808 ac97->subsystem_device == 0x0351 || /* MSI L725 laptop */
2809 ac97->subsystem_device == 0x0471 || /* MSI L720 laptop */
2810 ac97->subsystem_device == 0x0061)) /* MSI S250 laptop */
2815 ac97->ext_id |= AC97_EI_SPDIF;
2819 /* set default: spdif-in enabled,
2820 spdif-in monitor off, spdif-in PCM off
2821 center on mic off, surround on line-in off
2831 if (ac97->id == AC97_ID_ALC658D)
2847 /* shared Line-In / Surround Out */
2852 /* LINE-IN = 0, SURROUND = 2 */
2855 /* update shared Mic In / Center/LFE Out */
2860 /* MIC-IN = 1, CENTER-LFE = 5 */
2884 if (ac97->ext_id & AC97_EI_SPDIF) {
2899 ac97->build_ops = &patch_alc850_ops;
2901 ac97->spec.dev_flags = 0; /* for IEC958 playback route - ALC655 compatible */
2902 ac97->flags |= AC97_HAS_8CH;
2908 /* set default: spdif-in enabled,
2909 spdif-in monitor off, spdif-in PCM off
2910 center on mic off, surround on line-in off
2916 * Front Amp: on, Vref: enable, Center 1kOhm: on, Mix: on
2921 * UIO1: FRONT, Vref3: disable, UIO3: LINE, Front-Mic: mute
2935 snd_ac97_find_mixer_ctl(ac97, "3D Control - Center");
2937 snd_ac97_find_mixer_ctl(ac97, "3D Control - Depth");
2944 kctl_3d_center->private_value =
2947 "3D Control - Center", "3D Control - Width"
2951 kctl_3d_depth->private_value =
2972 ac97->build_ops = &patch_aztech_azf3328_ops;
2977 * C-Media CM97xx codecs
2981 /* shared Line-In / Surround Out */
3004 ac97->build_ops = &patch_cm9738_ops;
3007 ac97->flags |= AC97_HAS_NO_PCM_VOL;
3025 val = ac97->regs[AC97_CM9739_SPDIF_CTRL];
3026 ucontrol->value.enumerated.item[0] = (val >> 1) & 0x01;
3036 (ucontrol->value.enumerated.item[0] & 0x01) << 1);
3040 /* BIT 0: SPDI_EN - always true */
3054 /* BIT 8: SPD32 - 32bit SPDIF - not supported yet */
3059 /* shared Line-In / Surround Out */
3062 /* shared Mic In / Center/LFE Out **/
3092 ac97->build_ops = &patch_cm9739_ops;
3095 ac97->flags |= AC97_HAS_NO_MASTER_VOL | AC97_HAS_NO_PCM_VOL;
3105 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */
3107 ac97->ext_id &= ~AC97_EI_SPDIF; /* disable extended-id */
3108 ac97->rates[AC97_RATES_SPDIF] = 0;
3111 /* set-up multi channel */
3114 /* bit 12: disable center/lfe (switchable) */
3123 if (! (ac97->ext_id & AC97_EI_SPDIF))
3131 if (ac97->pci &&
3132 ac97->subsystem_vendor == 0x1043 &&
3133 ac97->subsystem_device == 0x1843) {
3153 { 0x0008, 0x0000 }, /* 9761-78 & 82 */
3154 { 0x0000, 0x0008 }, /* 9761-82 rev.B */
3155 { 0x0000, 0x0008 }, /* 9761-83 */
3158 { 0x0000, 0x1000 }, /* 9761-78 & 82 */
3159 { 0x1000, 0x0000 }, /* 9761-82 rev.B */
3160 { 0x0000, 0x1000 }, /* 9761-83 */
3163 { 0x0000, 0x0400 }, /* 9761-78 & 82 */
3164 { 0x0000, 0x0400 }, /* 9761-82 rev.B */
3165 { 0x0000, 0x0400 }, /* 9761-83 */
3168 { 0x2000, 0x0880 }, /* 9761-78 & 82 */
3169 { 0x0000, 0x2880 }, /* 9761-82 rev.B */
3170 { 0x2000, 0x0800 }, /* 9761-83 */
3174 val |= surr_on[ac97->spec.dev_flags][is_surround_on(ac97)];
3175 val |= clfe_on[ac97->spec.dev_flags][is_clfe_on(ac97)];
3176 val |= surr_shared[ac97->spec.dev_flags][is_shared_surrout(ac97)];
3177 val |= clfe_shared[ac97->spec.dev_flags][is_shared_clfeout(ac97)];
3189 static const char * const texts[] = { "AC-Link", "ADC", "SPDIF-In" };
3198 if (ac97->regs[AC97_CM9761_FUNC] & 0x1)
3199 ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */
3200 else if (ac97->regs[AC97_CM9761_SPDIF_CTRL] & 0x2)
3201 ucontrol->value.enumerated.item[0] = 1; /* ADC loopback */
3203 ucontrol->value.enumerated.item[0] = 0; /* AC-link */
3211 if (ucontrol->value.enumerated.item[0] == 2)
3215 ucontrol->value.enumerated.item[0] == 1 ? 0x2 : 0);
3219 "AC-Link", "SPDIF-In", "Both"
3238 /* BIT 9-10: DAC_CTL */
3266 ac97->flags |= /*AC97_HAS_NO_MASTER_VOL |*/ AC97_HAS_NO_PCM_VOL;
3270 ac97->spec.dev_flags = 0; /* 1 = model 82 revision B, 2 = model 83 */
3271 if (ac97->id == AC97_ID_CM9761_82) {
3277 ac97->spec.dev_flags = tmp & 1; /* revision B? */
3279 } else if (ac97->id == AC97_ID_CM9761_83)
3280 ac97->spec.dev_flags = 2;
3282 ac97->build_ops = &patch_cm9761_ops;
3285 /* force the SPDIF bit in ext_id - codec doesn't set this bit! */
3286 ac97->ext_id |= AC97_EI_SPDIF;
3290 snd_ac97_write_cache(ac97, AC97_CM9761_SPDIF_CTRL, 0x0001); /* enable spdif-in */
3291 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */
3293 /* set-up multi channel */
3298 * bit 11: Mic/center share (reverted on rev B)
3300 * bit 9: Analog-in mix -> surround
3301 * bit 8: Analog-in mix -> CLFE
3302 * bit 7: Mic/LFE share (mic/center/lfe)
3312 if (ac97->spec.dev_flags)
3335 "Front", "Side", "Center/LFE", "Rear"
3359 ac97->build_ops = &patch_cm9780_ops;
3362 if (ac97->ext_id & AC97_EI_SPDIF) {
3363 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */
3391 ac97->build_ops = &patch_vt1613_ops;
3393 ac97->flags |= AC97_HAS_NO_VIDEO;
3394 ac97->caps |= AC97_BC_HEADPHONE;
3405 AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0),
3412 "Center Playback Volume",
3420 "Center Playback Switch",
3429 return snd_ctl_find_id_mixer(ac97->bus->card, name);
3442 return -ENOMEM;
3443 err = snd_ctl_add(ac97->bus->card, kctl);
3447 return snd_ctl_add_followers(ac97->bus->card, kctl, followers);
3460 err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[1], ARRAY_SIZE(snd_ac97_controls_vt1616) - 1);
3467 return -EINVAL;
3472 kctl->tlv.p, follower_vols_vt1616);
3490 ac97->build_ops = &patch_vt1616_ops;
3515 * counter-intuitive */
3540 ucontrol->value.enumerated.item[0] = (usSM51 << 1) + usMS;
3554 usSM51 = ucontrol->value.enumerated.item[0] >> 1;
3555 usMS = ucontrol->value.enumerated.item[0] & 1;
3557 /* push our values into the register - consider that things will be left
3570 AC97_SINGLE("Center/LFE Exchange", 0x5a, 8, 1, 0),
3605 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */
3606 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
3607 ac97->build_ops = &patch_vt1616_ops;
3623 * OUT_O -> Front,
3624 * OUT_1 -> Surround,
3625 * OUT_2 -> C/LFE
3641 * CN700T, i have to set it to get 5.1 output - YMMV, bad
3678 "Center LFE Out", "DAC Unmixed Out", "Line In", "Mic In"
3687 vt1618_uaj[kcontrol->private_value].items);
3700 guard(mutex)(&pac97->page_mutex);
3706 vt1618_uaj[kcontrol->private_value].mask;
3710 ucontrol->value.enumerated.item[0] = uaj >>
3711 vt1618_uaj[kcontrol->private_value].shift;
3720 vt1618_uaj[kcontrol->private_value].mask,
3721 ucontrol->value.enumerated.item[0]<<
3722 vt1618_uaj[kcontrol->private_value].shift,
3726 /* config aux in jack - not found on 3 jack motherboards or soundcards */
3739 ucontrol->value.enumerated.item[0] =
3750 ucontrol->value.enumerated.item[0] << 3);
3755 ucontrol->value.enumerated.item[0] << 3);
3759 AC97_SINGLE("Exchange Center/LFE", 0x5a, 8, 1, 0),
3808 /* shared Line-In / Surround Out */
3811 /* shared Mic / Center/LFE Out */
3846 ac97->build_ops = &patch_it2646_ops;
3868 err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_si3036[idx], ac97));
3881 ac97->build_ops = &patch_si3036_ops;
3913 ac97->res_table = lm4550_restbl;