25 #define AC97_SINGLE_VALUE(reg,shift,mask,invert) \
26 ((reg) | ((shift) << 8) | ((shift) << 12) | ((mask) << 16) | \
28 #define AC97_PAGE_SINGLE_VALUE(reg,shift,mask,invert,page) \
29 (AC97_SINGLE_VALUE(reg,shift,mask,invert) | (1<<25) | ((page) << 26))
30 #define AC97_SINGLE(xname, reg, shift, mask, invert) \
31 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
32 .info = snd_ac97_info_volsw, \
33 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
34 .private_value = AC97_SINGLE_VALUE(reg, shift, mask, invert) }
35 #define AC97_PAGE_SINGLE(xname, reg, shift, mask, invert, page) \
36 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
37 .info = snd_ac97_info_volsw, \
38 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
39 .private_value = AC97_PAGE_SINGLE_VALUE(reg, shift, mask, invert, page) }
40 #define AC97_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \
41 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
42 .info = snd_ac97_info_volsw, \
43 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
44 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
55 #define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
56 { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
57 .mask = xmask, .texts = xtexts }
58 #define AC97_ENUM_SINGLE(xreg, xshift, xmask, xtexts) \
59 AC97_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xtexts)
60 #define AC97_ENUM(xname, xenum) \
61 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
62 .info = snd_ac97_info_enum_double, \
63 .get = snd_ac97_get_enum_double, .put = snd_ac97_put_enum_double, \
64 .private_value = (unsigned long)&xenum }
71 static int snd_ac97_info_volsw(
struct snd_kcontrol *kcontrol,
73 static int snd_ac97_get_volsw(
struct snd_kcontrol *kcontrol,
75 static int snd_ac97_put_volsw(
struct snd_kcontrol *kcontrol,
77 static int snd_ac97_try_bit(
struct snd_ac97 * ac97,
int reg,
int bit);
78 static int snd_ac97_remove_ctl(
struct snd_ac97 *ac97,
const char *
name,
80 static int snd_ac97_rename_ctl(
struct snd_ac97 *ac97,
const char *
src,
81 const char *
dst,
const char *suffix);
82 static int snd_ac97_swap_ctl(
struct snd_ac97 *ac97,
const char *
s1,
83 const char *
s2,
const char *suffix);
84 static void snd_ac97_rename_vol_ctl(
struct snd_ac97 *ac97,
const char *
src,
87 static void snd_ac97_restore_status(
struct snd_ac97 *ac97);
88 static void snd_ac97_restore_iec958(
struct snd_ac97 *ac97);
90 static int snd_ac97_info_enum_double(
struct snd_kcontrol *kcontrol,
92 static int snd_ac97_get_enum_double(
struct snd_kcontrol *kcontrol,
94 static int snd_ac97_put_enum_double(
struct snd_kcontrol *kcontrol,