Lines Matching +full:0 +full:x0808
32 for (idx = 0; idx < count; idx++) { in patch_build_controls()
34 if (err < 0) in patch_build_controls()
37 return 0; in patch_build_controls()
80 ucontrol->value.enumerated.item[0] = ac97->indep_surround; in ac97_surround_jack_mode_get()
81 return 0; in ac97_surround_jack_mode_get()
87 unsigned char indep = !!ucontrol->value.enumerated.item[0]; in ac97_surround_jack_mode_put()
95 return 0; in ac97_surround_jack_mode_put()
109 ucontrol->value.enumerated.item[0] = ac97->channel_mode; in ac97_channel_mode_get()
110 return 0; in ac97_channel_mode_get()
116 unsigned char mode = ucontrol->value.enumerated.item[0]; in ac97_channel_mode_put()
127 return 0; in ac97_channel_mode_put()
232 if (val > 0) /* 0 = invalid */ in snd_ac97_ymf7x3_get_speaker()
234 ucontrol->value.enumerated.item[0] = val; in snd_ac97_ymf7x3_get_speaker()
235 return 0; in snd_ac97_ymf7x3_get_speaker()
244 if (ucontrol->value.enumerated.item[0] > 2) in snd_ac97_ymf7x3_put_speaker()
246 val = (ucontrol->value.enumerated.item[0] + 1) << 10; in snd_ac97_ymf7x3_put_speaker()
276 ucontrol->value.enumerated.item[0] = (val >> 1) & 1; in snd_ac97_ymf7x3_spdif_source_get()
277 return 0; in snd_ac97_ymf7x3_spdif_source_get()
286 if (ucontrol->value.enumerated.item[0] > 1) in snd_ac97_ymf7x3_spdif_source_put()
288 val = ucontrol->value.enumerated.item[0] << 1; in snd_ac97_ymf7x3_spdif_source_put()
289 return snd_ac97_update_bits(ac97, AC97_YMF7X3_DIT_CTRL, 0x0002, val); in snd_ac97_ymf7x3_spdif_source_put()
297 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in patch_yamaha_ymf7x3_3d()
299 if (err < 0) in patch_yamaha_ymf7x3_3d()
302 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 9, 7, 0); in patch_yamaha_ymf7x3_3d()
303 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in patch_yamaha_ymf7x3_3d()
307 if (err < 0) in patch_yamaha_ymf7x3_3d()
309 snd_ac97_write_cache(ac97, AC97_YMF7X3_3D_MODE_SEL, 0x0c00); in patch_yamaha_ymf7x3_3d()
310 return 0; in patch_yamaha_ymf7x3_3d()
316 AC97_YMF7X3_DIT_CTRL, 0, 1, 0),
332 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); in patch_yamaha_ymf743_build_spdif()
333 if (err < 0) in patch_yamaha_ymf743_build_spdif()
337 if (err < 0) in patch_yamaha_ymf743_build_spdif()
341 snd_ac97_write_cache(ac97, AC97_YMF7X3_DIT_CTRL, 0xa201); in patch_yamaha_ymf743_build_spdif()
342 return 0; in patch_yamaha_ymf743_build_spdif()
354 ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */ in patch_yamaha_ymf743()
357 return 0; in patch_yamaha_ymf743()
377 ucontrol->value.enumerated.item[0] = (val & 0x0008) ? 2 : (val & 0x0020) ? 1 : 0; in snd_ac97_ymf753_spdif_output_pin_get()
378 return 0; in snd_ac97_ymf753_spdif_output_pin_get()
386 if (ucontrol->value.enumerated.item[0] > 2) in snd_ac97_ymf753_spdif_output_pin_put()
388 val = (ucontrol->value.enumerated.item[0] == 2) ? 0x0008 : in snd_ac97_ymf753_spdif_output_pin_put()
389 (ucontrol->value.enumerated.item[0] == 1) ? 0x0020 : 0; in snd_ac97_ymf753_spdif_output_pin_put()
390 return snd_ac97_update_bits(ac97, AC97_YMF7X3_DIT_CTRL, 0x0028, val); in snd_ac97_ymf753_spdif_output_pin_put()
392 snd_ac97_write_cache(ac97, 0x62, snd_ac97_read(ac97, 0x62) | 0x0008); */ in snd_ac97_ymf753_spdif_output_pin_put()
419 if (err < 0) in patch_yamaha_ymf753_post_spdif()
421 return 0; in patch_yamaha_ymf753_post_spdif()
440 ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */ in patch_yamaha_ymf753()
441 return 0; in patch_yamaha_ymf753()
451 AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1),
463 for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) { in patch_wolfson_wm9703_specific()
465 if (err < 0) in patch_wolfson_wm9703_specific()
468 snd_ac97_write_cache(ac97, AC97_WM97XX_FMIXER_VOL, 0x0808); in patch_wolfson_wm9703_specific()
469 return 0; in patch_wolfson_wm9703_specific()
479 return 0; in patch_wolfson03()
483 AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1),
485 AC97_DOUBLE("Rear Playback Volume", AC97_WM9704_RMIXER_VOL, 8, 0, 31, 1),
487 AC97_DOUBLE("Rear DAC Volume", AC97_WM9704_RPCM_VOL, 8, 0, 31, 1),
488 AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
494 for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) { in patch_wolfson_wm9704_specific()
496 if (err < 0) in patch_wolfson_wm9704_specific()
500 snd_ac97_write_cache(ac97, AC97_WM9704_TEST, 0x0200); in patch_wolfson_wm9704_specific()
501 return 0; in patch_wolfson_wm9704_specific()
512 return 0; in patch_wolfson04()
523 return 0; in patch_wolfson05()
547 AC97_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 8, wm9711_rec_sel),
552 AC97_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0),
553 AC97_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0),
554 AC97_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0),
555 AC97_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0),
556 AC97_ENUM("ALC Function", wm9711_enum[0]),
559 AC97_SINGLE("ALC ZC Switch", AC97_PCI_SVID, 8, 1, 0),
560 AC97_SINGLE("ALC NG Switch", AC97_PCI_SVID, 7, 1, 0),
562 AC97_SINGLE("ALC NG Threshold", AC97_PCI_SVID, 0, 31, 1),
570 AC97_SINGLE("Out3 ZC Switch", AC97_AUX, 7, 1, 0),
573 AC97_SINGLE("Out3 Volume", AC97_AUX, 0, 31, 1),
600 AC97_SINGLE("Capture 20dB Boost Switch", AC97_REC_SEL, 14, 1, 0),
611 AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_MASTER_TONE, 6, 1, 0),
615 AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 63, 1),
616 AC97_SINGLE("Capture ZC Switch", AC97_REC_GAIN, 7, 1, 0),
622 AC97_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1),
623 AC97_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 7, 1, 0),
625 AC97_SINGLE("Master Left Inv Switch", AC97_MASTER, 6, 1, 0),
626 AC97_SINGLE("Master ZC Switch", AC97_MASTER, 7, 1, 0),
627 AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0),
628 AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0),
635 for (i = 0; i < ARRAY_SIZE(wm9711_snd_ac97_controls); i++) { in patch_wolfson_wm9711_specific()
637 if (err < 0) in patch_wolfson_wm9711_specific()
640 snd_ac97_write_cache(ac97, AC97_CODEC_CLASS_REV, 0x0808); in patch_wolfson_wm9711_specific()
641 snd_ac97_write_cache(ac97, AC97_PCI_SVID, 0x0808); in patch_wolfson_wm9711_specific()
642 snd_ac97_write_cache(ac97, AC97_VIDEO, 0x0808); in patch_wolfson_wm9711_specific()
643 snd_ac97_write_cache(ac97, AC97_AUX, 0x0808); in patch_wolfson_wm9711_specific()
644 snd_ac97_write_cache(ac97, AC97_PC_BEEP, 0x0808); in patch_wolfson_wm9711_specific()
645 snd_ac97_write_cache(ac97, AC97_CD, 0x0000); in patch_wolfson_wm9711_specific()
646 return 0; in patch_wolfson_wm9711_specific()
661 return 0; in patch_wolfson11()
687 AC97_ENUM_DOUBLE(AC97_VIDEO, 3, 0, 8, wm9713_rec_src),
694 AC97_ENUM_SINGLE(AC97_REC_GAIN, 0, 4, wm9713_out4_pga),
701 AC97_DOUBLE("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1),
706 AC97_DOUBLE("PCM Playback Volume", AC97_PHONE, 8, 0, 31, 1),
712 AC97_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1),
715 AC97_SINGLE("Mic Boost (+20dB) Switch", AC97_LINE, 5, 1, 0),
716 AC97_ENUM("Mic to Headphone Mux", wm9713_enum[0]),
717 AC97_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1),
721 AC97_DOUBLE("Capture Volume", AC97_CD, 8, 0, 15, 0),
722 AC97_SINGLE("Capture ZC Switch", AC97_CD, 7, 1, 0),
727 AC97_SINGLE("Capture to Mono Boost (+20dB) Switch", AC97_VIDEO, 8, 1, 0),
728 AC97_SINGLE("Capture ADC Boost (+20dB) Switch", AC97_VIDEO, 6, 1, 0),
731 AC97_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0),
732 AC97_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0),
733 AC97_SINGLE("ALC Decay Time ", AC97_CODEC_CLASS_REV, 4, 15, 0),
734 AC97_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0),
736 AC97_SINGLE("ALC Max Volume", AC97_PCI_SVID, 11, 7, 0),
737 AC97_SINGLE("ALC ZC Timeout", AC97_PCI_SVID, 9, 3, 0),
738 AC97_SINGLE("ALC ZC Switch", AC97_PCI_SVID, 8, 1, 0),
739 AC97_SINGLE("ALC NG Switch", AC97_PCI_SVID, 7, 1, 0),
741 AC97_SINGLE("ALC NG Threshold", AC97_PCI_SVID, 0, 31, 0),
743 AC97_DOUBLE("Master ZC Switch", AC97_MASTER, 14, 6, 1, 0),
744 AC97_DOUBLE("Headphone ZC Switch", AC97_HEADPHONE, 14, 6, 1, 0),
745 AC97_DOUBLE("Out3/4 ZC Switch", AC97_MASTER_MONO, 14, 6, 1, 0),
754 AC97_SINGLE("Mono ZC Switch", AC97_MASTER_TONE, 6, 1, 0),
755 AC97_SINGLE("Mono Volume", AC97_MASTER_TONE, 0, 31, 1),
787 AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_GENERAL_PURPOSE, 6, 1, 0),
789 AC97_SINGLE("Tone Volume", AC97_GENERAL_PURPOSE, 0, 15, 1),
794 AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
795 AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
796 AC97_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1),
803 for (i = 0; i < ARRAY_SIZE(wm13_snd_ac97_controls_3d); i++) { in patch_wolfson_wm9713_3d()
805 if (err < 0) in patch_wolfson_wm9713_3d()
808 return 0; in patch_wolfson_wm9713_3d()
815 for (i = 0; i < ARRAY_SIZE(wm13_snd_ac97_controls); i++) { in patch_wolfson_wm9713_specific()
817 if (err < 0) in patch_wolfson_wm9713_specific()
820 snd_ac97_write_cache(ac97, AC97_PC_BEEP, 0x0808); in patch_wolfson_wm9713_specific()
821 snd_ac97_write_cache(ac97, AC97_PHONE, 0x0808); in patch_wolfson_wm9713_specific()
822 snd_ac97_write_cache(ac97, AC97_MIC, 0x0808); in patch_wolfson_wm9713_specific()
823 snd_ac97_write_cache(ac97, AC97_LINE, 0x00da); in patch_wolfson_wm9713_specific()
824 snd_ac97_write_cache(ac97, AC97_CD, 0x0808); in patch_wolfson_wm9713_specific()
825 snd_ac97_write_cache(ac97, AC97_VIDEO, 0xd612); in patch_wolfson_wm9713_specific()
826 snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x1ba0); in patch_wolfson_wm9713_specific()
827 return 0; in patch_wolfson_wm9713_specific()
833 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff); in patch_wolfson_wm9713_suspend()
834 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff); in patch_wolfson_wm9713_suspend()
839 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); in patch_wolfson_wm9713_resume()
840 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); in patch_wolfson_wm9713_resume()
841 snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0x0); in patch_wolfson_wm9713_resume()
864 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); in patch_wolfson13()
865 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); in patch_wolfson13()
866 snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0x0); in patch_wolfson13()
868 return 0; in patch_wolfson13()
876 snd_ac97_write_cache(ac97, 0x26, 0x0300); in patch_tritech_tr28028()
877 snd_ac97_write_cache(ac97, 0x26, 0x0000); in patch_tritech_tr28028()
878 snd_ac97_write_cache(ac97, AC97_SURROUND_MASTER, 0x0000); in patch_tritech_tr28028()
879 snd_ac97_write_cache(ac97, AC97_SPDIF, 0x0000); in patch_tritech_tr28028()
880 return 0; in patch_tritech_tr28028()
891 err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97)); in patch_sigmatel_stac9700_3d()
892 if (err < 0) in patch_sigmatel_stac9700_3d()
895 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 2, 3, 0); in patch_sigmatel_stac9700_3d()
896 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in patch_sigmatel_stac9700_3d()
897 return 0; in patch_sigmatel_stac9700_3d()
905 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in patch_sigmatel_stac9708_3d()
907 if (err < 0) in patch_sigmatel_stac9708_3d()
910 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 0, 3, 0); in patch_sigmatel_stac9708_3d()
911 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in patch_sigmatel_stac9708_3d()
913 if (err < 0) in patch_sigmatel_stac9708_3d()
916 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 2, 3, 0); in patch_sigmatel_stac9708_3d()
917 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in patch_sigmatel_stac9708_3d()
918 return 0; in patch_sigmatel_stac9708_3d()
923 AC97_SIGMATEL_DAC2INVERT, 2, 1, 0);
928 AC97_SIGMATEL_DAC2INVERT, 3, 1, 0);
931 AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0),
932 AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0)
939 …snd_ac97_write_cache(ac97, AC97_SIGMATEL_ANALOG, snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) & ~0x00… in patch_sigmatel_stac97xx_specific()
941 err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[0], 1); in patch_sigmatel_stac97xx_specific()
942 if (err < 0) in patch_sigmatel_stac97xx_specific()
945 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 0)) { in patch_sigmatel_stac97xx_specific()
947 if (err < 0) in patch_sigmatel_stac97xx_specific()
952 if (err < 0) in patch_sigmatel_stac97xx_specific()
957 if (err < 0) in patch_sigmatel_stac97xx_specific()
960 return 0; in patch_sigmatel_stac97xx_specific()
971 return 0; in patch_sigmatel_stac9700()
980 snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in snd_ac97_stac9708_put_bias()
981 err = snd_ac97_update_bits(ac97, AC97_SIGMATEL_BIAS2, 0x0010, in snd_ac97_stac9708_put_bias()
982 (ucontrol->value.integer.value[0] & 1) << 4); in snd_ac97_stac9708_put_bias()
983 snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0); in snd_ac97_stac9708_put_bias()
994 .private_value = AC97_SINGLE_VALUE(AC97_SIGMATEL_BIAS2, 4, 1, 0),
1006 if (err < 0) in patch_sigmatel_stac9708_specific()
1021 ac97->caps |= 0x10; /* HP (sigmatel surround) support */ in patch_sigmatel_stac9708()
1023 codec72 = snd_ac97_read(ac97, AC97_SIGMATEL_BIAS2) & 0x8000; in patch_sigmatel_stac9708()
1026 if ((codec72==0) && (codec6c==0)) { in patch_sigmatel_stac9708()
1027 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9708()
1028 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x1000); in patch_sigmatel_stac9708()
1029 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9708()
1030 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0007); in patch_sigmatel_stac9708()
1031 } else if ((codec72==0x8000) && (codec6c==0)) { in patch_sigmatel_stac9708()
1032 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9708()
1033 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x1001); in patch_sigmatel_stac9708()
1034 snd_ac97_write_cache(ac97, AC97_SIGMATEL_DAC2INVERT, 0x0008); in patch_sigmatel_stac9708()
1035 } else if ((codec72==0x8000) && (codec6c==0x0080)) { in patch_sigmatel_stac9708()
1038 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9708()
1039 return 0; in patch_sigmatel_stac9708()
1045 if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) { in patch_sigmatel_stac9721()
1047 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9721()
1048 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x4000); in patch_sigmatel_stac9721()
1049 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9721()
1050 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0002); in patch_sigmatel_stac9721()
1052 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9721()
1053 return 0; in patch_sigmatel_stac9721()
1060 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9744()
1061 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */ in patch_sigmatel_stac9744()
1062 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9744()
1063 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0002); in patch_sigmatel_stac9744()
1064 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9744()
1065 return 0; in patch_sigmatel_stac9744()
1072 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9756()
1073 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */ in patch_sigmatel_stac9756()
1074 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9756()
1075 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0002); in patch_sigmatel_stac9756()
1076 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9756()
1077 return 0; in patch_sigmatel_stac9756()
1097 ucontrol->value.enumerated.item[0] = 0; in snd_ac97_stac9758_output_jack_get()
1099 ucontrol->value.enumerated.item[0] = 1 + (val & 3); in snd_ac97_stac9758_output_jack_get()
1100 return 0; in snd_ac97_stac9758_output_jack_get()
1109 if (ucontrol->value.enumerated.item[0] > 4) in snd_ac97_stac9758_output_jack_put()
1111 if (ucontrol->value.enumerated.item[0] == 0) in snd_ac97_stac9758_output_jack_put()
1112 val = 0; in snd_ac97_stac9758_output_jack_put()
1114 val = 4 | (ucontrol->value.enumerated.item[0] - 1); in snd_ac97_stac9758_output_jack_put()
1116 7 << shift, val << shift, 0); in snd_ac97_stac9758_output_jack_put()
1135 ucontrol->value.enumerated.item[0] = (val >> shift) & 7; in snd_ac97_stac9758_input_jack_get()
1136 return 0; in snd_ac97_stac9758_input_jack_get()
1145 ucontrol->value.enumerated.item[0] << shift, 0); in snd_ac97_stac9758_input_jack_put()
1161 ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3; in snd_ac97_stac9758_phonesel_get()
1162 return 0; in snd_ac97_stac9758_phonesel_get()
1170 ucontrol->value.enumerated.item[0], 0); in snd_ac97_stac9758_phonesel_put()
1191 STAC9758_INPUT_JACK("Mic Input Source", 0),
1200 AC97_SINGLE("Exchange Center/LFE", AC97_SIGMATEL_IOMISC, 4, 1, 0),
1201 AC97_SINGLE("Headphone +3dB Boost", AC97_SIGMATEL_IOMISC, 8, 1, 0)
1209 if (err < 0) in patch_sigmatel_stac9758_specific()
1213 if (err < 0) in patch_sigmatel_stac9758_specific()
1223 return 0; in patch_sigmatel_stac9758_specific()
1240 /* OUTSEL */ 0xd794, /* CL:CL, SR:SR, LO:MX, LI:DS, MI:DS */ in patch_sigmatel_stac9758()
1241 /* IOMISC */ 0x2001, in patch_sigmatel_stac9758()
1242 /* INSEL */ 0x0201, /* LI:LI, MI:M1 */ in patch_sigmatel_stac9758()
1243 /* VARIOUS */ 0x0040 in patch_sigmatel_stac9758()
1246 /* OUTSEL */ 0xfc70, /* CL:MX, SR:MX, LO:DS, LI:MX, MI:DS */ in patch_sigmatel_stac9758()
1247 /* IOMISC */ 0x2102, /* HP amp on */ in patch_sigmatel_stac9758()
1248 /* INSEL */ 0x0203, /* LI:LI, MI:FR */ in patch_sigmatel_stac9758()
1249 /* VARIOUS */ 0x0041 /* stereo mic */ in patch_sigmatel_stac9758()
1256 ac97->subsystem_vendor == 0x107b && in patch_sigmatel_stac9758()
1257 ac97->subsystem_device == 0x0601) in patch_sigmatel_stac9758()
1262 /* FIXME: assume only page 0 for writing cache */ in patch_sigmatel_stac9758()
1264 for (i = 0; i < 4; i++) in patch_sigmatel_stac9758()
1268 return 0; in patch_sigmatel_stac9758()
1275 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CSR_SPDIF, 15, 1, 0),
1276 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0)
1284 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); in patch_cirrus_build_spdif()
1285 if (err < 0) in patch_cirrus_build_spdif()
1288 err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[0], 1); in patch_cirrus_build_spdif()
1289 if (err < 0) in patch_cirrus_build_spdif()
1294 if (err < 0) in patch_cirrus_build_spdif()
1300 snd_ac97_write_cache(ac97, AC97_CSR_SPDIF, 0x0a20); in patch_cirrus_build_spdif()
1301 return 0; in patch_cirrus_build_spdif()
1314 - sp/dif control register is 0x68. differs from AC97: in patch_cirrus_spdif()
1318 - sp/dif ssource select is in 0x5e bits 0,1. in patch_cirrus_spdif()
1325 snd_ac97_write_cache(ac97, AC97_CSR_ACMODE, 0x0080); in patch_cirrus_spdif()
1326 return 0; in patch_cirrus_spdif()
1341 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CXR_AUDIO_MISC, 3, 1, 0),
1349 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); in patch_conexant_build_spdif()
1350 if (err < 0) in patch_conexant_build_spdif()
1353 err = patch_build_controls(ac97, &snd_ac97_conexant_controls_spdif[0], 1); in patch_conexant_build_spdif()
1354 if (err < 0) in patch_conexant_build_spdif()
1360 return 0; in patch_conexant_build_spdif()
1373 return 0; in patch_conexant()
1378 snd_ac97_update_bits(ac97, 0x5c, 0x01, 0x01); in patch_cx20551()
1379 return 0; in patch_cx20551()
1393 for (i = 0; i < (int)ARRAY_SIZE(setup_regs); i++) { in ad18xx_resume()
1406 for (codec = 0; codec < 3; codec++) { in ad18xx_resume()
1410 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in ad18xx_resume()
1415 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in ad18xx_resume()
1418 for (i = 2; i < 0x7c ; i += 2) { in ad18xx_resume()
1424 for (codec = 0; codec < 3; codec++) { in ad18xx_resume()
1428 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in ad18xx_resume()
1434 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in ad18xx_resume()
1452 snd_ac97_write_cache(ac97, AC97_CODEC_CLASS_REV, 0x8080); in ad1888_resume()
1458 { AC97_PHONE, 0x9f1f },
1459 { AC97_MIC, 0x9f1f },
1460 { AC97_LINE, 0x9f1f },
1461 { AC97_CD, 0x9f1f },
1462 { AC97_VIDEO, 0x9f1f },
1463 { AC97_AUX, 0x9f1f },
1464 { AC97_PCM, 0x9f1f },
1474 snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x7000); /* select all codecs */ in patch_ad1819()
1476 return 0; in patch_ad1819()
1484 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, mask); in patch_ad1881_unchained()
1485 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); /* ID0C, ID1C, SDIE = off */ in patch_ad1881_unchained()
1487 if ((val & 0xff40) != 0x5340) in patch_ad1881_unchained()
1488 return 0; in patch_ad1881_unchained()
1491 ac97->spec.ad18xx.codec_cfg[idx] = 0x0000; in patch_ad1881_unchained()
1500 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, cfg_bits[idx]); in patch_ad1881_chained1()
1501 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); // SDIE in patch_ad1881_chained1()
1503 if ((val & 0xff40) != 0x5340) in patch_ad1881_chained1()
1504 return 0; in patch_ad1881_chained1()
1509 ac97->spec.ad18xx.codec_cfg[idx] = codec_bits ? codec_bits : 0x0004; in patch_ad1881_chained1()
1520 if (cidx1 < 0 && cidx2 < 0) in patch_ad1881_chained()
1523 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in patch_ad1881_chained()
1525 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); // ID1C in patch_ad1881_chained()
1526 ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002; in patch_ad1881_chained()
1527 if (cidx1 >= 0) { in patch_ad1881_chained()
1528 if (cidx2 < 0) in patch_ad1881_chained()
1529 patch_ad1881_chained1(ac97, cidx1, 0); in patch_ad1881_chained()
1530 else if (patch_ad1881_chained1(ac97, cidx1, 0x0006)) // SDIE | ID1C in patch_ad1881_chained()
1531 patch_ad1881_chained1(ac97, cidx2, 0); in patch_ad1881_chained()
1532 else if (patch_ad1881_chained1(ac97, cidx2, 0x0006)) // SDIE | ID1C in patch_ad1881_chained()
1533 patch_ad1881_chained1(ac97, cidx1, 0); in patch_ad1881_chained()
1534 } else if (cidx2 >= 0) { in patch_ad1881_chained()
1535 patch_ad1881_chained1(ac97, cidx2, 0); in patch_ad1881_chained()
1549 {0, 2}, in patch_ad1881()
1550 {0, 1} in patch_ad1881()
1560 codecs[0] = patch_ad1881_unchained(ac97, 0, (1<<12)); in patch_ad1881()
1564 if (! (codecs[0] || codecs[1] || codecs[2])) in patch_ad1881()
1567 for (idx = 0; idx < 3; idx++) in patch_ad1881()
1569 patch_ad1881_chained(ac97, idx, cfg_idxs[idx][0], cfg_idxs[idx][1]); in patch_ad1881()
1582 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in patch_ad1881()
1584 for (idx = num = 0; idx < 3; idx++) in patch_ad1881()
1589 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); in patch_ad1881()
1590 ac97->spec.ad18xx.codec_cfg[0] = in patch_ad1881()
1592 ac97->spec.ad18xx.codec_cfg[2] = 0x0000; in patch_ad1881()
1596 if (ac97->spec.ad18xx.id[0]) { in patch_ad1881()
1597 ac97->id &= 0xffff0000; in patch_ad1881()
1598 ac97->id |= ac97->spec.ad18xx.id[0]; in patch_ad1881()
1601 return 0; in patch_ad1881()
1605 AC97_SINGLE("Digital Mono Direct", AC97_AD_MISC, 11, 1, 0),
1606 /* AC97_SINGLE("Digital Audio Mode", AC97_AD_MISC, 12, 1, 0), */ /* seems problematic */
1607 AC97_SINGLE("Low Power Mixer", AC97_AD_MISC, 14, 1, 0),
1608 AC97_SINGLE("Zero Fill DAC", AC97_AD_MISC, 15, 1, 0),
1613 static const DECLARE_TLV_DB_SCALE(db_scale_6bit_6db_max, -8850, 150, 0);
1620 if (err < 0) in patch_ad1885_specific()
1624 return 0; in patch_ad1885_specific()
1641 snd_ac97_write_cache(ac97, AC97_AD_MISC, 0x0404); in patch_ad1885()
1644 return 0; in patch_ad1885()
1651 return 0; in patch_ad1886_specific()
1666 snd_ac97_write_cache(ac97, AC97_AD_JACK_SPDIF, 0x0010); in patch_ad1886()
1668 return 0; in patch_ad1886()
1671 /* MISC bits (AD1888/AD1980/AD1985 register 0x76) */
1672 #define AC97_AD198X_MBC 0x0003 /* mic boost */
1673 #define AC97_AD198X_MBC_20 0x0000 /* +20dB */
1674 #define AC97_AD198X_MBC_10 0x0001 /* +10dB */
1675 #define AC97_AD198X_MBC_30 0x0002 /* +30dB */
1676 #define AC97_AD198X_VREFD 0x0004 /* VREF high-Z */
1677 #define AC97_AD198X_VREFH 0x0008 /* 0=2.25V, 1=3.7V */
1678 #define AC97_AD198X_VREF_0 0x000c /* 0V (AD1985 only) */
1681 #define AC97_AD198X_SRU 0x0010 /* sample rate unlock */
1682 #define AC97_AD198X_LOSEL 0x0020 /* LINE_OUT amplifiers input select */
1683 #define AC97_AD198X_2MIC 0x0040 /* 2-channel mic select */
1684 #define AC97_AD198X_SPRD 0x0080 /* SPREAD enable */
1685 #define AC97_AD198X_DMIX0 0x0100 /* downmix mode: */
1686 /* 0 = 6-to-4, 1 = 6-to-2 downmix */
1687 #define AC97_AD198X_DMIX1 0x0200 /* downmix mode: 1 = enabled */
1688 #define AC97_AD198X_HPSEL 0x0400 /* headphone amplifier input select */
1689 #define AC97_AD198X_CLDIS 0x0800 /* center/lfe disable */
1690 #define AC97_AD198X_LODIS 0x1000 /* LINE_OUT disable */
1691 #define AC97_AD198X_MSPLT 0x2000 /* mute split */
1692 #define AC97_AD198X_AC97NC 0x4000 /* AC97 no compatible mode */
1693 #define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */
1695 /* MISC 1 bits (AD1986 register 0x76) */
1696 #define AC97_AD1986_MBC 0x0003 /* mic boost */
1697 #define AC97_AD1986_MBC_20 0x0000 /* +20dB */
1698 #define AC97_AD1986_MBC_10 0x0001 /* +10dB */
1699 #define AC97_AD1986_MBC_30 0x0002 /* +30dB */
1700 #define AC97_AD1986_LISEL0 0x0004 /* LINE_IN select bit 0 */
1701 #define AC97_AD1986_LISEL1 0x0008 /* LINE_IN select bit 1 */
1703 #define AC97_AD1986_LISEL_LI 0x0000 /* LINE_IN pins as LINE_IN source */
1704 #define AC97_AD1986_LISEL_SURR 0x0004 /* SURROUND pins as LINE_IN source */
1705 #define AC97_AD1986_LISEL_MIC 0x0008 /* MIC_1/2 pins as LINE_IN source */
1706 #define AC97_AD1986_SRU 0x0010 /* sample rate unlock */
1707 #define AC97_AD1986_SOSEL 0x0020 /* SURROUND_OUT amplifiers input sel */
1708 #define AC97_AD1986_2MIC 0x0040 /* 2-channel mic select */
1709 #define AC97_AD1986_SPRD 0x0080 /* SPREAD enable */
1710 #define AC97_AD1986_DMIX0 0x0100 /* downmix mode: */
1711 /* 0 = 6-to-4, 1 = 6-to-2 downmix */
1712 #define AC97_AD1986_DMIX1 0x0200 /* downmix mode: 1 = enabled */
1713 #define AC97_AD1986_CLDIS 0x0800 /* center/lfe disable */
1714 #define AC97_AD1986_SODIS 0x1000 /* SURROUND_OUT disable */
1715 #define AC97_AD1986_MSPLT 0x2000 /* mute split (read only 1) */
1716 #define AC97_AD1986_AC97NC 0x4000 /* AC97 no compatible mode (r/o 1) */
1717 #define AC97_AD1986_DACZ 0x8000 /* DAC zero-fill mode */
1719 /* MISC 2 bits (AD1986 register 0x70) */
1720 #define AC97_AD_MISC2 0x70 /* Misc Control Bits 2 (AD1986) */
1722 #define AC97_AD1986_CVREF0 0x0004 /* C/LFE VREF_OUT 2.25V */
1723 #define AC97_AD1986_CVREF1 0x0008 /* C/LFE VREF_OUT 0V */
1724 #define AC97_AD1986_CVREF2 0x0010 /* C/LFE VREF_OUT 3.7V */
1727 #define AC97_AD1986_JSMAP 0x0020 /* Jack Sense Mapping 1 = alternate */
1728 #define AC97_AD1986_MMDIS 0x0080 /* Mono Mute Disable */
1729 #define AC97_AD1986_MVREF0 0x0400 /* MIC VREF_OUT 2.25V */
1730 #define AC97_AD1986_MVREF1 0x0800 /* MIC VREF_OUT 0V */
1731 #define AC97_AD1986_MVREF2 0x1000 /* MIC VREF_OUT 3.7V */
1735 /* MISC 3 bits (AD1986 register 0x7a) */
1736 #define AC97_AD_MISC3 0x7a /* Misc Control Bits 3 (AD1986) */
1738 #define AC97_AD1986_MMIX 0x0004 /* Mic Mix, left/right */
1739 #define AC97_AD1986_GPO 0x0008 /* General Purpose Out */
1740 #define AC97_AD1986_LOHPEN 0x0010 /* LINE_OUT headphone drive */
1741 #define AC97_AD1986_LVREF0 0x0100 /* LINE_OUT VREF_OUT 2.25V */
1742 #define AC97_AD1986_LVREF1 0x0200 /* LINE_OUT VREF_OUT 0V */
1743 #define AC97_AD1986_LVREF2 0x0400 /* LINE_OUT VREF_OUT 3.7V */
1746 #define AC97_AD1986_JSINVA 0x0800 /* Jack Sense Invert SENSE_A */
1747 #define AC97_AD1986_LOSEL 0x1000 /* LINE_OUT amplifiers input select */
1748 #define AC97_AD1986_HPSEL0 0x2000 /* Headphone amplifiers */
1750 #define AC97_AD1986_HPSEL1 0x4000 /* Headphone amplifiers input */
1752 #define AC97_AD1986_JSINVB 0x8000 /* Jack Sense Invert SENSE_B */
1754 /* Serial Config bits (AD1986 register 0x74) (incomplete) */
1755 #define AC97_AD1986_OMS0 0x0100 /* Optional Mic Selector bit 0 */
1756 #define AC97_AD1986_OMS1 0x0200 /* Optional Mic Selector bit 1 */
1757 #define AC97_AD1986_OMS2 0x0400 /* Optional Mic Selector bit 2 */
1760 #define AC97_AD1986_OMS_M 0x0000 /* MIC_1/2 pins are MIC sources */
1761 #define AC97_AD1986_OMS_L 0x0100 /* LINE_IN pins are MIC sources */
1762 #define AC97_AD1986_OMS_C 0x0200 /* Center/LFE pins are MCI sources */
1763 #define AC97_AD1986_OMS_MC 0x0400 /* Mix of MIC and C/LFE pins */
1765 #define AC97_AD1986_OMS_ML 0x0500 /* MIX of MIC and LINE_IN pins */
1767 #define AC97_AD1986_OMS_LC 0x0600 /* MIX of LINE_IN and C/LFE pins */
1769 #define AC97_AD1986_OMS_MLC 0x0700 /* MIX of MIC, LINE_IN, C/LFE pins */
1786 ucontrol->value.enumerated.item[0] = (val >> 2) & 1; in snd_ac97_ad198x_spdif_source_get()
1787 return 0; in snd_ac97_ad198x_spdif_source_get()
1795 if (ucontrol->value.enumerated.item[0] > 1) in snd_ac97_ad198x_spdif_source_put()
1797 val = ucontrol->value.enumerated.item[0] << 2; in snd_ac97_ad198x_spdif_source_put()
1798 return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val); in snd_ac97_ad198x_spdif_source_put()
1815 AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 11, 1, 0),
1816 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0),
1823 0x10140523, /* Thinkpad R40 */
1824 0x10140534, /* Thinkpad X31 */
1825 0x10140537, /* Thinkpad T41p */
1826 0x1014053e, /* Thinkpad R40e */
1827 0x10140554, /* Thinkpad T42p/R50p */
1828 0x10140567, /* Thinkpad T43p 2668-G7U */
1829 0x10140581, /* Thinkpad X41-2527 */
1830 0x10280160, /* Dell Dimension 2400 */
1831 0x104380b0, /* Asus A7V8X-MX */
1832 0x11790241, /* Toshiba Satellite A-15 S127 */
1833 0x1179ff10, /* Toshiba P500 */
1834 0x144dc01a, /* Samsung NP-X20C004/SEG */
1835 0 /* end */
1844 return 0; in check_list()
1850 return 0; in patch_ad1981a_specific()
1867 0x0e11005a, /* HP nc4000/4010 */
1868 0x103c0890, /* HP nc6000 */
1869 0x103c0938, /* HP nc4220 */
1870 0x103c099c, /* HP nx6110 */
1871 0x103c0944, /* HP nc6220 */
1872 0x103c0934, /* HP nc8220 */
1873 0x103c006d, /* HP nx9105 */
1874 0x103c300d, /* HP Compaq dc5100 SFF(PT003AW) */
1875 0x17340088, /* FSC Scenic-W */
1876 0 /* end */
1893 return 0; in patch_ad1981a()
1897 AC97_SINGLE("Stereo Mic", AC97_AD_MISC, 6, 1, 0);
1904 if (err < 0) in patch_ad1981b_specific()
1907 return 0; in patch_ad1981b_specific()
1927 return 0; in patch_ad1981b()
1938 ucontrol->value.integer.value[0] = !(val & AC97_AD198X_LOSEL); in snd_ac97_ad1888_lohpsel_get()
1940 ucontrol->value.integer.value[0] = in snd_ac97_ad1888_lohpsel_get()
1941 !ucontrol->value.integer.value[0]; in snd_ac97_ad1888_lohpsel_get()
1942 return 0; in snd_ac97_ad1888_lohpsel_get()
1950 val = !ucontrol->value.integer.value[0]; in snd_ac97_ad1888_lohpsel_put()
1953 val = val ? (AC97_AD198X_LOSEL | AC97_AD198X_HPSEL) : 0; in snd_ac97_ad1888_lohpsel_put()
1972 ucontrol->value.enumerated.item[0] = 0; in snd_ac97_ad1888_downmix_get()
1974 ucontrol->value.enumerated.item[0] = 1 + ((val >> 8) & 1); in snd_ac97_ad1888_downmix_get()
1975 return 0; in snd_ac97_ad1888_downmix_get()
1983 if (ucontrol->value.enumerated.item[0] > 2) in snd_ac97_ad1888_downmix_put()
1985 if (ucontrol->value.enumerated.item[0] == 0) in snd_ac97_ad1888_downmix_put()
1986 val = 0; in snd_ac97_ad1888_downmix_put()
1989 ((ucontrol->value.enumerated.item[0] - 1) << 8); in snd_ac97_ad1888_downmix_put()
1996 unsigned short val = 0; in ad1888_update_jacks()
2018 AC97_SINGLE("Spread Front to Surround and Center/LFE", AC97_AD_MISC, 7, 1, 0),
2029 AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 10, 1, 0),
2030 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0),
2036 /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ in patch_ad1888_specific()
2065 if (ac97->subsystem_vendor == 0x1043 && in patch_ad1888()
2066 ac97->subsystem_device == 0x1193) /* ASUS A9T laptop */ in patch_ad1888()
2082 return 0; in patch_ad1888()
2090 if (err < 0) in patch_ad1980_specific()
2108 return 0; in patch_ad1980()
2115 "High-Z", "3.7 V", "2.25 V", "0 V" in snd_ac97_ad1985_vrefout_info()
2124 static const int reg2ctrl[4] = {2, 0, 1, 3}; in snd_ac97_ad1985_vrefout_get()
2129 ucontrol->value.enumerated.item[0] = reg2ctrl[val]; in snd_ac97_ad1985_vrefout_get()
2130 return 0; in snd_ac97_ad1985_vrefout_get()
2136 static const int ctrl2reg[4] = {1, 2, 0, 3}; in snd_ac97_ad1985_vrefout_put()
2140 if (ucontrol->value.enumerated.item[0] > 3) in snd_ac97_ad1985_vrefout_put()
2142 val = ctrl2reg[ucontrol->value.enumerated.item[0]] in snd_ac97_ad1985_vrefout_put()
2149 AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0),
2159 AC97_AD_MISC, 7, 1, 0),
2177 AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 10, 1, 0),
2178 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0),
2186 is_shared_micin(ac97) ? 1 << 9 : 0); in ad1985_update_jacks()
2193 /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ in patch_ad1985_specific()
2199 if (err < 0) in patch_ad1985_specific()
2237 return 0; in patch_ad1985()
2249 ucontrol->value.integer.value[0] = (val & AC97_AD1986_LOSEL) != 0; in snd_ac97_ad1986_lososel_get()
2250 return 0; in snd_ac97_ad1986_lososel_get()
2259 int sprd = (ac97->regs[AC97_AD_MISC] & AC97_AD1986_SPRD) != 0; in snd_ac97_ad1986_lososel_put()
2262 ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_lososel_put()
2263 ? AC97_AD1986_LOSEL : 0); in snd_ac97_ad1986_lososel_put()
2264 if (ret0 < 0) in snd_ac97_ad1986_lososel_put()
2269 (ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_lososel_put()
2271 ? AC97_AD1986_SOSEL : 0); in snd_ac97_ad1986_lososel_put()
2272 if (ret1 < 0) in snd_ac97_ad1986_lososel_put()
2275 return (ret0 > 0 || ret1 > 0) ? 1 : 0; in snd_ac97_ad1986_lososel_put()
2285 ucontrol->value.integer.value[0] = (val & AC97_AD1986_SPRD) != 0; in snd_ac97_ad1986_spread_get()
2286 return 0; in snd_ac97_ad1986_spread_get()
2295 int sprd = (ac97->regs[AC97_AD_MISC3] & AC97_AD1986_LOSEL) != 0; in snd_ac97_ad1986_spread_put()
2298 ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_spread_put()
2299 ? AC97_AD1986_SPRD : 0); in snd_ac97_ad1986_spread_put()
2300 if (ret0 < 0) in snd_ac97_ad1986_spread_put()
2305 (ucontrol->value.integer.value[0] != 0 in snd_ac97_ad1986_spread_put()
2307 ? AC97_AD1986_SOSEL : 0); in snd_ac97_ad1986_spread_put()
2308 if (ret1 < 0) in snd_ac97_ad1986_spread_put()
2311 return (ret0 > 0 || ret1 > 0) ? 1 : 0; in snd_ac97_ad1986_spread_put()
2319 ucontrol->value.integer.value[0] = ac97->spec.ad18xx.swap_mic_linein; in snd_ac97_ad1986_miclisel_get()
2320 return 0; in snd_ac97_ad1986_miclisel_get()
2327 unsigned char swap = ucontrol->value.integer.value[0] != 0; in snd_ac97_ad1986_miclisel_put()
2335 return 0; in snd_ac97_ad1986_miclisel_put()
2345 if ((reg & AC97_AD1986_MVREF0) != 0) in snd_ac97_ad1986_vrefout_get()
2347 else if ((reg & AC97_AD1986_MVREF1) != 0) in snd_ac97_ad1986_vrefout_get()
2349 else if ((reg & AC97_AD1986_MVREF2) != 0) in snd_ac97_ad1986_vrefout_get()
2352 val = 0; in snd_ac97_ad1986_vrefout_get()
2353 ucontrol->value.enumerated.item[0] = val; in snd_ac97_ad1986_vrefout_get()
2354 return 0; in snd_ac97_ad1986_vrefout_get()
2368 switch (ucontrol->value.enumerated.item[0]) in snd_ac97_ad1986_vrefout_put()
2370 case 0: /* High-Z */ in snd_ac97_ad1986_vrefout_put()
2371 cval = 0; in snd_ac97_ad1986_vrefout_put()
2372 lval = 0; in snd_ac97_ad1986_vrefout_put()
2373 mval = 0; in snd_ac97_ad1986_vrefout_put()
2385 case 3: /* 0 V */ in snd_ac97_ad1986_vrefout_put()
2396 if (cret < 0) in snd_ac97_ad1986_vrefout_put()
2400 if (lret < 0) in snd_ac97_ad1986_vrefout_put()
2404 if (mret < 0) in snd_ac97_ad1986_vrefout_put()
2407 return (cret > 0 || lret > 0 || mret > 0) ? 1 : 0; in snd_ac97_ad1986_vrefout_put()
2411 AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0),
2450 AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 10, 1, 0),
2451 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0)
2456 unsigned short misc_val = 0; in ad1986_update_jacks()
2468 else if (ac97->spec.ad18xx.swap_mic_linein != 0) in ad1986_update_jacks()
2478 else if (ac97->spec.ad18xx.swap_mic_linein != 0) in ad1986_update_jacks()
2492 if (err < 0) in patch_ad1986_specific()
2517 return 0; in patch_ad1986()
2525 snd_ac97_update_bits(ac97, 0x7a, 0x400, 0x400); in patch_alc203()
2526 return 0; in patch_alc203()
2539 shared ? (1 << 9) : 0); in alc650_update_jacks()
2544 shared ? (1 << 12) : 0); in alc650_update_jacks()
2547 shared ? (1 << 10) : 0); in alc650_update_jacks()
2549 snd_ac97_update_bits(ac97, AC97_ALC650_GPIO_STATUS, 0x100, in alc650_update_jacks()
2550 shared ? 0 : 0x100); in alc650_update_jacks()
2560 if (ucontrol->value.integer.value[0]) in alc650_swap_surround_put()
2569 AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0),
2570 AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0),
2571 AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0),
2572 AC97_SINGLE("Exchange Center/LFE", AC97_ALC650_MULTICH, 3, 1, 0),
2587 .private_value = AC97_SINGLE_VALUE(AC97_ALC650_MULTICH, 14, 1, 0),
2589 #if 0 /* always set in patch_alc650 */
2590 AC97_SINGLE("IEC958 Input Clock Enable", AC97_ALC650_CLOCK, 0, 1, 0),
2591 AC97_SINGLE("IEC958 Input Pin Enable", AC97_ALC650_CLOCK, 1, 1, 0),
2593 AC97_DOUBLE("Surround DAC Volume", AC97_ALC650_SURR_DAC_VOL, 8, 0, 31, 1),
2595 AC97_DOUBLE("Center/LFE DAC Volume", AC97_ALC650_LFE_DAC_VOL, 8, 0, 31, 1),
2602 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0),
2603 AC97_SINGLE("Analog to IEC958 Output", AC97_ALC650_MULTICH, 12, 1, 0),
2605 /* AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 13, 1, 0), */
2608 static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_max, -4350, 150, 0);
2615 if (err < 0) in patch_alc650_specific()
2619 if (err < 0) in patch_alc650_specific()
2625 return 0; in patch_alc650_specific()
2640 val = snd_ac97_read(ac97, AC97_ALC650_REVISION) & 0x3f; in patch_alc650()
2642 ac97->id = 0x414c4720; /* Old version */ in patch_alc650()
2643 else if (val < 0x10) in patch_alc650()
2644 ac97->id = 0x414c4721; /* D version */ in patch_alc650()
2645 else if (val < 0x20) in patch_alc650()
2646 ac97->id = 0x414c4722; /* E version */ in patch_alc650()
2647 else if (val < 0x30) in patch_alc650()
2648 ac97->id = 0x414c4723; /* F version */ in patch_alc650()
2652 ac97->spec.dev_flags = (ac97->id == 0x414c4722 || in patch_alc650()
2653 ac97->id == 0x414c4723); in patch_alc650()
2657 snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x8000); in patch_alc650()
2664 ! (ac97->subsystem_vendor == 0x1043 && in patch_alc650()
2665 ac97->subsystem_device == 0x1103)) in patch_alc650()
2666 val |= 0x03; /* enable */ in patch_alc650()
2668 val &= ~0x03; /* disable */ in patch_alc650()
2676 snd_ac97_write_cache(ac97, AC97_ALC650_MULTICH, 0); in patch_alc650()
2681 snd_ac97_read(ac97, AC97_ALC650_GPIO_SETUP) | 0x01); in patch_alc650()
2683 (snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x100) & ~0x10); in patch_alc650()
2686 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808); in patch_alc650()
2687 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808); in patch_alc650()
2688 return 0; in patch_alc650()
2698 shared ? (1 << 9) : 0, 0); in alc655_update_jacks()
2703 shared ? (1 << 12) : 0); in alc655_update_jacks()
2705 shared ? (1 << 10) : 0, 0); in alc655_update_jacks()
2709 AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0),
2738 val = 0; in alc655_iec958_route_get()
2739 ucontrol->value.enumerated.item[0] = val; in alc655_iec958_route_get()
2740 return 0; in alc655_iec958_route_get()
2748 (unsigned short)ucontrol->value.enumerated.item[0] << 12, in alc655_iec958_route_put()
2749 0); in alc655_iec958_route_put()
2753 … AC97_PAGE_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0, 0),
2755 /* AC97_PAGE_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 14, 1, 0, 0), */
2770 if (err < 0) in patch_alc655_specific()
2774 if (err < 0) in patch_alc655_specific()
2777 return 0; in patch_alc655_specific()
2791 if ((snd_ac97_read(ac97, AC97_ALC650_REVISION) & 0x3f) == 2) { in patch_alc655()
2799 /* assume only page 0 for writing cache */ in patch_alc655()
2803 val = snd_ac97_read(ac97, 0x7a); /* misc control */ in patch_alc655()
2807 if (ac97->subsystem_vendor == 0x1462 && in patch_alc655()
2808 (ac97->subsystem_device == 0x0131 || /* MSI S270 laptop */ in patch_alc655()
2809 ac97->subsystem_device == 0x0161 || /* LG K1 Express */ in patch_alc655()
2810 ac97->subsystem_device == 0x0351 || /* MSI L725 laptop */ in patch_alc655()
2811 ac97->subsystem_device == 0x0471 || /* MSI L720 laptop */ in patch_alc655()
2812 ac97->subsystem_device == 0x0061)) /* MSI S250 laptop */ in patch_alc655()
2820 snd_ac97_write_cache(ac97, 0x7a, val); in patch_alc655()
2829 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808); in patch_alc655()
2830 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808); in patch_alc655()
2834 snd_ac97_update_bits(ac97, 0x74, 0x0800, 0x0800); in patch_alc655()
2836 return 0; in patch_alc655()
2840 #define AC97_ALC850_JACK_SELECT 0x76
2841 #define AC97_ALC850_MISC1 0x7a
2842 #define AC97_ALC850_MULTICH 0x6a
2854 /* LINE-IN = 0, SURROUND = 2 */ in alc850_update_jacks()
2856 shared ? (2<<12) : (0<<12)); in alc850_update_jacks()
2869 aux_is_back_surround ? (1<<10) : (0<<10)); in alc850_update_jacks()
2873 AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0),
2884 if (err < 0) in patch_alc850_specific()
2888 if (err < 0) in patch_alc850_specific()
2891 return 0; in patch_alc850_specific()
2903 ac97->spec.dev_flags = 0; /* for IEC958 playback route - ALC655 compatible */ in patch_alc850()
2906 /* assume only page 0 for writing cache */ in patch_alc850()
2914 NB default bit 10=0 = Aux is Capture, not Back Surround in patch_alc850()
2920 snd_ac97_write_cache(ac97, 0x7a, (1<<1)|(1<<4)|(0<<5)|(1<<6)| in patch_alc850()
2921 (1<<7)|(0<<12)|(1<<13)|(0<<14)); in patch_alc850()
2925 snd_ac97_write_cache(ac97, 0x76, (0<<0)|(0<<2)|(1<<4)|(1<<7)|(2<<8)| in patch_alc850()
2926 (1<<11)|(0<<12)|(1<<15)); in patch_alc850()
2929 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808); in patch_alc850()
2930 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808); in patch_alc850()
2931 return 0; in patch_alc850()
2947 AC97_SINGLE_VALUE(AC97_3D_CONTROL, 1, 0x07, 0); in patch_aztech_azf3328_specific()
2954 AC97_SINGLE_VALUE(AC97_3D_CONTROL, 8, 0x03, 0); in patch_aztech_azf3328_specific()
2965 return 0; in patch_aztech_azf3328_specific()
2975 return 0; in patch_aztech_azf3328()
2985 is_shared_surrout(ac97) ? (1 << 10) : 0); in cm9738_update_jacks()
2989 AC97_SINGLE("Duplicate Front", AC97_CM9738_VENDOR_CTRL, 13, 1, 0),
3010 snd_ac97_write_cache(ac97, AC97_PCM, 0x8000); in patch_cm9738()
3012 return 0; in patch_cm9738()
3028 ucontrol->value.enumerated.item[0] = (val >> 1) & 0x01; in snd_ac97_cmedia_spdif_playback_source_get()
3029 return 0; in snd_ac97_cmedia_spdif_playback_source_get()
3037 0x01 << 1, in snd_ac97_cmedia_spdif_playback_source_put()
3038 (ucontrol->value.enumerated.item[0] & 0x01) << 1); in snd_ac97_cmedia_spdif_playback_source_put()
3042 /* BIT 0: SPDI_EN - always true */
3051 …AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Valid Switch", AC97_CM9739_SPDIF_CTRL, 2, 1, 0…
3053 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Monitor", AC97_CM9739_SPDIF_CTRL, 3, 1, 0),
3055 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_CM9739_SPDIF_CTRL, 4, 1, 0),
3063 is_shared_surrout(ac97) ? (1 << 10) : 0); in cm9739_update_jacks()
3065 snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 0x3000, in cm9739_update_jacks()
3066 is_shared_clfeout(ac97) ? 0x1000 : 0x2000); in cm9739_update_jacks()
3098 snd_ac97_write_cache(ac97, AC97_MASTER, 0x8000); in patch_cm9739()
3099 snd_ac97_write_cache(ac97, AC97_PCM, 0x8000); in patch_cm9739()
3106 snd_ac97_read(ac97, AC97_CM9739_SPDIF_CTRL) | 0x01); in patch_cm9739()
3110 ac97->rates[AC97_RATES_SPDIF] = 0; in patch_cm9739()
3114 /* bit 14: 0 = SPDIF, 1 = EAPD */ in patch_cm9739()
3119 /* bit 4: undocumented; 0 mutes the CM9739A, which defaults to 1 */ in patch_cm9739()
3121 /* bit 0: dB */ in patch_cm9739()
3130 snd_ac97_write_cache(ac97, 0x70, 0x0100); in patch_cm9739()
3131 snd_ac97_write_cache(ac97, 0x72, 0x0020); in patch_cm9739()
3134 ac97->subsystem_vendor == 0x1043 && in patch_cm9739()
3135 ac97->subsystem_device == 0x1843) { in patch_cm9739()
3137 snd_ac97_read(ac97, AC97_CM9739_SPDIF_CTRL) & ~0x01); in patch_cm9739()
3142 return 0; in patch_cm9739()
3145 #define AC97_CM9761_MULTI_CHAN 0x64
3146 #define AC97_CM9761_FUNC 0x66
3147 #define AC97_CM9761_SPDIF_CTRL 0x6c
3155 { 0x0008, 0x0000 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3156 { 0x0000, 0x0008 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3157 { 0x0000, 0x0008 }, /* 9761-83 */ in cm9761_update_jacks()
3160 { 0x0000, 0x1000 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3161 { 0x1000, 0x0000 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3162 { 0x0000, 0x1000 }, /* 9761-83 */ in cm9761_update_jacks()
3165 { 0x0000, 0x0400 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3166 { 0x0000, 0x0400 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3167 { 0x0000, 0x0400 }, /* 9761-83 */ in cm9761_update_jacks()
3170 { 0x2000, 0x0880 }, /* 9761-78 & 82 */ in cm9761_update_jacks()
3171 { 0x0000, 0x2880 }, /* 9761-82 rev.B */ in cm9761_update_jacks()
3172 { 0x2000, 0x0800 }, /* 9761-83 */ in cm9761_update_jacks()
3174 unsigned short val = 0; in cm9761_update_jacks()
3181 snd_ac97_update_bits(ac97, AC97_CM9761_MULTI_CHAN, 0x3c88, val); in cm9761_update_jacks()
3200 if (ac97->regs[AC97_CM9761_FUNC] & 0x1) in cm9761_spdif_out_source_get()
3201 ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */ in cm9761_spdif_out_source_get()
3202 else if (ac97->regs[AC97_CM9761_SPDIF_CTRL] & 0x2) in cm9761_spdif_out_source_get()
3203 ucontrol->value.enumerated.item[0] = 1; /* ADC loopback */ in cm9761_spdif_out_source_get()
3205 ucontrol->value.enumerated.item[0] = 0; /* AC-link */ in cm9761_spdif_out_source_get()
3206 return 0; in cm9761_spdif_out_source_get()
3213 if (ucontrol->value.enumerated.item[0] == 2) in cm9761_spdif_out_source_put()
3214 return snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0x1); in cm9761_spdif_out_source_put()
3215 snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0); in cm9761_spdif_out_source_put()
3216 return snd_ac97_update_bits(ac97, AC97_CM9761_SPDIF_CTRL, 0x2, in cm9761_spdif_out_source_put()
3217 ucontrol->value.enumerated.item[0] == 1 ? 0x2 : 0); in cm9761_spdif_out_source_put()
3235 …AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Valid Switch", AC97_CM9761_SPDIF_CTRL, 2, 1, 0…
3237 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Monitor", AC97_CM9761_SPDIF_CTRL, 3, 1, 0),
3239 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_CM9761_SPDIF_CTRL, 4, 1, 0),
3269 snd_ac97_write_cache(ac97, AC97_MASTER, 0x8808); in patch_cm9761()
3270 snd_ac97_write_cache(ac97, AC97_PCM, 0x8808); in patch_cm9761()
3272 ac97->spec.dev_flags = 0; /* 1 = model 82 revision B, 2 = model 83 */ in patch_cm9761()
3275 /* check page 1, reg 0x60 */ in patch_cm9761()
3277 snd_ac97_write_cache(ac97, AC97_INT_PAGING, (val & ~0x0f) | 0x01); in patch_cm9761()
3278 tmp = snd_ac97_read(ac97, 0x60); in patch_cm9761()
3290 snd_ac97_write_cache(ac97, AC97_EXTENDED_STATUS, 0x05c0); in patch_cm9761()
3291 /* Don't set 0x0200 here. This results in the silent analog output */ in patch_cm9761()
3292 snd_ac97_write_cache(ac97, AC97_CM9761_SPDIF_CTRL, 0x0001); /* enable spdif-in */ in patch_cm9761()
3310 * bit 0: mic boost level (0=20dB, 1=30dB) in patch_cm9761()
3313 #if 0 in patch_cm9761()
3315 val = 0x0214; in patch_cm9761()
3317 val = 0x321c; in patch_cm9761()
3324 snd_ac97_write_cache(ac97, 0x70, 0x0100); in patch_cm9761()
3325 snd_ac97_write_cache(ac97, 0x72, 0x0020); in patch_cm9761()
3327 return 0; in patch_cm9761()
3330 #define AC97_CM9780_SIDE 0x60
3331 #define AC97_CM9780_JACK 0x62
3332 #define AC97_CM9780_MIXER 0x64
3333 #define AC97_CM9780_MULTI_CHAN 0x66
3334 #define AC97_CM9780_SPDIF 0x6c
3343 AC97_DOUBLE("Side Playback Volume", AC97_CM9780_SIDE, 8, 0, 31, 0),
3367 val |= 0x1; /* SPDI_EN */ in patch_cm9780()
3371 return 0; in patch_cm9780()
3378 AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0),
3383 return patch_build_controls(ac97, &snd_ac97_controls_vt1613[0], in patch_vt1613_specific()
3398 return 0; in patch_vt1613()
3405 AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0),
3406 AC97_SINGLE("Alternate Level to Surround Out", 0x5a, 15, 1, 0),
3407 AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0),
3408 AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0),
3446 if (err < 0) in snd_ac97_add_vmaster()
3457 if (snd_ac97_try_bit(ac97, 0x5a, 9)) { in patch_vt1616_specific()
3458 err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[0], 1); in patch_vt1616_specific()
3459 if (err < 0) in patch_vt1616_specific()
3463 if (err < 0) in patch_vt1616_specific()
3475 if (err < 0) in patch_vt1616_specific()
3480 if (err < 0) in patch_vt1616_specific()
3483 return 0; in patch_vt1616_specific()
3493 return 0; in patch_vt1616()
3539 usSM51 = snd_ac97_read(pac97, 0x7a) >> 14; in snd_ac97_vt1617a_smart51_get()
3540 usMS = snd_ac97_read(pac97, 0x20) >> 8; in snd_ac97_vt1617a_smart51_get()
3542 ucontrol->value.enumerated.item[0] = (usSM51 << 1) + usMS; in snd_ac97_vt1617a_smart51_get()
3544 return 0; in snd_ac97_vt1617a_smart51_get()
3556 usSM51 = ucontrol->value.enumerated.item[0] >> 1; in snd_ac97_vt1617a_smart51_put()
3557 usMS = ucontrol->value.enumerated.item[0] & 1; in snd_ac97_vt1617a_smart51_put()
3562 usReg = snd_ac97_read(pac97, 0x7a); in snd_ac97_vt1617a_smart51_put()
3563 snd_ac97_write_cache(pac97, 0x7a, (usReg & 0x3FFF) + (usSM51 << 14)); in snd_ac97_vt1617a_smart51_put()
3564 usReg = snd_ac97_read(pac97, 0x20); in snd_ac97_vt1617a_smart51_put()
3565 snd_ac97_write_cache(pac97, 0x20, (usReg & 0xFEFF) + (usMS << 8)); in snd_ac97_vt1617a_smart51_put()
3567 return 0; in snd_ac97_vt1617a_smart51_put()
3572 AC97_SINGLE("Center/LFE Exchange", 0x5a, 8, 1, 0),
3588 int err = 0; in patch_vt1617a()
3594 err = patch_build_controls(ac97, &snd_ac97_controls_vt1617a[0], in patch_vt1617a()
3603 val = snd_ac97_read(ac97, 0x5c); in patch_vt1617a()
3604 if (!(val & 0x20)) in patch_vt1617a()
3605 snd_ac97_write_cache(ac97, 0x5c, 0x20); in patch_vt1617a()
3656 /* This list reflects the vt1618 docs for Vendor Defined Register 0x60. */
3661 .mask = 0x03,
3662 .shift = 0,
3669 .mask = 0x0c,
3677 .mask = 0x30,
3693 * Vendor Defined Register 0x60, page 0. The bits, and thus
3705 snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0); in snd_ac97_vt1618_UAJ_get()
3707 uaj = snd_ac97_read(pac97, 0x60) & in snd_ac97_vt1618_UAJ_get()
3713 ucontrol->value.enumerated.item[0] = uaj >> in snd_ac97_vt1618_UAJ_get()
3716 return 0; in snd_ac97_vt1618_UAJ_get()
3722 return ac97_update_bits_page(snd_kcontrol_chip(kcontrol), 0x60, in snd_ac97_vt1618_UAJ_put()
3724 ucontrol->value.enumerated.item[0]<< in snd_ac97_vt1618_UAJ_put()
3726 0); in snd_ac97_vt1618_UAJ_put()
3742 ucontrol->value.enumerated.item[0] = in snd_ac97_vt1618_aux_get()
3743 (snd_ac97_read(snd_kcontrol_chip(kcontrol), 0x5c) & 0x0008)>>3; in snd_ac97_vt1618_aux_get()
3744 return 0; in snd_ac97_vt1618_aux_get()
3752 snd_ac97_update_bits(snd_kcontrol_chip(kcontrol), 0x5c, 0x0008, in snd_ac97_vt1618_aux_put()
3753 ucontrol->value.enumerated.item[0] << 3); in snd_ac97_vt1618_aux_put()
3757 return snd_ac97_update_bits(snd_kcontrol_chip(kcontrol), 0x76, 0x0008, in snd_ac97_vt1618_aux_put()
3758 ucontrol->value.enumerated.item[0] << 3); in snd_ac97_vt1618_aux_put()
3762 AC97_SINGLE("Exchange Center/LFE", 0x5a, 8, 1, 0),
3763 AC97_SINGLE("DC Offset", 0x5a, 10, 1, 0),
3764 AC97_SINGLE("Soft Mute", 0x5c, 0, 1, 1),
3765 AC97_SINGLE("Headphone Amp", 0x5c, 5, 1, 1),
3766 AC97_DOUBLE("Back Surr Volume", 0x5e, 8, 0, 31, 1),
3767 AC97_SINGLE("Back Surr Switch", 0x5e, 15, 1, 1),
3774 .private_value = 0
3812 snd_ac97_update_bits(ac97, 0x76, 1 << 9, in it2646_update_jacks()
3813 is_shared_surrout(ac97) ? (1<<9) : 0); in it2646_update_jacks()
3815 snd_ac97_update_bits(ac97, 0x76, 1 << 10, in it2646_update_jacks()
3816 is_shared_clfeout(ac97) ? (1<<10) : 0); in it2646_update_jacks()
3825 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0x76, 11, 1, 0),
3826 AC97_SINGLE("Analog to IEC958 Output", 0x76, 12, 1, 0),
3827 AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0),
3834 if (err < 0) in patch_it2646_specific()
3837 if (err < 0) in patch_it2646_specific()
3839 return 0; in patch_it2646_specific()
3851 snd_ac97_write_cache(ac97, 0x5E, 0x0808); in patch_it2646()
3852 snd_ac97_write_cache(ac97, 0x7A, 0x0808); in patch_it2646()
3853 return 0; in patch_it2646()
3860 #define AC97_SI3036_CHIP_ID 0x5a
3861 #define AC97_SI3036_LINE_CFG 0x5c
3864 AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1)
3870 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++) { in patch_si3036_specific()
3872 if (err < 0) in patch_si3036_specific()
3875 return 0; in patch_si3036_specific()
3885 snd_ac97_write_cache(ac97, 0x5c, 0xf210 ); in mpatch_si3036()
3886 snd_ac97_write_cache(ac97, 0x68, 0); in mpatch_si3036()
3887 return 0; in mpatch_si3036()
3899 { AC97_MASTER, 0x1f1f },
3900 { AC97_HEADPHONE, 0x1f1f },
3901 { AC97_MASTER_MONO, 0x001f },
3902 { AC97_PC_BEEP, 0x001f }, /* LSB is ignored */
3903 { AC97_PHONE, 0x001f },
3904 { AC97_MIC, 0x001f },
3905 { AC97_LINE, 0x1f1f },
3906 { AC97_CD, 0x1f1f },
3907 { AC97_VIDEO, 0x1f1f },
3908 { AC97_AUX, 0x1f1f },
3909 { AC97_PCM, 0x1f1f },
3910 { AC97_REC_GAIN, 0x0f0f },
3917 return 0; in patch_lm4550()