aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_patch.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ac97/ac97_patch.h')
-rw-r--r--sound/pci/ac97/ac97_patch.h110
1 files changed, 69 insertions, 41 deletions
diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h
index 555d1c9a98fd..fd341ce63762 100644
--- a/sound/pci/ac97/ac97_patch.h
+++ b/sound/pci/ac97/ac97_patch.h
@@ -22,44 +22,72 @@
22 * 22 *
23 */ 23 */
24 24
25int patch_yamaha_ymf753(struct snd_ac97 * ac97); 25#define AC97_SINGLE_VALUE(reg,shift,mask,invert) \
26int patch_wolfson00(struct snd_ac97 * ac97); 26 ((reg) | ((shift) << 8) | ((shift) << 12) | ((mask) << 16) | \
27int patch_wolfson03(struct snd_ac97 * ac97); 27 ((invert) << 24))
28int patch_wolfson04(struct snd_ac97 * ac97); 28#define AC97_PAGE_SINGLE_VALUE(reg,shift,mask,invert,page) \
29int patch_wolfson05(struct snd_ac97 * ac97); 29 (AC97_SINGLE_VALUE(reg,shift,mask,invert) | (1<<25) | ((page) << 26))
30int patch_wolfson11(struct snd_ac97 * ac97); 30#define AC97_SINGLE(xname, reg, shift, mask, invert) \
31int patch_wolfson13(struct snd_ac97 * ac97); 31{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
32int patch_tritech_tr28028(struct snd_ac97 * ac97); 32 .info = snd_ac97_info_volsw, \
33int patch_sigmatel_stac9700(struct snd_ac97 * ac97); 33 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
34int patch_sigmatel_stac9708(struct snd_ac97 * ac97); 34 .private_value = AC97_SINGLE_VALUE(reg, shift, mask, invert) }
35int patch_sigmatel_stac9721(struct snd_ac97 * ac97); 35#define AC97_PAGE_SINGLE(xname, reg, shift, mask, invert, page) \
36int patch_sigmatel_stac9744(struct snd_ac97 * ac97); 36{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
37int patch_sigmatel_stac9756(struct snd_ac97 * ac97); 37 .info = snd_ac97_info_volsw, \
38int patch_sigmatel_stac9758(struct snd_ac97 * ac97); 38 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
39int patch_cirrus_cs4299(struct snd_ac97 * ac97); 39 .private_value = AC97_PAGE_SINGLE_VALUE(reg, shift, mask, invert, page) }
40int patch_cirrus_spdif(struct snd_ac97 * ac97); 40#define AC97_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \
41int patch_conexant(struct snd_ac97 * ac97); 41{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
42int patch_cx20551(struct snd_ac97 * ac97); 42 .info = snd_ac97_info_volsw, \
43int patch_ad1819(struct snd_ac97 * ac97); 43 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
44int patch_ad1881(struct snd_ac97 * ac97); 44 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
45int patch_ad1885(struct snd_ac97 * ac97); 45
46int patch_ad1886(struct snd_ac97 * ac97); 46/* enum control */
47int patch_ad1888(struct snd_ac97 * ac97); 47struct ac97_enum {
48int patch_ad1980(struct snd_ac97 * ac97); 48 unsigned char reg;
49int patch_ad1981a(struct snd_ac97 * ac97); 49 unsigned char shift_l;
50int patch_ad1981b(struct snd_ac97 * ac97); 50 unsigned char shift_r;
51int patch_ad1985(struct snd_ac97 * ac97); 51 unsigned short mask;
52int patch_ad1986(struct snd_ac97 * ac97); 52 const char **texts;
53int patch_alc650(struct snd_ac97 * ac97); 53};
54int patch_alc655(struct snd_ac97 * ac97); 54
55int patch_alc850(struct snd_ac97 * ac97); 55#define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
56int patch_cm9738(struct snd_ac97 * ac97); 56{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
57int patch_cm9739(struct snd_ac97 * ac97); 57 .mask = xmask, .texts = xtexts }
58int patch_cm9761(struct snd_ac97 * ac97); 58#define AC97_ENUM_SINGLE(xreg, xshift, xmask, xtexts) \
59int patch_cm9780(struct snd_ac97 * ac97); 59 AC97_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xtexts)
60int patch_vt1616(struct snd_ac97 * ac97); 60#define AC97_ENUM(xname, xenum) \
61int patch_vt1617a(struct snd_ac97 * ac97); 61{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
62int patch_it2646(struct snd_ac97 * ac97); 62 .info = snd_ac97_info_enum_double, \
63int patch_ucb1400(struct snd_ac97 * ac97); 63 .get = snd_ac97_get_enum_double, .put = snd_ac97_put_enum_double, \
64int mpatch_si3036(struct snd_ac97 * ac97); 64 .private_value = (unsigned long)&xenum }
65int patch_lm4550(struct snd_ac97 * ac97); 65
66/* ac97_codec.c */
67static const struct snd_kcontrol_new snd_ac97_controls_3d[];
68static const struct snd_kcontrol_new snd_ac97_controls_spdif[];
69static struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template,
70 struct snd_ac97 * ac97);
71static int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol,
72 struct snd_ctl_elem_info *uinfo);
73static int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol,
74 struct snd_ctl_elem_value *ucontrol);
75static int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol,
76 struct snd_ctl_elem_value *ucontrol);
77static int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit);
78static int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name,
79 const char *suffix);
80static int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src,
81 const char *dst, const char *suffix);
82static int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1,
83 const char *s2, const char *suffix);
84static void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src,
85 const char *dst);
86static void snd_ac97_restore_status(struct snd_ac97 *ac97);
87static void snd_ac97_restore_iec958(struct snd_ac97 *ac97);
88static int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol,
89 struct snd_ctl_elem_info *uinfo);
90static int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol,
91 struct snd_ctl_elem_value *ucontrol);
92static int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol,
93 struct snd_ctl_elem_value *ucontrol);