Lines Matching refs:ac97
18 static struct snd_kcontrol *snd_ac97_find_mixer_ctl(struct snd_ac97 *ac97,
20 static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
28 static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontrol_new *controls, in… in patch_build_controls() argument
33 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&controls[idx], ac97)); in patch_build_controls()
41 static void reset_tlv(struct snd_ac97 *ac97, const char *name, in reset_tlv() argument
49 kctl = snd_ctl_find_id(ac97->bus->card, &sid); in reset_tlv()
55 static int ac97_update_bits_page(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, un… in ac97_update_bits_page() argument
60 mutex_lock(&ac97->page_mutex); in ac97_update_bits_page()
61 page_save = snd_ac97_read(ac97, AC97_INT_PAGING) & AC97_PAGE_MASK; in ac97_update_bits_page()
62 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page); in ac97_update_bits_page()
63 ret = snd_ac97_update_bits(ac97, reg, mask, value); in ac97_update_bits_page()
64 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save); in ac97_update_bits_page()
65 mutex_unlock(&ac97->page_mutex); /* unlock paging */ in ac97_update_bits_page()
81 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in ac97_surround_jack_mode_get() local
83 ucontrol->value.enumerated.item[0] = ac97->indep_surround; in ac97_surround_jack_mode_get()
89 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in ac97_surround_jack_mode_put() local
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()
110 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in ac97_channel_mode_get() local
112 ucontrol->value.enumerated.item[0] = ac97->channel_mode; in ac97_channel_mode_get()
118 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in ac97_channel_mode_put() local
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()
172 static inline int is_surround_on(struct snd_ac97 *ac97) in is_surround_on() argument
174 return ac97->channel_mode >= 1; in is_surround_on()
177 static inline int is_clfe_on(struct snd_ac97 *ac97) in is_clfe_on() argument
179 return ac97->channel_mode >= 2; in is_clfe_on()
183 static inline int is_shared_surrout(struct snd_ac97 *ac97) in is_shared_surrout() argument
185 return !ac97->indep_surround && is_surround_on(ac97); in is_shared_surrout()
189 static inline int is_shared_clfeout(struct snd_ac97 *ac97) in is_shared_clfeout() argument
191 return !ac97->indep_surround && is_clfe_on(ac97); in is_shared_clfeout()
195 static inline int is_shared_linein(struct snd_ac97 *ac97) in is_shared_linein() argument
197 return !ac97->indep_surround && !is_surround_on(ac97); in is_shared_linein()
201 static inline int is_shared_micin(struct snd_ac97 *ac97) in is_shared_micin() argument
203 return !ac97->indep_surround && !is_clfe_on(ac97); in is_shared_micin()
206 static inline int alc850_is_aux_back_surround(struct snd_ac97 *ac97) in alc850_is_aux_back_surround() argument
208 return is_surround_on(ac97); in alc850_is_aux_back_surround()
230 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ymf7x3_get_speaker() local
233 val = ac97->regs[AC97_YMF7X3_3D_MODE_SEL]; in snd_ac97_ymf7x3_get_speaker()
244 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ymf7x3_put_speaker() local
250 return snd_ac97_update(ac97, AC97_YMF7X3_3D_MODE_SEL, val); in snd_ac97_ymf7x3_put_speaker()
275 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ymf7x3_spdif_source_get() local
278 val = ac97->regs[AC97_YMF7X3_DIT_CTRL]; in snd_ac97_ymf7x3_spdif_source_get()
286 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ymf7x3_spdif_source_put() local
292 return snd_ac97_update_bits(ac97, AC97_YMF7X3_DIT_CTRL, 0x0002, val); in snd_ac97_ymf7x3_spdif_source_put()
295 static int patch_yamaha_ymf7x3_3d(struct snd_ac97 *ac97) in patch_yamaha_ymf7x3_3d() argument
300 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in patch_yamaha_ymf7x3_3d()
301 err = snd_ctl_add(ac97->bus->card, kctl); in patch_yamaha_ymf7x3_3d()
306 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in patch_yamaha_ymf7x3_3d()
307 err = snd_ctl_add(ac97->bus->card, in patch_yamaha_ymf7x3_3d()
309 ac97)); in patch_yamaha_ymf7x3_3d()
312 snd_ac97_write_cache(ac97, AC97_YMF7X3_3D_MODE_SEL, 0x0c00); in patch_yamaha_ymf7x3_3d()
331 static int patch_yamaha_ymf743_build_spdif(struct snd_ac97 *ac97) in patch_yamaha_ymf743_build_spdif() argument
335 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); in patch_yamaha_ymf743_build_spdif()
338 err = patch_build_controls(ac97, in patch_yamaha_ymf743_build_spdif()
344 snd_ac97_write_cache(ac97, AC97_YMF7X3_DIT_CTRL, 0xa201); in patch_yamaha_ymf743_build_spdif()
353 static int patch_yamaha_ymf743(struct snd_ac97 *ac97) in patch_yamaha_ymf743() argument
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()
376 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ymf753_spdif_output_pin_get() local
379 val = ac97->regs[AC97_YMF7X3_DIT_CTRL]; in snd_ac97_ymf753_spdif_output_pin_get()
386 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ymf753_spdif_output_pin_put() local
393 return snd_ac97_update_bits(ac97, AC97_YMF7X3_DIT_CTRL, 0x0028, val); in snd_ac97_ymf753_spdif_output_pin_put()
417 static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97) in patch_yamaha_ymf753_post_spdif() argument
421 …err = patch_build_controls(ac97, snd_ac97_ymf753_controls_spdif, ARRAY_SIZE(snd_ac97_ymf753_contro… in patch_yamaha_ymf753_post_spdif()
432 static int patch_yamaha_ymf753(struct snd_ac97 * ac97) in patch_yamaha_ymf753() argument
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()
458 static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97) in patch_wolfson_wm9703_specific() argument
467 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm97xx_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9703_specific()
471 snd_ac97_write_cache(ac97, AC97_WM97XX_FMIXER_VOL, 0x0808); in patch_wolfson_wm9703_specific()
479 static int patch_wolfson03(struct snd_ac97 * ac97) in patch_wolfson03() argument
481 ac97->build_ops = &patch_wolfson_wm9703_ops; in patch_wolfson03()
494 static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97) in patch_wolfson_wm9704_specific() argument
498 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9704_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9704_specific()
503 snd_ac97_write_cache(ac97, AC97_WM9704_TEST, 0x0200); in patch_wolfson_wm9704_specific()
511 static int patch_wolfson04(struct snd_ac97 * ac97) in patch_wolfson04() argument
514 ac97->build_ops = &patch_wolfson_wm9704_ops; in patch_wolfson04()
518 static int patch_wolfson05(struct snd_ac97 * ac97) in patch_wolfson05() argument
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()
634 static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97) in patch_wolfson_wm9711_specific() argument
639 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9711_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9711_specific()
643 snd_ac97_write_cache(ac97, AC97_CODEC_CLASS_REV, 0x0808); in patch_wolfson_wm9711_specific()
644 snd_ac97_write_cache(ac97, AC97_PCI_SVID, 0x0808); in patch_wolfson_wm9711_specific()
645 snd_ac97_write_cache(ac97, AC97_VIDEO, 0x0808); in patch_wolfson_wm9711_specific()
646 snd_ac97_write_cache(ac97, AC97_AUX, 0x0808); in patch_wolfson_wm9711_specific()
647 snd_ac97_write_cache(ac97, AC97_PC_BEEP, 0x0808); in patch_wolfson_wm9711_specific()
648 snd_ac97_write_cache(ac97, AC97_CD, 0x0000); in patch_wolfson_wm9711_specific()
656 static int patch_wolfson11(struct snd_ac97 * ac97) in patch_wolfson11() argument
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()
802 static int patch_wolfson_wm9713_3d (struct snd_ac97 * ac97) in patch_wolfson_wm9713_3d() argument
807 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls_3d[i], ac97)); in patch_wolfson_wm9713_3d()
814 static int patch_wolfson_wm9713_specific(struct snd_ac97 * ac97) in patch_wolfson_wm9713_specific() argument
819 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls[i], ac97)); in patch_wolfson_wm9713_specific()
823 snd_ac97_write_cache(ac97, AC97_PC_BEEP, 0x0808); in patch_wolfson_wm9713_specific()
824 snd_ac97_write_cache(ac97, AC97_PHONE, 0x0808); in patch_wolfson_wm9713_specific()
825 snd_ac97_write_cache(ac97, AC97_MIC, 0x0808); in patch_wolfson_wm9713_specific()
826 snd_ac97_write_cache(ac97, AC97_LINE, 0x00da); in patch_wolfson_wm9713_specific()
827 snd_ac97_write_cache(ac97, AC97_CD, 0x0808); in patch_wolfson_wm9713_specific()
828 snd_ac97_write_cache(ac97, AC97_VIDEO, 0xd612); in patch_wolfson_wm9713_specific()
829 snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x1ba0); in patch_wolfson_wm9713_specific()
834 static void patch_wolfson_wm9713_suspend (struct snd_ac97 * ac97) in patch_wolfson_wm9713_suspend() argument
836 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff); in patch_wolfson_wm9713_suspend()
837 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff); in patch_wolfson_wm9713_suspend()
840 static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97) in patch_wolfson_wm9713_resume() argument
842 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); in patch_wolfson_wm9713_resume()
843 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); in patch_wolfson_wm9713_resume()
844 snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0x0); in patch_wolfson_wm9713_resume()
857 static int patch_wolfson13(struct snd_ac97 * ac97) in patch_wolfson13() argument
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()
867 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); in patch_wolfson13()
868 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); in patch_wolfson13()
869 snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0x0); in patch_wolfson13()
877 static int patch_tritech_tr28028(struct snd_ac97 * ac97) in patch_tritech_tr28028() argument
879 snd_ac97_write_cache(ac97, 0x26, 0x0300); in patch_tritech_tr28028()
880 snd_ac97_write_cache(ac97, 0x26, 0x0000); in patch_tritech_tr28028()
881 snd_ac97_write_cache(ac97, AC97_SURROUND_MASTER, 0x0000); in patch_tritech_tr28028()
882 snd_ac97_write_cache(ac97, AC97_SPDIF, 0x0000); in patch_tritech_tr28028()
889 static int patch_sigmatel_stac9700_3d(struct snd_ac97 * ac97) in patch_sigmatel_stac9700_3d() argument
894 err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97)); in patch_sigmatel_stac9700_3d()
899 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in patch_sigmatel_stac9700_3d()
903 static int patch_sigmatel_stac9708_3d(struct snd_ac97 * ac97) in patch_sigmatel_stac9708_3d() argument
908 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in patch_sigmatel_stac9708_3d()
909 err = snd_ctl_add(ac97->bus->card, kctl); in patch_sigmatel_stac9708_3d()
914 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in patch_sigmatel_stac9708_3d()
915 err = snd_ctl_add(ac97->bus->card, kctl); in patch_sigmatel_stac9708_3d()
920 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in patch_sigmatel_stac9708_3d()
938 static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97) in patch_sigmatel_stac97xx_specific() argument
942 …snd_ac97_write_cache(ac97, AC97_SIGMATEL_ANALOG, snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) & ~0x00… in patch_sigmatel_stac97xx_specific()
943 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 1)) { in patch_sigmatel_stac97xx_specific()
944 err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[0], 1); in patch_sigmatel_stac97xx_specific()
948 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 0)) { in patch_sigmatel_stac97xx_specific()
949 err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[1], 1); in patch_sigmatel_stac97xx_specific()
953 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_DAC2INVERT, 2)) { in patch_sigmatel_stac97xx_specific()
954 err = patch_build_controls(ac97, &snd_ac97_sigmatel_4speaker, 1); in patch_sigmatel_stac97xx_specific()
958 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_DAC2INVERT, 3)) { in patch_sigmatel_stac97xx_specific()
959 err = patch_build_controls(ac97, &snd_ac97_sigmatel_phaseinvert, 1); in patch_sigmatel_stac97xx_specific()
971 static int patch_sigmatel_stac9700(struct snd_ac97 * ac97) in patch_sigmatel_stac9700() argument
973 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9700()
979 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9708_put_bias() local
982 mutex_lock(&ac97->page_mutex); in snd_ac97_stac9708_put_bias()
983 snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in snd_ac97_stac9708_put_bias()
984 err = snd_ac97_update_bits(ac97, AC97_SIGMATEL_BIAS2, 0x0010, in snd_ac97_stac9708_put_bias()
986 snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0); in snd_ac97_stac9708_put_bias()
987 mutex_unlock(&ac97->page_mutex); in snd_ac97_stac9708_put_bias()
1000 static int patch_sigmatel_stac9708_specific(struct snd_ac97 *ac97) in patch_sigmatel_stac9708_specific() argument
1005 snd_ac97_remove_ctl(ac97, "PCM Out Path & Mute", NULL); in patch_sigmatel_stac9708_specific()
1007 snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", "Sigmatel Surround Playback"); in patch_sigmatel_stac9708_specific()
1008 err = patch_build_controls(ac97, &snd_ac97_stac9708_bias_control, 1); in patch_sigmatel_stac9708_specific()
1011 return patch_sigmatel_stac97xx_specific(ac97); in patch_sigmatel_stac9708_specific()
1019 static int patch_sigmatel_stac9708(struct snd_ac97 * ac97) in patch_sigmatel_stac9708() argument
1023 ac97->build_ops = &patch_sigmatel_stac9708_ops; in patch_sigmatel_stac9708()
1024 ac97->caps |= 0x10; /* HP (sigmatel surround) support */ in patch_sigmatel_stac9708()
1026 codec72 = snd_ac97_read(ac97, AC97_SIGMATEL_BIAS2) & 0x8000; in patch_sigmatel_stac9708()
1027 codec6c = snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG); in patch_sigmatel_stac9708()
1030 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9708()
1031 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x1000); in patch_sigmatel_stac9708()
1032 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9708()
1033 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0007); in patch_sigmatel_stac9708()
1035 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9708()
1036 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x1001); in patch_sigmatel_stac9708()
1037 snd_ac97_write_cache(ac97, AC97_SIGMATEL_DAC2INVERT, 0x0008); in patch_sigmatel_stac9708()
1041 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9708()
1045 static int patch_sigmatel_stac9721(struct snd_ac97 * ac97) in patch_sigmatel_stac9721() argument
1047 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9721()
1048 if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) { in patch_sigmatel_stac9721()
1050 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9721()
1051 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x4000); in patch_sigmatel_stac9721()
1052 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9721()
1053 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0002); in patch_sigmatel_stac9721()
1055 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9721()
1059 static int patch_sigmatel_stac9744(struct snd_ac97 * ac97) in patch_sigmatel_stac9744() argument
1062 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9744()
1063 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9744()
1064 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */ in patch_sigmatel_stac9744()
1065 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9744()
1066 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0002); in patch_sigmatel_stac9744()
1067 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9744()
1071 static int patch_sigmatel_stac9756(struct snd_ac97 * ac97) in patch_sigmatel_stac9756() argument
1074 ac97->build_ops = &patch_sigmatel_stac9700_ops; in patch_sigmatel_stac9756()
1075 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba); in patch_sigmatel_stac9756()
1076 snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */ in patch_sigmatel_stac9756()
1077 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba); in patch_sigmatel_stac9756()
1078 snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS2, 0x0002); in patch_sigmatel_stac9756()
1079 snd_ac97_write_cache(ac97, AC97_SIGMATEL_MULTICHN, 0x0000); in patch_sigmatel_stac9756()
1094 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9758_output_jack_get() local
1098 val = ac97->regs[AC97_SIGMATEL_OUTSEL] >> shift; in snd_ac97_stac9758_output_jack_get()
1108 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9758_output_jack_put() local
1118 return ac97_update_bits_page(ac97, AC97_SIGMATEL_OUTSEL, in snd_ac97_stac9758_output_jack_put()
1133 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9758_input_jack_get() local
1137 val = ac97->regs[AC97_SIGMATEL_INSEL]; in snd_ac97_stac9758_input_jack_get()
1144 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9758_input_jack_put() local
1147 return ac97_update_bits_page(ac97, AC97_SIGMATEL_INSEL, 7 << shift, in snd_ac97_stac9758_input_jack_put()
1162 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9758_phonesel_get() local
1164 ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3; in snd_ac97_stac9758_phonesel_get()
1170 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_stac9758_phonesel_put() local
1172 return ac97_update_bits_page(ac97, AC97_SIGMATEL_IOMISC, 3, in snd_ac97_stac9758_phonesel_put()
1207 static int patch_sigmatel_stac9758_specific(struct snd_ac97 *ac97) in patch_sigmatel_stac9758_specific() argument
1211 err = patch_sigmatel_stac97xx_specific(ac97); in patch_sigmatel_stac9758_specific()
1214 err = patch_build_controls(ac97, snd_ac97_sigmatel_stac9758_controls, in patch_sigmatel_stac9758_specific()
1219 snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", "Front Playback"); in patch_sigmatel_stac9758_specific()
1223 snd_ac97_rename_vol_ctl(ac97, "Video Playback", "Surround Mix Playback"); in patch_sigmatel_stac9758_specific()
1234 static int patch_sigmatel_stac9758(struct snd_ac97 * ac97) in patch_sigmatel_stac9758() argument
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()
1266 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, AC97_PAGE_VENDOR); in patch_sigmatel_stac9758()
1268 snd_ac97_write_cache(ac97, regs[i], pregs[i]); in patch_sigmatel_stac9758()
1270 ac97->flags |= AC97_STEREO_MUTES; in patch_sigmatel_stac9758()
1282 static int patch_cirrus_build_spdif(struct snd_ac97 * ac97) in patch_cirrus_build_spdif() argument
1287 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); in patch_cirrus_build_spdif()
1291 err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[0], 1); in patch_cirrus_build_spdif()
1294 switch (ac97->id & AC97_ID_CS_MASK) { in patch_cirrus_build_spdif()
1296 err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[1], 1); in patch_cirrus_build_spdif()
1303 snd_ac97_write_cache(ac97, AC97_CSR_SPDIF, 0x0a20); in patch_cirrus_build_spdif()
1311 static int patch_cirrus_spdif(struct snd_ac97 * ac97) in patch_cirrus_spdif() argument
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()
1328 snd_ac97_write_cache(ac97, AC97_CSR_ACMODE, 0x0080); in patch_cirrus_spdif()
1332 static int patch_cirrus_cs4299(struct snd_ac97 * ac97) in patch_cirrus_cs4299() argument
1335 ac97->flags |= AC97_HAS_PC_BEEP; in patch_cirrus_cs4299()
1337 return patch_cirrus_spdif(ac97); in patch_cirrus_cs4299()
1347 static int patch_conexant_build_spdif(struct snd_ac97 * ac97) in patch_conexant_build_spdif() argument
1352 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); in patch_conexant_build_spdif()
1356 err = patch_build_controls(ac97, &snd_ac97_conexant_controls_spdif[0], 1); in patch_conexant_build_spdif()
1361 snd_ac97_write_cache(ac97, AC97_CXR_AUDIO_MISC, in patch_conexant_build_spdif()
1362 …snd_ac97_read(ac97, AC97_CXR_AUDIO_MISC) & ~(AC97_CXR_SPDIFEN|AC97_CXR_COPYRGT|AC97_CXR_SPDIF_MASK… in patch_conexant_build_spdif()
1370 static int patch_conexant(struct snd_ac97 * ac97) in patch_conexant() argument
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()
1379 static int patch_cx20551(struct snd_ac97 *ac97) in patch_cx20551() argument
1381 snd_ac97_update_bits(ac97, 0x5c, 0x01, 0x01); in patch_cx20551()
1389 static void ad18xx_resume(struct snd_ac97 *ac97) in ad18xx_resume() argument
1398 if (test_bit(reg, ac97->reg_accessed)) { in ad18xx_resume()
1399 snd_ac97_write(ac97, reg, ac97->regs[reg]); in ad18xx_resume()
1400 snd_ac97_read(ac97, reg); in ad18xx_resume()
1404 if (! (ac97->flags & AC97_AD_MULTI)) in ad18xx_resume()
1406 snd_ac97_restore_status(ac97); in ad18xx_resume()
1410 if (! ac97->spec.ad18xx.id[codec]) in ad18xx_resume()
1413 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 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()
1418 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in ad18xx_resume()
1424 if (test_bit(i, ac97->reg_accessed)) { in ad18xx_resume()
1428 if (! ac97->spec.ad18xx.id[codec]) in ad18xx_resume()
1431 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 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()
1437 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in ad18xx_resume()
1444 snd_ac97_write(ac97, i, ac97->regs[i]); in ad18xx_resume()
1445 snd_ac97_read(ac97, i); in ad18xx_resume()
1449 snd_ac97_restore_iec958(ac97); in ad18xx_resume()
1452 static void ad1888_resume(struct snd_ac97 *ac97) in ad1888_resume() argument
1454 ad18xx_resume(ac97); in ad1888_resume()
1455 snd_ac97_write_cache(ac97, AC97_CODEC_CLASS_REV, 0x8080); in ad1888_resume()
1471 static int patch_ad1819(struct snd_ac97 * ac97) in patch_ad1819() argument
1476 scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG); in patch_ad1819()
1477 snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x7000); /* select all codecs */ in patch_ad1819()
1478 ac97->res_table = ad1819_restbl; in patch_ad1819()
1482 static unsigned short patch_ad1881_unchained(struct snd_ac97 * ac97, int idx, unsigned short mask) in patch_ad1881_unchained() argument
1487 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, mask); in patch_ad1881_unchained()
1488 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); /* ID0C, ID1C, SDIE = off */ in patch_ad1881_unchained()
1489 val = snd_ac97_read(ac97, AC97_VENDOR_ID2); in patch_ad1881_unchained()
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()
1498 static int patch_ad1881_chained1(struct snd_ac97 * ac97, int idx, unsigned short codec_bits) in patch_ad1881_chained1() argument
1503 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, cfg_bits[idx]); in patch_ad1881_chained1()
1504 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); // SDIE in patch_ad1881_chained1()
1505 val = snd_ac97_read(ac97, AC97_VENDOR_ID2); in patch_ad1881_chained1()
1509 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, codec_bits); in patch_ad1881_chained1()
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()
1516 static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int cidx1, int cidx2) in patch_ad1881_chained() argument
1519 if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1]) in patch_ad1881_chained()
1521 if (ac97->spec.ad18xx.unchained[cidx2] || ac97->spec.ad18xx.chained[cidx2]) in patch_ad1881_chained()
1526 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in patch_ad1881_chained()
1527 ac97->spec.ad18xx.unchained[unchained_idx]); in patch_ad1881_chained()
1528 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); // ID1C in patch_ad1881_chained()
1529 ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002; in patch_ad1881_chained()
1532 patch_ad1881_chained1(ac97, cidx1, 0); in patch_ad1881_chained()
1533 else if (patch_ad1881_chained1(ac97, cidx1, 0x0006)) // SDIE | ID1C in patch_ad1881_chained()
1534 patch_ad1881_chained1(ac97, cidx2, 0); in patch_ad1881_chained()
1535 else if (patch_ad1881_chained1(ac97, cidx2, 0x0006)) // SDIE | ID1C in patch_ad1881_chained()
1536 patch_ad1881_chained1(ac97, cidx1, 0); in patch_ad1881_chained()
1538 patch_ad1881_chained1(ac97, cidx2, 0); in patch_ad1881_chained()
1548 static int patch_ad1881(struct snd_ac97 * ac97) in patch_ad1881() argument
1561 val = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG); in patch_ad1881()
1562 snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, val); in patch_ad1881()
1563 codecs[0] = patch_ad1881_unchained(ac97, 0, (1<<12)); in patch_ad1881()
1564 codecs[1] = patch_ad1881_unchained(ac97, 1, (1<<14)); in patch_ad1881()
1565 codecs[2] = patch_ad1881_unchained(ac97, 2, (1<<13)); in patch_ad1881()
1571 if (ac97->spec.ad18xx.unchained[idx]) in patch_ad1881()
1572 patch_ad1881_chained(ac97, idx, cfg_idxs[idx][0], cfg_idxs[idx][1]); 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()
1585 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in patch_ad1881()
1588 if (ac97->spec.ad18xx.id[idx]) in patch_ad1881()
1592 snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); 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()
1618 static int patch_ad1885_specific(struct snd_ac97 * ac97) in patch_ad1885_specific() argument
1622 err = patch_build_controls(ac97, snd_ac97_controls_ad1885, ARRAY_SIZE(snd_ac97_controls_ad1885)); in patch_ad1885_specific()
1625 reset_tlv(ac97, "Headphone Playback Volume", in patch_ad1885_specific()
1637 static int patch_ad1885(struct snd_ac97 * ac97) in patch_ad1885() argument
1639 patch_ad1881(ac97); in patch_ad1885()
1644 snd_ac97_write_cache(ac97, AC97_AD_MISC, 0x0404); in patch_ad1885()
1646 ac97->build_ops = &patch_ad1885_build_ops; in patch_ad1885()
1650 static int patch_ad1886_specific(struct snd_ac97 * ac97) in patch_ad1886_specific() argument
1652 reset_tlv(ac97, "Headphone Playback Volume", in patch_ad1886_specific()
1664 static int patch_ad1886(struct snd_ac97 * ac97) in patch_ad1886() argument
1666 patch_ad1881(ac97); in patch_ad1886()
1669 snd_ac97_write_cache(ac97, AC97_AD_JACK_SPDIF, 0x0010); in patch_ad1886()
1670 ac97->build_ops = &patch_ad1886_build_ops; in patch_ad1886()
1785 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad198x_spdif_source_get() local
1788 val = ac97->regs[AC97_AD_SERIAL_CFG]; in snd_ac97_ad198x_spdif_source_get()
1795 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad198x_spdif_source_put() local
1801 return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val); in snd_ac97_ad198x_spdif_source_put()
1812 static int patch_ad198x_post_spdif(struct snd_ac97 * ac97) in patch_ad198x_post_spdif() argument
1814 return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1); in patch_ad198x_post_spdif()
1841 static int check_list(struct snd_ac97 *ac97, const unsigned int *list) in check_list() argument
1843 u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; in check_list()
1850 static int patch_ad1981a_specific(struct snd_ac97 * ac97) in patch_ad1981a_specific() argument
1852 if (check_list(ac97, ad1981_jacks_denylist)) in patch_ad1981a_specific()
1854 return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, in patch_ad1981a_specific()
1882 static void check_ad1981_hp_jack_sense(struct snd_ac97 *ac97) in check_ad1981_hp_jack_sense() argument
1884 if (check_list(ac97, ad1981_jacks_allowlist)) in check_ad1981_hp_jack_sense()
1886 snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); in check_ad1981_hp_jack_sense()
1889 static int patch_ad1981a(struct snd_ac97 *ac97) in patch_ad1981a() argument
1891 patch_ad1881(ac97); in patch_ad1981a()
1892 ac97->build_ops = &patch_ad1981a_build_ops; in patch_ad1981a()
1893 snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT); in patch_ad1981a()
1894 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1981a()
1895 check_ad1981_hp_jack_sense(ac97); in patch_ad1981a()
1902 static int patch_ad1981b_specific(struct snd_ac97 *ac97) in patch_ad1981b_specific() argument
1906 err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); in patch_ad1981b_specific()
1909 if (check_list(ac97, ad1981_jacks_denylist)) in patch_ad1981b_specific()
1911 return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, in patch_ad1981b_specific()
1923 static int patch_ad1981b(struct snd_ac97 *ac97) in patch_ad1981b() argument
1925 patch_ad1881(ac97); in patch_ad1981b()
1926 ac97->build_ops = &patch_ad1981b_build_ops; in patch_ad1981b()
1927 snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT); in patch_ad1981b()
1928 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1981b()
1929 check_ad1981_hp_jack_sense(ac97); in patch_ad1981b()
1937 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1888_lohpsel_get() local
1940 val = ac97->regs[AC97_AD_MISC]; in snd_ac97_ad1888_lohpsel_get()
1942 if (ac97->spec.ad18xx.lo_as_master) in snd_ac97_ad1888_lohpsel_get()
1950 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1888_lohpsel_put() local
1954 if (ac97->spec.ad18xx.lo_as_master) in snd_ac97_ad1888_lohpsel_put()
1957 return snd_ac97_update_bits(ac97, AC97_AD_MISC, in snd_ac97_ad1888_lohpsel_put()
1970 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1888_downmix_get() local
1973 val = ac97->regs[AC97_AD_MISC]; in snd_ac97_ad1888_downmix_get()
1983 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1888_downmix_put() local
1993 return snd_ac97_update_bits(ac97, AC97_AD_MISC, in snd_ac97_ad1888_downmix_put()
1997 static void ad1888_update_jacks(struct snd_ac97 *ac97) in ad1888_update_jacks() argument
2001 if (!ac97->spec.ad18xx.lo_as_master && is_shared_linein(ac97)) in ad1888_update_jacks()
2004 if (is_shared_micin(ac97)) in ad1888_update_jacks()
2007 snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val); in ad1888_update_jacks()
2036 static int patch_ad1888_specific(struct snd_ac97 *ac97) in patch_ad1888_specific() argument
2038 if (!ac97->spec.ad18xx.lo_as_master) { in patch_ad1888_specific()
2040 snd_ac97_rename_vol_ctl(ac97, "Master Playback", in patch_ad1888_specific()
2042 snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", in patch_ad1888_specific()
2045 return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls)); in patch_ad1888_specific()
2057 static int patch_ad1888(struct snd_ac97 * ac97) in patch_ad1888() argument
2061 patch_ad1881(ac97); in patch_ad1888()
2062 ac97->build_ops = &patch_ad1888_build_ops; 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()
2072 misc = snd_ac97_read(ac97, AC97_AD_MISC); in patch_ad1888()
2076 if (!ac97->spec.ad18xx.lo_as_master) in patch_ad1888()
2083 snd_ac97_write_cache(ac97, AC97_AD_MISC, misc); in patch_ad1888()
2084 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1888()
2088 static int patch_ad1980_specific(struct snd_ac97 *ac97) in patch_ad1980_specific() argument
2092 err = patch_ad1888_specific(ac97); in patch_ad1980_specific()
2095 return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); in patch_ad1980_specific()
2107 static int patch_ad1980(struct snd_ac97 * ac97) in patch_ad1980() argument
2109 patch_ad1888(ac97); in patch_ad1980()
2110 ac97->build_ops = &patch_ad1980_build_ops; in patch_ad1980()
2128 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1985_vrefout_get() local
2130 val = (ac97->regs[AC97_AD_MISC] & AC97_AD198X_VREF_MASK) in snd_ac97_ad1985_vrefout_get()
2140 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1985_vrefout_put() local
2147 return snd_ac97_update_bits(ac97, AC97_AD_MISC, in snd_ac97_ad1985_vrefout_put()
2184 static void ad1985_update_jacks(struct snd_ac97 *ac97) in ad1985_update_jacks() argument
2186 ad1888_update_jacks(ac97); in ad1985_update_jacks()
2188 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9, in ad1985_update_jacks()
2189 is_shared_micin(ac97) ? 1 << 9 : 0); in ad1985_update_jacks()
2192 static int patch_ad1985_specific(struct snd_ac97 *ac97) in patch_ad1985_specific() argument
2197 snd_ac97_rename_vol_ctl(ac97, "Master Playback", in patch_ad1985_specific()
2199 snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", "Master Playback"); in patch_ad1985_specific()
2201 err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); in patch_ad1985_specific()
2205 return patch_build_controls(ac97, snd_ac97_ad1985_controls, in patch_ad1985_specific()
2218 static int patch_ad1985(struct snd_ac97 * ac97) in patch_ad1985() argument
2222 patch_ad1881(ac97); in patch_ad1985()
2223 ac97->build_ops = &patch_ad1985_build_ops; in patch_ad1985()
2224 misc = snd_ac97_read(ac97, AC97_AD_MISC); in patch_ad1985()
2228 snd_ac97_write_cache(ac97, AC97_AD_MISC, misc | in patch_ad1985()
2233 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1985()
2236 ad1985_update_jacks(ac97); in patch_ad1985()
2239 ac97->ext_id = (ac97->ext_id & ~AC97_EI_REV_MASK) | AC97_EI_REV_23; in patch_ad1985()
2248 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_lososel_get() local
2251 val = ac97->regs[AC97_AD_MISC3]; in snd_ac97_ad1986_lososel_get()
2259 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_lososel_put() local
2262 int sprd = (ac97->regs[AC97_AD_MISC] & AC97_AD1986_SPRD) != 0; in snd_ac97_ad1986_lososel_put()
2264 ret0 = snd_ac97_update_bits(ac97, AC97_AD_MISC3, AC97_AD1986_LOSEL, in snd_ac97_ad1986_lososel_put()
2271 ret1 = snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD1986_SOSEL, in snd_ac97_ad1986_lososel_put()
2284 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_spread_get() local
2287 val = ac97->regs[AC97_AD_MISC]; in snd_ac97_ad1986_spread_get()
2295 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_spread_put() local
2298 int sprd = (ac97->regs[AC97_AD_MISC3] & AC97_AD1986_LOSEL) != 0; in snd_ac97_ad1986_spread_put()
2300 ret0 = snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD1986_SPRD, in snd_ac97_ad1986_spread_put()
2307 ret1 = snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD1986_SOSEL, in snd_ac97_ad1986_spread_put()
2320 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_miclisel_get() local
2322 ucontrol->value.integer.value[0] = ac97->spec.ad18xx.swap_mic_linein; in snd_ac97_ad1986_miclisel_get()
2329 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_miclisel_put() local
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()
2345 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_vrefout_get() local
2347 unsigned short reg = ac97->regs[AC97_AD_MISC2]; in snd_ac97_ad1986_vrefout_get()
2363 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_ad1986_vrefout_put() local
2397 cret = snd_ac97_update_bits(ac97, AC97_AD_MISC2, in snd_ac97_ad1986_vrefout_put()
2401 lret = snd_ac97_update_bits(ac97, AC97_AD_MISC3, in snd_ac97_ad1986_vrefout_put()
2405 mret = snd_ac97_update_bits(ac97, AC97_AD_MISC2, in snd_ac97_ad1986_vrefout_put()
2457 static void ad1986_update_jacks(struct snd_ac97 *ac97) in ad1986_update_jacks() argument
2463 if (!is_surround_on(ac97)) in ad1986_update_jacks()
2465 if (!is_clfe_on(ac97)) in ad1986_update_jacks()
2469 if (is_shared_linein(ac97)) in ad1986_update_jacks()
2471 else if (ac97->spec.ad18xx.swap_mic_linein != 0) in ad1986_update_jacks()
2473 snd_ac97_update_bits(ac97, AC97_AD_MISC, in ad1986_update_jacks()
2479 if (is_shared_micin(ac97)) in ad1986_update_jacks()
2481 else if (ac97->spec.ad18xx.swap_mic_linein != 0) in ad1986_update_jacks()
2485 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, in ad1986_update_jacks()
2490 static int patch_ad1986_specific(struct snd_ac97 *ac97) in patch_ad1986_specific() argument
2494 err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); in patch_ad1986_specific()
2498 return patch_build_controls(ac97, snd_ac97_ad1986_controls, in patch_ad1986_specific()
2511 static int patch_ad1986(struct snd_ac97 * ac97) in patch_ad1986() argument
2513 patch_ad1881(ac97); in patch_ad1986()
2514 ac97->build_ops = &patch_ad1986_build_ops; in patch_ad1986()
2515 ac97->flags |= AC97_STEREO_MUTES; in patch_ad1986()
2518 ad1986_update_jacks(ac97); in patch_ad1986()
2526 static int patch_alc203(struct snd_ac97 *ac97) in patch_alc203() argument
2528 snd_ac97_update_bits(ac97, 0x7a, 0x400, 0x400); in patch_alc203()
2535 static void alc650_update_jacks(struct snd_ac97 *ac97) in alc650_update_jacks() argument
2540 shared = is_shared_surrout(ac97); in alc650_update_jacks()
2541 snd_ac97_update_bits(ac97, AC97_ALC650_MULTICH, 1 << 9, in alc650_update_jacks()
2544 shared = is_shared_clfeout(ac97); in alc650_update_jacks()
2546 snd_ac97_update_bits(ac97, AC97_ALC650_CLOCK, 1 << 12, in alc650_update_jacks()
2549 snd_ac97_update_bits(ac97, AC97_ALC650_MULTICH, 1 << 10, in alc650_update_jacks()
2552 snd_ac97_update_bits(ac97, AC97_ALC650_GPIO_STATUS, 0x100, in alc650_update_jacks()
2559 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in alc650_swap_surround_put() local
2560 struct snd_pcm_chmap *map = ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK]; in alc650_swap_surround_put()
2613 static int patch_alc650_specific(struct snd_ac97 * ac97) in patch_alc650_specific() argument
2617 err = patch_build_controls(ac97, snd_ac97_controls_alc650, ARRAY_SIZE(snd_ac97_controls_alc650)); in patch_alc650_specific()
2620 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_alc650_specific()
2621 …err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc650, ARRAY_SIZE(snd_ac97_spdif_control… in patch_alc650_specific()
2625 if (ac97->id != AC97_ID_ALC650F) in patch_alc650_specific()
2626 reset_tlv(ac97, "Master Playback Volume", in patch_alc650_specific()
2636 static int patch_alc650(struct snd_ac97 * ac97) in patch_alc650() argument
2640 ac97->build_ops = &patch_alc650_ops; in patch_alc650()
2643 val = snd_ac97_read(ac97, AC97_ALC650_REVISION) & 0x3f; 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()
2659 snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS, in patch_alc650()
2660 snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x8000); in patch_alc650()
2663 val = snd_ac97_read(ac97, AC97_ALC650_CLOCK); 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()
2672 snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK, val); in patch_alc650()
2679 snd_ac97_write_cache(ac97, AC97_ALC650_MULTICH, 0); in patch_alc650()
2683 snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_SETUP, in patch_alc650()
2684 snd_ac97_read(ac97, AC97_ALC650_GPIO_SETUP) | 0x01); in patch_alc650()
2685 snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS, in patch_alc650()
2686 (snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x100) & ~0x10); in patch_alc650()
2689 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808); in patch_alc650()
2690 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808); in patch_alc650()
2694 static void alc655_update_jacks(struct snd_ac97 *ac97) in alc655_update_jacks() argument
2699 shared = is_shared_surrout(ac97); in alc655_update_jacks()
2700 ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 1 << 9, in alc655_update_jacks()
2703 shared = is_shared_clfeout(ac97); in alc655_update_jacks()
2705 snd_ac97_update_bits(ac97, AC97_ALC650_CLOCK, 1 << 12, in alc655_update_jacks()
2707 ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 1 << 10, in alc655_update_jacks()
2725 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in alc655_iec958_route_info() local
2727 if (ac97->spec.dev_flags) in alc655_iec958_route_info()
2735 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in alc655_iec958_route_get() local
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()
2748 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in alc655_iec958_route_put() local
2750 return ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 3 << 12, in alc655_iec958_route_put()
2768 static int patch_alc655_specific(struct snd_ac97 * ac97) in patch_alc655_specific() argument
2772 err = patch_build_controls(ac97, snd_ac97_controls_alc655, ARRAY_SIZE(snd_ac97_controls_alc655)); in patch_alc655_specific()
2775 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_alc655_specific()
2776 …err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_control… in patch_alc655_specific()
2788 static int patch_alc655(struct snd_ac97 * ac97) in patch_alc655() argument
2792 if (ac97->id == AC97_ID_ALC658) { in patch_alc655()
2793 ac97->spec.dev_flags = 1; /* ALC658 */ in patch_alc655()
2794 if ((snd_ac97_read(ac97, AC97_ALC650_REVISION) & 0x3f) == 2) { 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()
2803 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, AC97_PAGE_VENDOR); in patch_alc655()
2806 val = snd_ac97_read(ac97, 0x7a); /* misc control */ 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()
2823 snd_ac97_write_cache(ac97, 0x7a, val); in patch_alc655()
2829 snd_ac97_write_cache(ac97, AC97_ALC650_MULTICH, 1<<15); in patch_alc655()
2832 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808); in patch_alc655()
2833 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808); in patch_alc655()
2836 if (ac97->id == AC97_ID_ALC658D) in patch_alc655()
2837 snd_ac97_update_bits(ac97, 0x74, 0x0800, 0x0800); in patch_alc655()
2847 static void alc850_update_jacks(struct snd_ac97 *ac97) in alc850_update_jacks() argument
2853 shared = is_shared_surrout(ac97); in alc850_update_jacks()
2855 snd_ac97_update_bits(ac97, AC97_ALC850_MISC1, (1<<4)|(1<<5), in alc850_update_jacks()
2858 snd_ac97_update_bits(ac97, AC97_ALC850_JACK_SELECT, 7 << 12, in alc850_update_jacks()
2861 shared = is_shared_clfeout(ac97); in alc850_update_jacks()
2863 snd_ac97_update_bits(ac97, AC97_ALC850_MISC1, (1<<12)|(1<<13), in alc850_update_jacks()
2866 snd_ac97_update_bits(ac97, AC97_ALC850_JACK_SELECT, 7 << 4, in alc850_update_jacks()
2869 aux_is_back_surround = alc850_is_aux_back_surround(ac97); in alc850_update_jacks()
2871 snd_ac97_update_bits(ac97, AC97_ALC850_MULTICH, 1 << 10, in alc850_update_jacks()
2882 static int patch_alc850_specific(struct snd_ac97 *ac97) in patch_alc850_specific() argument
2886 err = patch_build_controls(ac97, snd_ac97_controls_alc850, ARRAY_SIZE(snd_ac97_controls_alc850)); in patch_alc850_specific()
2889 if (ac97->ext_id & AC97_EI_SPDIF) { in patch_alc850_specific()
2890 …err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_control… in patch_alc850_specific()
2902 static int patch_alc850(struct snd_ac97 *ac97) in patch_alc850() argument
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()
2910 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, AC97_PAGE_VENDOR); in patch_alc850()
2919 snd_ac97_write_cache(ac97, AC97_ALC650_MULTICH, 1<<15); in patch_alc850()
2923 snd_ac97_write_cache(ac97, 0x7a, (1<<1)|(1<<4)|(0<<5)|(1<<6)| in patch_alc850()
2928 snd_ac97_write_cache(ac97, 0x76, (0<<0)|(0<<2)|(1<<4)|(1<<7)|(2<<8)| in patch_alc850()
2932 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808); in patch_alc850()
2933 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808); in patch_alc850()
2937 static int patch_aztech_azf3328_specific(struct snd_ac97 *ac97) in patch_aztech_azf3328_specific() argument
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()
2951 snd_ac97_rename_vol_ctl(ac97, in patch_aztech_azf3328_specific()
2961 snd_ac97_rename_vol_ctl(ac97, in patch_aztech_azf3328_specific()
2964 snd_ac97_rename_vol_ctl(ac97, in patch_aztech_azf3328_specific()
2975 static int patch_aztech_azf3328(struct snd_ac97 *ac97) in patch_aztech_azf3328() argument
2977 ac97->build_ops = &patch_aztech_azf3328_ops; in patch_aztech_azf3328()
2984 static void cm9738_update_jacks(struct snd_ac97 *ac97) in cm9738_update_jacks() argument
2987 snd_ac97_update_bits(ac97, AC97_CM9738_VENDOR_CTRL, 1 << 10, in cm9738_update_jacks()
2988 is_shared_surrout(ac97) ? (1 << 10) : 0); in cm9738_update_jacks()
2997 static int patch_cm9738_specific(struct snd_ac97 * ac97) in patch_cm9738_specific() argument
2999 return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls)); in patch_cm9738_specific()
3007 static int patch_cm9738(struct snd_ac97 * ac97) in patch_cm9738() argument
3009 ac97->build_ops = &patch_cm9738_ops; in patch_cm9738()
3012 ac97->flags |= AC97_HAS_NO_PCM_VOL; in patch_cm9738()
3013 snd_ac97_write_cache(ac97, AC97_PCM, 0x8000); in patch_cm9738()
3027 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_cmedia_spdif_playback_source_get() local
3030 val = ac97->regs[AC97_CM9739_SPDIF_CTRL]; in snd_ac97_cmedia_spdif_playback_source_get()
3037 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in snd_ac97_cmedia_spdif_playback_source_put() local
3039 return snd_ac97_update_bits(ac97, AC97_CM9739_SPDIF_CTRL, in snd_ac97_cmedia_spdif_playback_source_put()
3062 static void cm9739_update_jacks(struct snd_ac97 *ac97) in cm9739_update_jacks() argument
3065 snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 1 << 10, in cm9739_update_jacks()
3066 is_shared_surrout(ac97) ? (1 << 10) : 0); in cm9739_update_jacks()
3068 snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 0x3000, in cm9739_update_jacks()
3069 is_shared_clfeout(ac97) ? 0x1000 : 0x2000); in cm9739_update_jacks()
3077 static int patch_cm9739_specific(struct snd_ac97 * ac97) in patch_cm9739_specific() argument
3079 return patch_build_controls(ac97, snd_ac97_cm9739_controls, ARRAY_SIZE(snd_ac97_cm9739_controls)); in patch_cm9739_specific()
3082 static int patch_cm9739_post_spdif(struct snd_ac97 * ac97) in patch_cm9739_post_spdif() argument
3084 …return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_contr… in patch_cm9739_post_spdif()
3093 static int patch_cm9739(struct snd_ac97 * ac97) in patch_cm9739() argument
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()
3101 snd_ac97_write_cache(ac97, AC97_MASTER, 0x8000); in patch_cm9739()
3102 snd_ac97_write_cache(ac97, AC97_PCM, 0x8000); in patch_cm9739()
3105 val = snd_ac97_read(ac97, AC97_EXTENDED_STATUS); in patch_cm9739()
3108 snd_ac97_write_cache(ac97, AC97_CM9739_SPDIF_CTRL, in patch_cm9739()
3109 snd_ac97_read(ac97, AC97_CM9739_SPDIF_CTRL) | 0x01); 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()
3125 val = snd_ac97_read(ac97, AC97_CM9739_MULTI_CHAN) & (1 << 4); in patch_cm9739()
3128 if (! (ac97->ext_id & AC97_EI_SPDIF)) in patch_cm9739()
3130 snd_ac97_write_cache(ac97, AC97_CM9739_MULTI_CHAN, val); in patch_cm9739()
3133 snd_ac97_write_cache(ac97, 0x70, 0x0100); in patch_cm9739()
3134 snd_ac97_write_cache(ac97, 0x72, 0x0020); 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()
3139 snd_ac97_write_cache(ac97, AC97_CM9739_SPDIF_CTRL, in patch_cm9739()
3140 snd_ac97_read(ac97, AC97_CM9739_SPDIF_CTRL) & ~0x01); in patch_cm9739()
3141 snd_ac97_write_cache(ac97, AC97_CM9739_MULTI_CHAN, in patch_cm9739()
3142 snd_ac97_read(ac97, AC97_CM9739_MULTI_CHAN) | (1 << 14)); in patch_cm9739()
3152 static void cm9761_update_jacks(struct snd_ac97 *ac97) in cm9761_update_jacks() argument
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()
3184 snd_ac97_update_bits(ac97, AC97_CM9761_MULTI_CHAN, 0x3c88, val); in cm9761_update_jacks()
3201 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in cm9761_spdif_out_source_get() local
3203 if (ac97->regs[AC97_CM9761_FUNC] & 0x1) in cm9761_spdif_out_source_get()
3205 else if (ac97->regs[AC97_CM9761_SPDIF_CTRL] & 0x2) in cm9761_spdif_out_source_get()
3214 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); in cm9761_spdif_out_source_put() local
3217 return snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0x1); in cm9761_spdif_out_source_put()
3218 snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0); in cm9761_spdif_out_source_put()
3219 return snd_ac97_update_bits(ac97, AC97_CM9761_SPDIF_CTRL, 0x2, in cm9761_spdif_out_source_put()
3247 static int patch_cm9761_post_spdif(struct snd_ac97 * ac97) in patch_cm9761_post_spdif() argument
3249 …return patch_build_controls(ac97, snd_ac97_cm9761_controls_spdif, ARRAY_SIZE(snd_ac97_cm9761_contr… in patch_cm9761_post_spdif()
3252 static int patch_cm9761_specific(struct snd_ac97 * ac97) in patch_cm9761_specific() argument
3254 return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls)); in patch_cm9761_specific()
3263 static int patch_cm9761(struct snd_ac97 *ac97) in patch_cm9761() argument
3271 ac97->flags |= /*AC97_HAS_NO_MASTER_VOL |*/ AC97_HAS_NO_PCM_VOL; in patch_cm9761()
3272 snd_ac97_write_cache(ac97, AC97_MASTER, 0x8808); in patch_cm9761()
3273 snd_ac97_write_cache(ac97, AC97_PCM, 0x8808); 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()
3279 val = snd_ac97_read(ac97, AC97_INT_PAGING); in patch_cm9761()
3280 snd_ac97_write_cache(ac97, AC97_INT_PAGING, (val & ~0x0f) | 0x01); in patch_cm9761()
3281 tmp = snd_ac97_read(ac97, 0x60); in patch_cm9761()
3282 ac97->spec.dev_flags = tmp & 1; /* revision B? */ in patch_cm9761()
3283 snd_ac97_write_cache(ac97, AC97_INT_PAGING, val); 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()
3291 ac97->ext_id |= AC97_EI_SPDIF; in patch_cm9761()
3293 snd_ac97_write_cache(ac97, AC97_EXTENDED_STATUS, 0x05c0); 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()
3317 if (ac97->spec.dev_flags) in patch_cm9761()
3322 val = snd_ac97_read(ac97, AC97_CM9761_MULTI_CHAN); in patch_cm9761()
3324 snd_ac97_write_cache(ac97, AC97_CM9761_MULTI_CHAN, val); in patch_cm9761()
3327 snd_ac97_write_cache(ac97, 0x70, 0x0100); in patch_cm9761()
3328 snd_ac97_write_cache(ac97, 0x72, 0x0020); in patch_cm9761()
3350 static int patch_cm9780_specific(struct snd_ac97 *ac97) in patch_cm9780_specific() argument
3352 return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls)); in patch_cm9780_specific()
3360 static int patch_cm9780(struct snd_ac97 *ac97) in patch_cm9780() argument
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()
3369 val = snd_ac97_read(ac97, AC97_CM9780_SPDIF); in patch_cm9780()
3371 snd_ac97_write_cache(ac97, AC97_CM9780_SPDIF, val); in patch_cm9780()
3384 static int patch_vt1613_specific(struct snd_ac97 *ac97) in patch_vt1613_specific() argument
3386 return patch_build_controls(ac97, &snd_ac97_controls_vt1613[0], in patch_vt1613_specific()
3394 static int patch_vt1613(struct snd_ac97 *ac97) in patch_vt1613() argument
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()
3431 static struct snd_kcontrol *snd_ac97_find_mixer_ctl(struct snd_ac97 *ac97, in snd_ac97_find_mixer_ctl() argument
3434 return snd_ctl_find_id_mixer(ac97->bus->card, name); in snd_ac97_find_mixer_ctl()
3438 static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, in snd_ac97_add_vmaster() argument
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()
3455 static int patch_vt1616_specific(struct snd_ac97 * ac97) in patch_vt1616_specific() argument
3460 if (snd_ac97_try_bit(ac97, 0x5a, 9)) { in patch_vt1616_specific()
3461 err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[0], 1); in patch_vt1616_specific()
3465 …err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[1], ARRAY_SIZE(snd_ac97_controls_vt1616… in patch_vt1616_specific()
3470 kctl = snd_ac97_find_mixer_ctl(ac97, "Master Playback Volume"); in patch_vt1616_specific()
3474 snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Front Playback"); in patch_vt1616_specific()
3476 err = snd_ac97_add_vmaster(ac97, "Master Playback Volume", in patch_vt1616_specific()
3481 err = snd_ac97_add_vmaster(ac97, "Master Playback Switch", in patch_vt1616_specific()
3493 static int patch_vt1616(struct snd_ac97 * ac97) in patch_vt1616() argument
3495 ac97->build_ops = &patch_vt1616_ops; in patch_vt1616()
3589 static int patch_vt1617a(struct snd_ac97 * ac97) in patch_vt1617a() argument
3597 err = patch_build_controls(ac97, &snd_ac97_controls_vt1617a[0], in patch_vt1617a()
3606 val = snd_ac97_read(ac97, 0x5c); in patch_vt1617a()
3608 snd_ac97_write_cache(ac97, 0x5c, 0x20); in patch_vt1617a()
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()
3804 static int patch_vt1618(struct snd_ac97 *ac97) in patch_vt1618() argument
3806 return patch_build_controls(ac97, snd_ac97_controls_vt1618, in patch_vt1618()
3812 static void it2646_update_jacks(struct snd_ac97 *ac97) in it2646_update_jacks() argument
3815 snd_ac97_update_bits(ac97, 0x76, 1 << 9, in it2646_update_jacks()
3816 is_shared_surrout(ac97) ? (1<<9) : 0); in it2646_update_jacks()
3818 snd_ac97_update_bits(ac97, 0x76, 1 << 10, in it2646_update_jacks()
3819 is_shared_clfeout(ac97) ? (1<<10) : 0); in it2646_update_jacks()
3833 static int patch_it2646_specific(struct snd_ac97 * ac97) in patch_it2646_specific() argument
3836 err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646)); in patch_it2646_specific()
3839 …err = patch_build_controls(ac97, snd_ac97_spdif_controls_it2646, ARRAY_SIZE(snd_ac97_spdif_control… in patch_it2646_specific()
3850 static int patch_it2646(struct snd_ac97 * ac97) in patch_it2646() argument
3852 ac97->build_ops = &patch_it2646_ops; in patch_it2646()
3854 snd_ac97_write_cache(ac97, 0x5E, 0x0808); in patch_it2646()
3855 snd_ac97_write_cache(ac97, 0x7A, 0x0808); in patch_it2646()
3870 static int patch_si3036_specific(struct snd_ac97 * ac97) in patch_si3036_specific() argument
3874 err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_si3036[idx], ac97)); in patch_si3036_specific()
3885 static int mpatch_si3036(struct snd_ac97 * ac97) in mpatch_si3036() argument
3887 ac97->build_ops = &patch_si3036_ops; in mpatch_si3036()
3888 snd_ac97_write_cache(ac97, 0x5c, 0xf210 ); in mpatch_si3036()
3889 snd_ac97_write_cache(ac97, 0x68, 0); in mpatch_si3036()
3917 static int patch_lm4550(struct snd_ac97 *ac97) in patch_lm4550() argument
3919 ac97->res_table = lm4550_restbl; in patch_lm4550()