Lines Matching +full:ouput +full:- +full:only
1 // SPDX-License-Identifier: GPL-2.0-or-later
33 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&controls[idx], ac97)); in patch_build_controls()
49 kctl = snd_ctl_find_id(ac97->bus->card, &sid); in reset_tlv()
50 if (kctl && kctl->tlv.p) in reset_tlv()
51 kctl->tlv.p = tlv; in reset_tlv()
60 mutex_lock(&ac97->page_mutex); in ac97_update_bits_page()
65 mutex_unlock(&ac97->page_mutex); /* unlock paging */ in ac97_update_bits_page()
70 * shared line-in/mic controls
83 ucontrol->value.enumerated.item[0] = ac97->indep_surround; in ac97_surround_jack_mode_get()
90 unsigned char indep = !!ucontrol->value.enumerated.item[0]; in ac97_surround_jack_mode_put()
92 if (indep != ac97->indep_surround) { in ac97_surround_jack_mode_put()
93 ac97->indep_surround = indep; in ac97_surround_jack_mode_put()
94 if (ac97->build_ops->update_jacks) in ac97_surround_jack_mode_put()
95 ac97->build_ops->update_jacks(ac97); in ac97_surround_jack_mode_put()
105 return snd_ctl_enum_info(uinfo, 1, kcontrol->private_value, texts); in ac97_channel_mode_info()
112 ucontrol->value.enumerated.item[0] = ac97->channel_mode; in ac97_channel_mode_get()
119 unsigned char mode = ucontrol->value.enumerated.item[0]; in ac97_channel_mode_put()
121 if (mode >= kcontrol->private_value) in ac97_channel_mode_put()
122 return -EINVAL; in ac97_channel_mode_put()
124 if (mode != ac97->channel_mode) { in ac97_channel_mode_put()
125 ac97->channel_mode = mode; in ac97_channel_mode_put()
126 if (ac97->build_ops->update_jacks) in ac97_channel_mode_put()
127 ac97->build_ops->update_jacks(ac97); in ac97_channel_mode_put()
174 return ac97->channel_mode >= 1; in is_surround_on()
179 return ac97->channel_mode >= 2; in is_clfe_on()
185 return !ac97->indep_surround && is_surround_on(ac97); in is_shared_surrout()
191 return !ac97->indep_surround && is_clfe_on(ac97); in is_shared_clfeout()
197 return !ac97->indep_surround && !is_surround_on(ac97); in is_shared_linein()
203 return !ac97->indep_surround && !is_clfe_on(ac97); in is_shared_micin()
233 val = ac97->regs[AC97_YMF7X3_3D_MODE_SEL]; in snd_ac97_ymf7x3_get_speaker()
236 val--; in snd_ac97_ymf7x3_get_speaker()
237 ucontrol->value.enumerated.item[0] = val; in snd_ac97_ymf7x3_get_speaker()
247 if (ucontrol->value.enumerated.item[0] > 2) in snd_ac97_ymf7x3_put_speaker()
248 return -EINVAL; in snd_ac97_ymf7x3_put_speaker()
249 val = (ucontrol->value.enumerated.item[0] + 1) << 10; in snd_ac97_ymf7x3_put_speaker()
256 .name = "3D Control - Speaker",
267 static const char * const texts[2] = { "AC-Link", "A/D Converter" }; in snd_ac97_ymf7x3_spdif_source_info()
278 val = ac97->regs[AC97_YMF7X3_DIT_CTRL]; in snd_ac97_ymf7x3_spdif_source_get()
279 ucontrol->value.enumerated.item[0] = (val >> 1) & 1; in snd_ac97_ymf7x3_spdif_source_get()
289 if (ucontrol->value.enumerated.item[0] > 1) in snd_ac97_ymf7x3_spdif_source_put()
290 return -EINVAL; in snd_ac97_ymf7x3_spdif_source_put()
291 val = ucontrol->value.enumerated.item[0] << 1; in snd_ac97_ymf7x3_spdif_source_put()
301 err = snd_ctl_add(ac97->bus->card, kctl); in patch_yamaha_ymf7x3_3d()
304 strcpy(kctl->id.name, "3D Control - Wide"); in patch_yamaha_ymf7x3_3d()
305 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 9, 7, 0); in patch_yamaha_ymf7x3_3d()
307 err = snd_ctl_add(ac97->bus->card, in patch_yamaha_ymf7x3_3d()
355 ac97->build_ops = &patch_yamaha_ymf743_ops; in patch_yamaha_ymf743()
356 ac97->caps |= AC97_BC_BASS_TREBLE; in patch_yamaha_ymf743()
357 ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */ in patch_yamaha_ymf743()
358 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */ in patch_yamaha_ymf743()
359 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ in patch_yamaha_ymf743()
366 There is also a bit to mute S/PDIF output in a vendor-specific register. */
379 val = ac97->regs[AC97_YMF7X3_DIT_CTRL]; in snd_ac97_ymf753_spdif_output_pin_get()
380 ucontrol->value.enumerated.item[0] = (val & 0x0008) ? 2 : (val & 0x0020) ? 1 : 0; in snd_ac97_ymf753_spdif_output_pin_get()
389 if (ucontrol->value.enumerated.item[0] > 2) in snd_ac97_ymf753_spdif_output_pin_put()
390 return -EINVAL; in snd_ac97_ymf753_spdif_output_pin_put()
391 val = (ucontrol->value.enumerated.item[0] == 2) ? 0x0008 : in snd_ac97_ymf753_spdif_output_pin_put()
392 (ucontrol->value.enumerated.item[0] == 1) ? 0x0020 : 0; in snd_ac97_ymf753_spdif_output_pin_put()
437 The YMF753 will ouput the S/PDIF signal to pin 43, 47 (EAPD), or 48. in patch_yamaha_ymf753()
439 There is also a bit to mute S/PDIF output in a vendor-specific register. in patch_yamaha_ymf753()
441 ac97->build_ops = &patch_yamaha_ymf753_ops; in patch_yamaha_ymf753()
442 ac97->caps |= AC97_BC_BASS_TREBLE; in patch_yamaha_ymf753()
443 ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */ in patch_yamaha_ymf753()
467 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm97xx_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9703_specific()
481 ac97->build_ops = &patch_wolfson_wm9703_ops; in patch_wolfson03()
498 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9704_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9704_specific()
514 ac97->build_ops = &patch_wolfson_wm9704_ops; in patch_wolfson04()
521 ac97->build_ops = &patch_wolfson_wm9703_ops; in patch_wolfson05()
524 ac97->flags |= AC97_HAS_NO_VIDEO | AC97_HAS_NO_AUX; in patch_wolfson05()
608 AC97_SINGLE("3D Upper Cut-off Switch", AC97_3D_CONTROL, 5, 1, 1),
609 AC97_SINGLE("3D Lower Cut-off Switch", AC97_3D_CONTROL, 4, 1, 1),
612 AC97_SINGLE("Bass Cut-off Switch", AC97_MASTER_TONE, 12, 1, 1),
613 AC97_SINGLE("Tone Cut-off Switch", AC97_MASTER_TONE, 4, 1, 1),
614 AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_MASTER_TONE, 6, 1, 0),
639 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9711_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9711_specific()
659 ac97->build_ops = &patch_wolfson_wm9711_ops; in patch_wolfson11()
661 ac97->flags |= AC97_HAS_NO_REC_GAIN | AC97_STEREO_MUTES | AC97_HAS_NO_MIC | in patch_wolfson11()
788 AC97_SINGLE("Bass Cut-off Switch", AC97_GENERAL_PURPOSE, 12, 1, 1),
789 AC97_SINGLE("Tone Cut-off Switch", AC97_GENERAL_PURPOSE, 4, 1, 1),
790 AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_GENERAL_PURPOSE, 6, 1, 0),
797 AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
798 AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
807 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls_3d[i], ac97)); in patch_wolfson_wm9713_3d()
819 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9713_specific()
860 ac97->build_ops = &patch_wolfson_wm9713_ops; in patch_wolfson13()
862 ac97->flags |= AC97_HAS_NO_REC_GAIN | AC97_STEREO_MUTES | AC97_HAS_NO_PHONE | in patch_wolfson13()
865 ac97->scaps &= ~AC97_SCAP_MODEM; in patch_wolfson13()
894 err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97)); in patch_sigmatel_stac9700_3d()
897 strcpy(kctl->id.name, "3D Control Sigmatel - Depth"); in patch_sigmatel_stac9700_3d()
898 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 2, 3, 0); in patch_sigmatel_stac9700_3d()
909 err = snd_ctl_add(ac97->bus->card, kctl); in patch_sigmatel_stac9708_3d()
912 strcpy(kctl->id.name, "3D Control Sigmatel - Depth"); in patch_sigmatel_stac9708_3d()
913 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 0, 3, 0); in patch_sigmatel_stac9708_3d()
915 err = snd_ctl_add(ac97->bus->card, kctl); in patch_sigmatel_stac9708_3d()
918 strcpy(kctl->id.name, "3D Control Sigmatel - Rear Depth"); in patch_sigmatel_stac9708_3d()
919 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 2, 3, 0); in patch_sigmatel_stac9708_3d()
925 AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch",
973 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9700()
982 mutex_lock(&ac97->page_mutex); in snd_ac97_stac9708_put_bias()
985 (ucontrol->value.integer.value[0] & 1) << 4); in snd_ac97_stac9708_put_bias()
987 mutex_unlock(&ac97->page_mutex); in snd_ac97_stac9708_put_bias()
1023 ac97->build_ops = &patch_sigmatel_stac9708_ops; in patch_sigmatel_stac9708()
1024 ac97->caps |= 0x10; /* HP (sigmatel surround) support */ in patch_sigmatel_stac9708()
1047 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9721()
1062 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9744()
1064 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */ in patch_sigmatel_stac9744()
1074 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9756()
1076 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */ in patch_sigmatel_stac9756()
1095 int shift = kcontrol->private_value; in snd_ac97_stac9758_output_jack_get()
1098 val = ac97->regs[AC97_SIGMATEL_OUTSEL] >> shift; in snd_ac97_stac9758_output_jack_get()
1100 ucontrol->value.enumerated.item[0] = 0; in snd_ac97_stac9758_output_jack_get()
1102 ucontrol->value.enumerated.item[0] = 1 + (val & 3); in snd_ac97_stac9758_output_jack_get()
1109 int shift = kcontrol->private_value; in snd_ac97_stac9758_output_jack_put()
1112 if (ucontrol->value.enumerated.item[0] > 4) in snd_ac97_stac9758_output_jack_put()
1113 return -EINVAL; in snd_ac97_stac9758_output_jack_put()
1114 if (ucontrol->value.enumerated.item[0] == 0) in snd_ac97_stac9758_output_jack_put()
1117 val = 4 | (ucontrol->value.enumerated.item[0] - 1); in snd_ac97_stac9758_output_jack_put()
1134 int shift = kcontrol->private_value; in snd_ac97_stac9758_input_jack_get()
1137 val = ac97->regs[AC97_SIGMATEL_INSEL]; in snd_ac97_stac9758_input_jack_get()
1138 ucontrol->value.enumerated.item[0] = (val >> shift) & 7; in snd_ac97_stac9758_input_jack_get()
1145 int shift = kcontrol->private_value; in snd_ac97_stac9758_input_jack_put()
1148 ucontrol->value.enumerated.item[0] << shift, 0); in snd_ac97_stac9758_input_jack_put()
1164 ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3; in snd_ac97_stac9758_phonesel_get()
1173 ucontrol->value.enumerated.item[0], 0); in snd_ac97_stac9758_phonesel_put()
1218 /* DAC-A direct */ in patch_sigmatel_stac9758_specific()
1220 /* DAC-A to Mix = PCM */ in patch_sigmatel_stac9758_specific()
1221 /* DAC-B direct = Surround */ in patch_sigmatel_stac9758_specific()
1222 /* DAC-B to Mix */ in patch_sigmatel_stac9758_specific()
1224 /* DAC-C direct = Center/LFE */ in patch_sigmatel_stac9758_specific()
1258 if (ac97->pci && in patch_sigmatel_stac9758()
1259 ac97->subsystem_vendor == 0x107b && in patch_sigmatel_stac9758()
1260 ac97->subsystem_device == 0x0601) in patch_sigmatel_stac9758()
1264 ac97->build_ops = &patch_sigmatel_stac9758_ops; in patch_sigmatel_stac9758()
1265 /* FIXME: assume only page 0 for writing cache */ in patch_sigmatel_stac9758()
1270 ac97->flags |= AC97_STEREO_MUTES; in patch_sigmatel_stac9758()
1279 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0)
1294 switch (ac97->id & AC97_ID_CS_MASK) { in patch_cirrus_build_spdif()
1313 /* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers. in patch_cirrus_spdif()
1315 - sp/dif EA ID is not set, but sp/dif is always present. in patch_cirrus_spdif()
1316 - enable/disable is spdif register bit 15. in patch_cirrus_spdif()
1317 - sp/dif control register is 0x68. differs from AC97: in patch_cirrus_spdif()
1318 - valid is bit 14 (vs 15) in patch_cirrus_spdif()
1319 - no DRS in patch_cirrus_spdif()
1320 - only 44.1/48k [00 = 48, 01=44,1] (AC97 is 00=44.1, 10=48) in patch_cirrus_spdif()
1321 - sp/dif ssource select is in 0x5e bits 0,1. in patch_cirrus_spdif()
1324 ac97->build_ops = &patch_cirrus_ops; in patch_cirrus_spdif()
1325 ac97->flags |= AC97_CS_SPDIF; in patch_cirrus_spdif()
1326 ac97->rates[AC97_RATES_SPDIF] &= ~SNDRV_PCM_RATE_32000; in patch_cirrus_spdif()
1327 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ in patch_cirrus_spdif()
1335 ac97->flags |= AC97_HAS_PC_BEEP; in patch_cirrus_cs4299()
1372 ac97->build_ops = &patch_conexant_ops; in patch_conexant()
1373 ac97->flags |= AC97_CX_SPDIF; in patch_conexant()
1374 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ in patch_conexant()
1375 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */ in patch_conexant()
1398 if (test_bit(reg, ac97->reg_accessed)) { in ad18xx_resume()
1399 snd_ac97_write(ac97, reg, ac97->regs[reg]); in ad18xx_resume()
1404 if (! (ac97->flags & AC97_AD_MULTI)) in ad18xx_resume()
1410 if (! ac97->spec.ad18xx.id[codec]) in ad18xx_resume()
1414 ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); in ad18xx_resume()
1415 ac97->bus->ops->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]); in ad18xx_resume()
1424 if (test_bit(i, ac97->reg_accessed)) { in ad18xx_resume()
1428 if (! ac97->spec.ad18xx.id[codec]) in ad18xx_resume()
1432 ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); in ad18xx_resume()
1434 ac97->bus->ops->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]); in ad18xx_resume()
1444 snd_ac97_write(ac97, i, ac97->regs[i]); in ad18xx_resume()
1478 ac97->res_table = ad1819_restbl; in patch_ad1819()
1492 ac97->spec.ad18xx.unchained[idx] = mask; in patch_ad1881_unchained()
1493 ac97->spec.ad18xx.id[idx] = val; in patch_ad1881_unchained()
1494 ac97->spec.ad18xx.codec_cfg[idx] = 0x0000; in patch_ad1881_unchained()
1510 ac97->spec.ad18xx.chained[idx] = cfg_bits[idx]; in patch_ad1881_chained1()
1511 ac97->spec.ad18xx.id[idx] = val; in patch_ad1881_chained1()
1512 ac97->spec.ad18xx.codec_cfg[idx] = codec_bits ? codec_bits : 0x0004; in patch_ad1881_chained1()
1519 if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1]) in patch_ad1881_chained()
1520 cidx1 = -1; in patch_ad1881_chained()
1521 if (ac97->spec.ad18xx.unchained[cidx2] || ac97->spec.ad18xx.chained[cidx2]) in patch_ad1881_chained()
1522 cidx2 = -1; in patch_ad1881_chained()
1527 ac97->spec.ad18xx.unchained[unchained_idx]); in patch_ad1881_chained()
1529 ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002; in patch_ad1881_chained()
1571 if (ac97->spec.ad18xx.unchained[idx]) in patch_ad1881()
1574 if (ac97->spec.ad18xx.id[1]) { in patch_ad1881()
1575 ac97->flags |= AC97_AD_MULTI; in patch_ad1881()
1576 ac97->scaps |= AC97_SCAP_SURROUND_DAC; in patch_ad1881()
1578 if (ac97->spec.ad18xx.id[2]) { in patch_ad1881()
1579 ac97->flags |= AC97_AD_MULTI; in patch_ad1881()
1580 ac97->scaps |= AC97_SCAP_CENTER_LFE_DAC; in patch_ad1881()
1586 /* check if only one codec is present */ in patch_ad1881()
1588 if (ac97->spec.ad18xx.id[idx]) in patch_ad1881()
1593 ac97->spec.ad18xx.codec_cfg[0] = in patch_ad1881()
1594 ac97->spec.ad18xx.codec_cfg[1] = in patch_ad1881()
1595 ac97->spec.ad18xx.codec_cfg[2] = 0x0000; in patch_ad1881()
1598 ac97->ext_id = snd_ac97_read(ac97, AC97_EXTENDED_ID); in patch_ad1881()
1599 if (ac97->spec.ad18xx.id[0]) { in patch_ad1881()
1600 ac97->id &= 0xffff0000; in patch_ad1881()
1601 ac97->id |= ac97->spec.ad18xx.id[0]; in patch_ad1881()
1603 ac97->build_ops = &patch_ad1881_build_ops; in patch_ad1881()
1616 static const DECLARE_TLV_DB_SCALE(db_scale_6bit_6db_max, -8850, 150, 0);
1646 ac97->build_ops = &patch_ad1885_build_ops; in patch_ad1885()
1670 ac97->build_ops = &patch_ad1886_build_ops; in patch_ad1886()
1679 #define AC97_AD198X_VREFD 0x0004 /* VREF high-Z */
1681 #define AC97_AD198X_VREF_0 0x000c /* 0V (AD1985 only) */
1686 #define AC97_AD198X_2MIC 0x0040 /* 2-channel mic select */
1689 /* 0 = 6-to-4, 1 = 6-to-2 downmix */
1696 #define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */
1711 #define AC97_AD1986_2MIC 0x0040 /* 2-channel mic select */
1714 /* 0 = 6-to-4, 1 = 6-to-2 downmix */
1718 #define AC97_AD1986_MSPLT 0x2000 /* mute split (read only 1) */
1720 #define AC97_AD1986_DACZ 0x8000 /* DAC zero-fill mode */
1778 static const char * const texts[2] = { "AC-Link", "A/D Converter" }; in snd_ac97_ad198x_spdif_source_info()
1788 val = ac97->regs[AC97_AD_SERIAL_CFG]; in snd_ac97_ad198x_spdif_source_get()
1789 ucontrol->value.enumerated.item[0] = (val >> 2) & 1; in snd_ac97_ad198x_spdif_source_get()
1798 if (ucontrol->value.enumerated.item[0] > 1) in snd_ac97_ad198x_spdif_source_put()
1799 return -EINVAL; in snd_ac97_ad198x_spdif_source_put()
1800 val = ucontrol->value.enumerated.item[0] << 2; in snd_ac97_ad198x_spdif_source_put()
1822 /* deny list to avoid HP/Line jack-sense controls
1831 0x10140567, /* Thinkpad T43p 2668-G7U */
1832 0x10140581, /* Thinkpad X41-2527 */
1834 0x104380b0, /* Asus A7V8X-MX */
1835 0x11790241, /* Toshiba Satellite A-15 S127 */
1837 0x144dc01a, /* Samsung NP-X20C004/SEG */
1843 u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; in check_list()
1866 /* allow list to enable HP jack-sense bits
1878 0x17340088, /* FSC Scenic-W */
1892 ac97->build_ops = &patch_ad1981a_build_ops; in patch_ad1981a()
1894 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1981a()
1926 ac97->build_ops = &patch_ad1981b_build_ops; in patch_ad1981b()
1928 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1981b()
1940 val = ac97->regs[AC97_AD_MISC]; in snd_ac97_ad1888_lohpsel_get()
1941 ucontrol->value.integer.value[0] = !(val & AC97_AD198X_LOSEL); in snd_ac97_ad1888_lohpsel_get()
1942 if (ac97->spec.ad18xx.lo_as_master) in snd_ac97_ad1888_lohpsel_get()
1943 ucontrol->value.integer.value[0] = in snd_ac97_ad1888_lohpsel_get()
1944 !ucontrol->value.integer.value[0]; in snd_ac97_ad1888_lohpsel_get()
1953 val = !ucontrol->value.integer.value[0]; in snd_ac97_ad1888_lohpsel_put()
1954 if (ac97->spec.ad18xx.lo_as_master) in snd_ac97_ad1888_lohpsel_put()
1963 static const char * const texts[3] = {"Off", "6 -> 4", "6 -> 2"}; in snd_ac97_ad1888_downmix_info()
1973 val = ac97->regs[AC97_AD_MISC]; in snd_ac97_ad1888_downmix_get()
1975 ucontrol->value.enumerated.item[0] = 0; in snd_ac97_ad1888_downmix_get()
1977 ucontrol->value.enumerated.item[0] = 1 + ((val >> 8) & 1); in snd_ac97_ad1888_downmix_get()
1986 if (ucontrol->value.enumerated.item[0] > 2) in snd_ac97_ad1888_downmix_put()
1987 return -EINVAL; in snd_ac97_ad1888_downmix_put()
1988 if (ucontrol->value.enumerated.item[0] == 0) in snd_ac97_ad1888_downmix_put()
1992 ((ucontrol->value.enumerated.item[0] - 1) << 8); in snd_ac97_ad1888_downmix_put()
2001 if (!ac97->spec.ad18xx.lo_as_master && is_shared_linein(ac97)) in ad1888_update_jacks()
2006 /* shared Line-In */ in ad1888_update_jacks()
2038 if (!ac97->spec.ad18xx.lo_as_master) { in patch_ad1888_specific()
2062 ac97->build_ops = &patch_ad1888_build_ops; in patch_ad1888()
2065 * LO can be used as a real line-out on some devices, in patch_ad1888()
2068 if (ac97->subsystem_vendor == 0x1043 && in patch_ad1888()
2069 ac97->subsystem_device == 0x1193) /* ASUS A9T laptop */ in patch_ad1888()
2070 ac97->spec.ad18xx.lo_as_master = 1; in patch_ad1888()
2073 /* AD-compatible mode */ in patch_ad1888()
2076 if (!ac97->spec.ad18xx.lo_as_master) in patch_ad1888()
2077 /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */ in patch_ad1888()
2078 /* it seems that most vendors connect line-out connector to in patch_ad1888()
2084 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1888()
2110 ac97->build_ops = &patch_ad1980_build_ops; in patch_ad1980()
2118 "High-Z", "3.7 V", "2.25 V", "0 V" in snd_ac97_ad1985_vrefout_info()
2130 val = (ac97->regs[AC97_AD_MISC] & AC97_AD198X_VREF_MASK) in snd_ac97_ad1985_vrefout_get()
2132 ucontrol->value.enumerated.item[0] = reg2ctrl[val]; in snd_ac97_ad1985_vrefout_get()
2143 if (ucontrol->value.enumerated.item[0] > 3) in snd_ac97_ad1985_vrefout_put()
2144 return -EINVAL; in snd_ac97_ad1985_vrefout_put()
2145 val = ctrl2reg[ucontrol->value.enumerated.item[0]] in snd_ac97_ad1985_vrefout_put()
2223 ac97->build_ops = &patch_ad1985_build_ops; in patch_ad1985()
2225 /* switch front/surround line-out/hp-out */ in patch_ad1985()
2226 /* AD-compatible mode */ in patch_ad1985()
2233 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1985()
2239 ac97->ext_id = (ac97->ext_id & ~AC97_EI_REV_MASK) | AC97_EI_REV_23; in patch_ad1985()
2251 val = ac97->regs[AC97_AD_MISC3]; in snd_ac97_ad1986_lososel_get()
2252 ucontrol->value.integer.value[0] = (val & AC97_AD1986_LOSEL) != 0; in snd_ac97_ad1986_lososel_get()
2262 int sprd = (ac97->regs[AC97_AD_MISC] & AC97_AD1986_SPRD) != 0; in snd_ac97_ad1986_lososel_put()
2265 ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_lososel_put()
2272 (ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_lososel_put()
2287 val = ac97->regs[AC97_AD_MISC]; in snd_ac97_ad1986_spread_get()
2288 ucontrol->value.integer.value[0] = (val & AC97_AD1986_SPRD) != 0; in snd_ac97_ad1986_spread_get()
2298 int sprd = (ac97->regs[AC97_AD_MISC3] & AC97_AD1986_LOSEL) != 0; in snd_ac97_ad1986_spread_put()
2301 ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_spread_put()
2308 (ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_spread_put()
2322 ucontrol->value.integer.value[0] = ac97->spec.ad18xx.swap_mic_linein; in snd_ac97_ad1986_miclisel_get()
2330 unsigned char swap = ucontrol->value.integer.value[0] != 0; in snd_ac97_ad1986_miclisel_put()
2332 if (swap != ac97->spec.ad18xx.swap_mic_linein) { in snd_ac97_ad1986_miclisel_put()
2333 ac97->spec.ad18xx.swap_mic_linein = swap; in snd_ac97_ad1986_miclisel_put()
2334 if (ac97->build_ops->update_jacks) in snd_ac97_ad1986_miclisel_put()
2335 ac97->build_ops->update_jacks(ac97); in snd_ac97_ad1986_miclisel_put()
2347 unsigned short reg = ac97->regs[AC97_AD_MISC2]; in snd_ac97_ad1986_vrefout_get()
2356 ucontrol->value.enumerated.item[0] = val; in snd_ac97_ad1986_vrefout_get()
2371 switch (ucontrol->value.enumerated.item[0]) in snd_ac97_ad1986_vrefout_put()
2373 case 0: /* High-Z */ in snd_ac97_ad1986_vrefout_put()
2394 return -EINVAL; in snd_ac97_ad1986_vrefout_put()
2471 else if (ac97->spec.ad18xx.swap_mic_linein != 0) in ad1986_update_jacks()
2481 else if (ac97->spec.ad18xx.swap_mic_linein != 0) in ad1986_update_jacks()
2514 ac97->build_ops = &patch_ad1986_build_ops; in patch_ad1986()
2515 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1986()
2524 * realtek ALC203: use mono-out for pin 37
2539 /* shared Line-In / Surround Out */ in alc650_update_jacks()
2548 /* turn on/off center-on-mic */ in alc650_update_jacks()
2560 struct snd_pcm_chmap *map = ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK]; in alc650_swap_surround_put()
2563 if (ucontrol->value.integer.value[0]) in alc650_swap_surround_put()
2564 map->chmap = snd_pcm_std_chmaps; in alc650_swap_surround_put()
2566 map->chmap = snd_pcm_alt_chmaps; in alc650_swap_surround_put()
2581 /* 9: Line-In/Surround share */
2583 /* 11-13: in IEC958 controls */
2611 static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_max, -4350, 150, 0);
2620 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_alc650_specific()
2625 if (ac97->id != AC97_ID_ALC650F) in patch_alc650_specific()
2640 ac97->build_ops = &patch_alc650_ops; in patch_alc650()
2645 ac97->id = 0x414c4720; /* Old version */ in patch_alc650()
2647 ac97->id = 0x414c4721; /* D version */ in patch_alc650()
2649 ac97->id = 0x414c4722; /* E version */ in patch_alc650()
2651 ac97->id = 0x414c4723; /* F version */ in patch_alc650()
2655 ac97->spec.dev_flags = (ac97->id == 0x414c4722 || in patch_alc650()
2656 ac97->id == 0x414c4723); in patch_alc650()
2662 /* Enable SPDIF-IN only on Rev.E and above */ in patch_alc650()
2665 if (ac97->spec.dev_flags && in patch_alc650()
2667 ! (ac97->subsystem_vendor == 0x1043 && in patch_alc650()
2668 ac97->subsystem_device == 0x1103)) in patch_alc650()
2675 spdif-in monitor off, analog-spdif off, spdif-in off in patch_alc650()
2676 center on mic off, surround on line-in off in patch_alc650()
2698 /* shared Line-In / Surround Out */ in alc655_update_jacks()
2727 if (ac97->spec.dev_flags) in alc655_iec958_route_info()
2738 val = ac97->regs[AC97_ALC650_MULTICH]; in alc655_iec958_route_get()
2740 if (ac97->spec.dev_flags && val == 3) in alc655_iec958_route_get()
2742 ucontrol->value.enumerated.item[0] = val; in alc655_iec958_route_get()
2751 (unsigned short)ucontrol->value.enumerated.item[0] << 12, in alc655_iec958_route_put()
2775 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_alc655_specific()
2792 if (ac97->id == AC97_ID_ALC658) { in patch_alc655()
2793 ac97->spec.dev_flags = 1; /* ALC658 */ in patch_alc655()
2795 ac97->id = AC97_ID_ALC658D; in patch_alc655()
2796 ac97->spec.dev_flags = 2; in patch_alc655()
2800 ac97->build_ops = &patch_alc655_ops; in patch_alc655()
2802 /* assume only page 0 for writing cache */ in patch_alc655()
2807 if (ac97->spec.dev_flags) /* ALC658 */ in patch_alc655()
2810 if (ac97->subsystem_vendor == 0x1462 && in patch_alc655()
2811 (ac97->subsystem_device == 0x0131 || /* MSI S270 laptop */ in patch_alc655()
2812 ac97->subsystem_device == 0x0161 || /* LG K1 Express */ in patch_alc655()
2813 ac97->subsystem_device == 0x0351 || /* MSI L725 laptop */ in patch_alc655()
2814 ac97->subsystem_device == 0x0471 || /* MSI L720 laptop */ in patch_alc655()
2815 ac97->subsystem_device == 0x0061)) /* MSI S250 laptop */ in patch_alc655()
2820 ac97->ext_id |= AC97_EI_SPDIF; in patch_alc655()
2824 /* set default: spdif-in enabled, in patch_alc655()
2825 spdif-in monitor off, spdif-in PCM off in patch_alc655()
2826 center on mic off, surround on line-in off in patch_alc655()
2836 if (ac97->id == AC97_ID_ALC658D) in patch_alc655()
2852 /* shared Line-In / Surround Out */ in alc850_update_jacks()
2857 /* LINE-IN = 0, SURROUND = 2 */ in alc850_update_jacks()
2865 /* MIC-IN = 1, CENTER-LFE = 5 */ in alc850_update_jacks()
2889 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_alc850_specific()
2904 ac97->build_ops = &patch_alc850_ops; in patch_alc850()
2906 ac97->spec.dev_flags = 0; /* for IEC958 playback route - ALC655 compatible */ in patch_alc850()
2907 ac97->flags |= AC97_HAS_8CH; in patch_alc850()
2909 /* assume only page 0 for writing cache */ in patch_alc850()
2913 /* set default: spdif-in enabled, in patch_alc850()
2914 spdif-in monitor off, spdif-in PCM off in patch_alc850()
2915 center on mic off, surround on line-in off in patch_alc850()
2926 * UIO1: FRONT, Vref3: disable, UIO3: LINE, Front-Mic: mute in patch_alc850()
2940 snd_ac97_find_mixer_ctl(ac97, "3D Control - Center"); in patch_aztech_azf3328_specific()
2942 snd_ac97_find_mixer_ctl(ac97, "3D Control - Depth"); in patch_aztech_azf3328_specific()
2949 kctl_3d_center->private_value = in patch_aztech_azf3328_specific()
2952 "3D Control - Center", "3D Control - Width" in patch_aztech_azf3328_specific()
2956 kctl_3d_depth->private_value = in patch_aztech_azf3328_specific()
2977 ac97->build_ops = &patch_aztech_azf3328_ops; in patch_aztech_azf3328()
2982 * C-Media CM97xx codecs
2986 /* shared Line-In / Surround Out */ in cm9738_update_jacks()
3009 ac97->build_ops = &patch_cm9738_ops; in patch_cm9738()
3012 ac97->flags |= AC97_HAS_NO_PCM_VOL; in patch_cm9738()
3030 val = ac97->regs[AC97_CM9739_SPDIF_CTRL]; in snd_ac97_cmedia_spdif_playback_source_get()
3031 ucontrol->value.enumerated.item[0] = (val >> 1) & 0x01; in snd_ac97_cmedia_spdif_playback_source_get()
3041 (ucontrol->value.enumerated.item[0] & 0x01) << 1); in snd_ac97_cmedia_spdif_playback_source_put()
3045 /* BIT 0: SPDI_EN - always true */
3059 /* BIT 8: SPD32 - 32bit SPDIF - not supported yet */
3064 /* shared Line-In / Surround Out */ in cm9739_update_jacks()
3097 ac97->build_ops = &patch_cm9739_ops; in patch_cm9739()
3100 ac97->flags |= AC97_HAS_NO_MASTER_VOL | AC97_HAS_NO_PCM_VOL; in patch_cm9739()
3110 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */ in patch_cm9739()
3112 ac97->ext_id &= ~AC97_EI_SPDIF; /* disable extended-id */ in patch_cm9739()
3113 ac97->rates[AC97_RATES_SPDIF] = 0; in patch_cm9739()
3116 /* set-up multi channel */ in patch_cm9739()
3128 if (! (ac97->ext_id & AC97_EI_SPDIF)) in patch_cm9739()
3136 if (ac97->pci && in patch_cm9739()
3137 ac97->subsystem_vendor == 0x1043 && in patch_cm9739()
3138 ac97->subsystem_device == 0x1843) { in patch_cm9739()
3158 { 0x0008, 0x0000 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3159 { 0x0000, 0x0008 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3160 { 0x0000, 0x0008 }, /* 9761-83 */ in cm9761_update_jacks()
3163 { 0x0000, 0x1000 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3164 { 0x1000, 0x0000 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3165 { 0x0000, 0x1000 }, /* 9761-83 */ in cm9761_update_jacks()
3168 { 0x0000, 0x0400 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3169 { 0x0000, 0x0400 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3170 { 0x0000, 0x0400 }, /* 9761-83 */ in cm9761_update_jacks()
3173 { 0x2000, 0x0880 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3174 { 0x0000, 0x2880 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3175 { 0x2000, 0x0800 }, /* 9761-83 */ in cm9761_update_jacks()
3179 val |= surr_on[ac97->spec.dev_flags][is_surround_on(ac97)]; in cm9761_update_jacks()
3180 val |= clfe_on[ac97->spec.dev_flags][is_clfe_on(ac97)]; in cm9761_update_jacks()
3181 val |= surr_shared[ac97->spec.dev_flags][is_shared_surrout(ac97)]; in cm9761_update_jacks()
3182 val |= clfe_shared[ac97->spec.dev_flags][is_shared_clfeout(ac97)]; in cm9761_update_jacks()
3194 static const char * const texts[] = { "AC-Link", "ADC", "SPDIF-In" }; in cm9761_spdif_out_source_info()
3203 if (ac97->regs[AC97_CM9761_FUNC] & 0x1) in cm9761_spdif_out_source_get()
3204 ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */ in cm9761_spdif_out_source_get()
3205 else if (ac97->regs[AC97_CM9761_SPDIF_CTRL] & 0x2) in cm9761_spdif_out_source_get()
3206 ucontrol->value.enumerated.item[0] = 1; /* ADC loopback */ in cm9761_spdif_out_source_get()
3208 ucontrol->value.enumerated.item[0] = 0; /* AC-link */ in cm9761_spdif_out_source_get()
3216 if (ucontrol->value.enumerated.item[0] == 2) in cm9761_spdif_out_source_put()
3220 ucontrol->value.enumerated.item[0] == 1 ? 0x2 : 0); in cm9761_spdif_out_source_put()
3224 "AC-Link", "SPDIF-In", "Both"
3243 /* BIT 9-10: DAC_CTL */
3271 ac97->flags |= /*AC97_HAS_NO_MASTER_VOL |*/ AC97_HAS_NO_PCM_VOL; in patch_cm9761()
3275 ac97->spec.dev_flags = 0; /* 1 = model 82 revision B, 2 = model 83 */ in patch_cm9761()
3276 if (ac97->id == AC97_ID_CM9761_82) { in patch_cm9761()
3282 ac97->spec.dev_flags = tmp & 1; /* revision B? */ in patch_cm9761()
3284 } else if (ac97->id == AC97_ID_CM9761_83) in patch_cm9761()
3285 ac97->spec.dev_flags = 2; in patch_cm9761()
3287 ac97->build_ops = &patch_cm9761_ops; in patch_cm9761()
3290 /* force the SPDIF bit in ext_id - codec doesn't set this bit! */ in patch_cm9761()
3291 ac97->ext_id |= AC97_EI_SPDIF; in patch_cm9761()
3295 snd_ac97_write_cache(ac97, AC97_CM9761_SPDIF_CTRL, 0x0001); /* enable spdif-in */ in patch_cm9761()
3296 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */ in patch_cm9761()
3298 /* set-up multi channel */ in patch_cm9761()
3305 * bit 9: Analog-in mix -> surround in patch_cm9761()
3306 * bit 8: Analog-in mix -> CLFE in patch_cm9761()
3317 if (ac97->spec.dev_flags) in patch_cm9761()
3364 ac97->build_ops = &patch_cm9780_ops; in patch_cm9780()
3367 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_cm9780()
3368 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000; /* 48k only */ in patch_cm9780()
3396 ac97->build_ops = &patch_vt1613_ops; in patch_vt1613()
3398 ac97->flags |= AC97_HAS_NO_VIDEO; in patch_vt1613()
3399 ac97->caps |= AC97_BC_HEADPHONE; in patch_vt1613()
3434 return snd_ctl_find_id_mixer(ac97->bus->card, name); in snd_ac97_find_mixer_ctl()
3447 return -ENOMEM; in snd_ac97_add_vmaster()
3448 err = snd_ctl_add(ac97->bus->card, kctl); in snd_ac97_add_vmaster()
3452 return snd_ctl_add_followers(ac97->bus->card, kctl, followers); in snd_ac97_add_vmaster()
3465 …patch_build_controls(ac97, &snd_ac97_controls_vt1616[1], ARRAY_SIZE(snd_ac97_controls_vt1616) - 1); in patch_vt1616_specific()
3472 return -EINVAL; in patch_vt1616_specific()
3477 kctl->tlv.p, follower_vols_vt1616); in patch_vt1616_specific()
3495 ac97->build_ops = &patch_vt1616_ops; in patch_vt1616()
3520 * counter-intuitive */ in snd_ac97_vt1617a_smart51_info()
3545 ucontrol->value.enumerated.item[0] = (usSM51 << 1) + usMS; in snd_ac97_vt1617a_smart51_get()
3559 usSM51 = ucontrol->value.enumerated.item[0] >> 1; in snd_ac97_vt1617a_smart51_put()
3560 usMS = ucontrol->value.enumerated.item[0] & 1; in snd_ac97_vt1617a_smart51_put()
3562 /* push our values into the register - consider that things will be left in snd_ac97_vt1617a_smart51_put()
3610 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ in patch_vt1617a()
3611 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; in patch_vt1617a()
3612 ac97->build_ops = &patch_vt1616_ops; in patch_vt1617a()
3628 * OUT_O -> Front,
3629 * OUT_1 -> Surround,
3630 * OUT_2 -> C/LFE
3646 * CN700T, i have to set it to get 5.1 output - YMMV, bad
3692 vt1618_uaj[kcontrol->private_value].items); in snd_ac97_vt1618_UAJ_info()
3697 * the mask, are the only thing that changes
3705 mutex_lock(&pac97->page_mutex); in snd_ac97_vt1618_UAJ_get()
3711 vt1618_uaj[kcontrol->private_value].mask; in snd_ac97_vt1618_UAJ_get()
3714 mutex_unlock(&pac97->page_mutex); in snd_ac97_vt1618_UAJ_get()
3716 ucontrol->value.enumerated.item[0] = uaj >> in snd_ac97_vt1618_UAJ_get()
3717 vt1618_uaj[kcontrol->private_value].shift; in snd_ac97_vt1618_UAJ_get()
3726 vt1618_uaj[kcontrol->private_value].mask, in snd_ac97_vt1618_UAJ_put()
3727 ucontrol->value.enumerated.item[0]<< in snd_ac97_vt1618_UAJ_put()
3728 vt1618_uaj[kcontrol->private_value].shift, in snd_ac97_vt1618_UAJ_put()
3732 /* config aux in jack - not found on 3 jack motherboards or soundcards */
3745 ucontrol->value.enumerated.item[0] = in snd_ac97_vt1618_aux_get()
3756 ucontrol->value.enumerated.item[0] << 3); in snd_ac97_vt1618_aux_put()
3761 ucontrol->value.enumerated.item[0] << 3); in snd_ac97_vt1618_aux_put()
3814 /* shared Line-In / Surround Out */ in it2646_update_jacks()
3852 ac97->build_ops = &patch_it2646_ops; in patch_it2646()
3874 err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_si3036[idx], ac97)); in patch_si3036_specific()
3887 ac97->build_ops = &patch_si3036_ops; in mpatch_si3036()
3919 ac97->res_table = lm4550_restbl; in patch_lm4550()