22 #include <linux/time.h>
23 #include <linux/wait.h>
32 #define GF1_SINGLE(xname, xindex, shift, invert) \
33 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
34 .info = snd_gf1_info_single, \
35 .get = snd_gf1_get_single, .put = snd_gf1_put_single, \
36 .private_value = shift | (invert << 8) }
38 #define snd_gf1_info_single snd_ctl_boolean_mono_info
48 ucontrol->
value.integer.value[0] ^= 1;
59 unsigned char oval, nval;
61 nval = ucontrol->
value.integer.value[0] & 1;
67 nval = (oval & ~(1 << shift)) | nval;
68 change = nval != oval;
70 outb(gus->
gf1.active_voice = 0,
GUSP(gus, GF1PAGE));
71 spin_unlock_irqrestore(&gus->
reg_lock, flags);
75 #define ICS_DOUBLE(xname, xindex, addr) \
76 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
77 .info = snd_ics_info_double, \
78 .get = snd_ics_get_double, .put = snd_ics_put_double, \
79 .private_value = addr }
98 left = gus->
gf1.ics_regs[
addr][0];
99 right = gus->
gf1.ics_regs[
addr][1];
100 spin_unlock_irqrestore(&gus->
reg_lock, flags);
101 ucontrol->
value.integer.value[0] = left & 127;
102 ucontrol->
value.integer.value[1] = right & 127;
112 unsigned char val1, val2, oval1, oval2,
tmp;
114 val1 = ucontrol->
value.integer.value[0] & 127;
115 val2 = ucontrol->
value.integer.value[1] & 127;
117 oval1 = gus->
gf1.ics_regs[
addr][0];
118 oval2 = gus->
gf1.ics_regs[
addr][1];
119 change = val1 != oval1 || val2 != oval2;
120 gus->
gf1.ics_regs[
addr][0] = val1;
121 gus->
gf1.ics_regs[
addr][1] = val2;
129 outb(addr | 0,
GUSP(gus, MIXCNTRLPORT));
131 outb(addr | 2,
GUSP(gus, MIXCNTRLPORT));
132 outb((
unsigned char) val1,
GUSP(gus, MIXDATAPORT));
133 outb(addr | 1,
GUSP(gus, MIXCNTRLPORT));
135 outb(addr | 3,
GUSP(gus, MIXCNTRLPORT));
136 outb((
unsigned char) val2,
GUSP(gus, MIXDATAPORT));
137 spin_unlock_irqrestore(&gus->
reg_lock, flags);
142 GF1_SINGLE(
"Master Playback Switch", 0, 1, 1),
148 GF1_SINGLE(
"Master Playback Switch", 0, 1, 1),
182 for (idx = 0; idx <
max; idx++) {
187 for (idx = 0; idx <
ARRAY_SIZE(snd_ics_controls); idx++) {