diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/synth/emux/emux.c | 29 | ||||
-rw-r--r-- | sound/synth/emux/emux_effect.c | 44 | ||||
-rw-r--r-- | sound/synth/emux/emux_hwdep.c | 23 | ||||
-rw-r--r-- | sound/synth/emux/emux_nrpn.c | 30 | ||||
-rw-r--r-- | sound/synth/emux/emux_oss.c | 90 | ||||
-rw-r--r-- | sound/synth/emux/emux_proc.c | 14 | ||||
-rw-r--r-- | sound/synth/emux/emux_seq.c | 74 | ||||
-rw-r--r-- | sound/synth/emux/emux_synth.c | 139 | ||||
-rw-r--r-- | sound/synth/emux/emux_voice.h | 67 | ||||
-rw-r--r-- | sound/synth/emux/soundfont.c | 248 | ||||
-rw-r--r-- | sound/synth/util_mem.c | 39 |
11 files changed, 427 insertions, 370 deletions
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index 2aacd8a884e5..7c8e328fae62 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c | |||
@@ -35,9 +35,9 @@ MODULE_LICENSE("GPL"); | |||
35 | /* | 35 | /* |
36 | * create a new hardware dependent device for Emu8000/Emu10k1 | 36 | * create a new hardware dependent device for Emu8000/Emu10k1 |
37 | */ | 37 | */ |
38 | int snd_emux_new(snd_emux_t **remu) | 38 | int snd_emux_new(struct snd_emux **remu) |
39 | { | 39 | { |
40 | snd_emux_t *emu; | 40 | struct snd_emux *emu; |
41 | 41 | ||
42 | *remu = NULL; | 42 | *remu = NULL; |
43 | emu = kzalloc(sizeof(*emu), GFP_KERNEL); | 43 | emu = kzalloc(sizeof(*emu), GFP_KERNEL); |
@@ -66,33 +66,33 @@ int snd_emux_new(snd_emux_t **remu) | |||
66 | 66 | ||
67 | /* | 67 | /* |
68 | */ | 68 | */ |
69 | static int sf_sample_new(void *private_data, snd_sf_sample_t *sp, | 69 | static int sf_sample_new(void *private_data, struct snd_sf_sample *sp, |
70 | snd_util_memhdr_t *hdr, | 70 | struct snd_util_memhdr *hdr, |
71 | const void __user *buf, long count) | 71 | const void __user *buf, long count) |
72 | { | 72 | { |
73 | snd_emux_t *emu = private_data; | 73 | struct snd_emux *emu = private_data; |
74 | return emu->ops.sample_new(emu, sp, hdr, buf, count); | 74 | return emu->ops.sample_new(emu, sp, hdr, buf, count); |
75 | 75 | ||
76 | } | 76 | } |
77 | 77 | ||
78 | static int sf_sample_free(void *private_data, snd_sf_sample_t *sp, | 78 | static int sf_sample_free(void *private_data, struct snd_sf_sample *sp, |
79 | snd_util_memhdr_t *hdr) | 79 | struct snd_util_memhdr *hdr) |
80 | { | 80 | { |
81 | snd_emux_t *emu = private_data; | 81 | struct snd_emux *emu = private_data; |
82 | return emu->ops.sample_free(emu, sp, hdr); | 82 | return emu->ops.sample_free(emu, sp, hdr); |
83 | 83 | ||
84 | } | 84 | } |
85 | 85 | ||
86 | static void sf_sample_reset(void *private_data) | 86 | static void sf_sample_reset(void *private_data) |
87 | { | 87 | { |
88 | snd_emux_t *emu = private_data; | 88 | struct snd_emux *emu = private_data; |
89 | emu->ops.sample_reset(emu); | 89 | emu->ops.sample_reset(emu); |
90 | } | 90 | } |
91 | 91 | ||
92 | int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) | 92 | int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name) |
93 | { | 93 | { |
94 | int err; | 94 | int err; |
95 | snd_sf_callback_t sf_cb; | 95 | struct snd_sf_callback sf_cb; |
96 | 96 | ||
97 | snd_assert(emu->hw != NULL, return -EINVAL); | 97 | snd_assert(emu->hw != NULL, return -EINVAL); |
98 | snd_assert(emu->max_voices > 0, return -EINVAL); | 98 | snd_assert(emu->max_voices > 0, return -EINVAL); |
@@ -101,7 +101,8 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) | |||
101 | 101 | ||
102 | emu->card = card; | 102 | emu->card = card; |
103 | emu->name = kstrdup(name, GFP_KERNEL); | 103 | emu->name = kstrdup(name, GFP_KERNEL); |
104 | emu->voices = kcalloc(emu->max_voices, sizeof(snd_emux_voice_t), GFP_KERNEL); | 104 | emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), |
105 | GFP_KERNEL); | ||
105 | if (emu->voices == NULL) | 106 | if (emu->voices == NULL) |
106 | return -ENOMEM; | 107 | return -ENOMEM; |
107 | 108 | ||
@@ -138,7 +139,7 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) | |||
138 | 139 | ||
139 | /* | 140 | /* |
140 | */ | 141 | */ |
141 | int snd_emux_free(snd_emux_t *emu) | 142 | int snd_emux_free(struct snd_emux *emu) |
142 | { | 143 | { |
143 | unsigned long flags; | 144 | unsigned long flags; |
144 | 145 | ||
diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c index 4764940f11a0..a447218b6160 100644 --- a/sound/synth/emux/emux_effect.c +++ b/sound/synth/emux/emux_effect.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define xoffsetof(type,tag) ((long)(&((type)NULL)->tag) - (long)(NULL)) | 33 | #define xoffsetof(type,tag) ((long)(&((type)NULL)->tag) - (long)(NULL)) |
34 | 34 | ||
35 | #define parm_offset(tag) xoffsetof(soundfont_voice_parm_t*, tag) | 35 | #define parm_offset(tag) xoffsetof(struct soundfont_voice_parm *, tag) |
36 | 36 | ||
37 | #define PARM_IS_BYTE (1 << 0) | 37 | #define PARM_IS_BYTE (1 << 0) |
38 | #define PARM_IS_WORD (1 << 1) | 38 | #define PARM_IS_WORD (1 << 1) |
@@ -97,10 +97,10 @@ static struct emux_parm_defs { | |||
97 | 97 | ||
98 | /* set byte effect value */ | 98 | /* set byte effect value */ |
99 | static void | 99 | static void |
100 | effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type) | 100 | effect_set_byte(unsigned char *valp, struct snd_midi_channel *chan, int type) |
101 | { | 101 | { |
102 | short effect; | 102 | short effect; |
103 | snd_emux_effect_table_t *fx = chan->private; | 103 | struct snd_emux_effect_table *fx = chan->private; |
104 | 104 | ||
105 | effect = fx->val[type]; | 105 | effect = fx->val[type]; |
106 | if (fx->flag[type] == EMUX_FX_FLAG_ADD) { | 106 | if (fx->flag[type] == EMUX_FX_FLAG_ADD) { |
@@ -118,10 +118,10 @@ effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type) | |||
118 | 118 | ||
119 | /* set word effect value */ | 119 | /* set word effect value */ |
120 | static void | 120 | static void |
121 | effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type) | 121 | effect_set_word(unsigned short *valp, struct snd_midi_channel *chan, int type) |
122 | { | 122 | { |
123 | int effect; | 123 | int effect; |
124 | snd_emux_effect_table_t *fx = chan->private; | 124 | struct snd_emux_effect_table *fx = chan->private; |
125 | 125 | ||
126 | effect = *(unsigned short*)&fx->val[type]; | 126 | effect = *(unsigned short*)&fx->val[type]; |
127 | if (fx->flag[type] == EMUX_FX_FLAG_ADD) | 127 | if (fx->flag[type] == EMUX_FX_FLAG_ADD) |
@@ -135,10 +135,10 @@ effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type) | |||
135 | 135 | ||
136 | /* address offset */ | 136 | /* address offset */ |
137 | static int | 137 | static int |
138 | effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode) | 138 | effect_get_offset(struct snd_midi_channel *chan, int lo, int hi, int mode) |
139 | { | 139 | { |
140 | int addr = 0; | 140 | int addr = 0; |
141 | snd_emux_effect_table_t *fx = chan->private; | 141 | struct snd_emux_effect_table *fx = chan->private; |
142 | 142 | ||
143 | if (fx->flag[hi]) | 143 | if (fx->flag[hi]) |
144 | addr = (short)fx->val[hi]; | 144 | addr = (short)fx->val[hi]; |
@@ -153,7 +153,8 @@ effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode) | |||
153 | #ifdef CONFIG_SND_SEQUENCER_OSS | 153 | #ifdef CONFIG_SND_SEQUENCER_OSS |
154 | /* change effects - for OSS sequencer compatibility */ | 154 | /* change effects - for OSS sequencer compatibility */ |
155 | void | 155 | void |
156 | snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val) | 156 | snd_emux_send_effect_oss(struct snd_emux_port *port, |
157 | struct snd_midi_channel *chan, int type, int val) | ||
157 | { | 158 | { |
158 | int mode; | 159 | int mode; |
159 | 160 | ||
@@ -173,13 +174,14 @@ snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int ty | |||
173 | * if update is necessary, call emu8000_control | 174 | * if update is necessary, call emu8000_control |
174 | */ | 175 | */ |
175 | void | 176 | void |
176 | snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode) | 177 | snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan, |
178 | int type, int val, int mode) | ||
177 | { | 179 | { |
178 | int i; | 180 | int i; |
179 | int offset; | 181 | int offset; |
180 | unsigned char *srcp, *origp; | 182 | unsigned char *srcp, *origp; |
181 | snd_emux_t *emu; | 183 | struct snd_emux *emu; |
182 | snd_emux_effect_table_t *fx; | 184 | struct snd_emux_effect_table *fx; |
183 | unsigned long flags; | 185 | unsigned long flags; |
184 | 186 | ||
185 | emu = port->emu; | 187 | emu = port->emu; |
@@ -206,7 +208,7 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, | |||
206 | /* modify the register values */ | 208 | /* modify the register values */ |
207 | spin_lock_irqsave(&emu->voice_lock, flags); | 209 | spin_lock_irqsave(&emu->voice_lock, flags); |
208 | for (i = 0; i < emu->max_voices; i++) { | 210 | for (i = 0; i < emu->max_voices; i++) { |
209 | snd_emux_voice_t *vp = &emu->voices[i]; | 211 | struct snd_emux_voice *vp = &emu->voices[i]; |
210 | if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan) | 212 | if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan) |
211 | continue; | 213 | continue; |
212 | srcp = (unsigned char*)&vp->reg.parm + offset; | 214 | srcp = (unsigned char*)&vp->reg.parm + offset; |
@@ -228,10 +230,10 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, | |||
228 | 230 | ||
229 | /* copy wavetable registers to voice table */ | 231 | /* copy wavetable registers to voice table */ |
230 | void | 232 | void |
231 | snd_emux_setup_effect(snd_emux_voice_t *vp) | 233 | snd_emux_setup_effect(struct snd_emux_voice *vp) |
232 | { | 234 | { |
233 | snd_midi_channel_t *chan = vp->chan; | 235 | struct snd_midi_channel *chan = vp->chan; |
234 | snd_emux_effect_table_t *fx; | 236 | struct snd_emux_effect_table *fx; |
235 | unsigned char *srcp; | 237 | unsigned char *srcp; |
236 | int i; | 238 | int i; |
237 | 239 | ||
@@ -275,10 +277,11 @@ snd_emux_setup_effect(snd_emux_voice_t *vp) | |||
275 | * effect table | 277 | * effect table |
276 | */ | 278 | */ |
277 | void | 279 | void |
278 | snd_emux_create_effect(snd_emux_port_t *p) | 280 | snd_emux_create_effect(struct snd_emux_port *p) |
279 | { | 281 | { |
280 | int i; | 282 | int i; |
281 | p->effect = kcalloc(p->chset.max_channels, sizeof(snd_emux_effect_table_t), GFP_KERNEL); | 283 | p->effect = kcalloc(p->chset.max_channels, |
284 | sizeof(struct snd_emux_effect_table), GFP_KERNEL); | ||
282 | if (p->effect) { | 285 | if (p->effect) { |
283 | for (i = 0; i < p->chset.max_channels; i++) | 286 | for (i = 0; i < p->chset.max_channels; i++) |
284 | p->chset.channels[i].private = p->effect + i; | 287 | p->chset.channels[i].private = p->effect + i; |
@@ -289,17 +292,18 @@ snd_emux_create_effect(snd_emux_port_t *p) | |||
289 | } | 292 | } |
290 | 293 | ||
291 | void | 294 | void |
292 | snd_emux_delete_effect(snd_emux_port_t *p) | 295 | snd_emux_delete_effect(struct snd_emux_port *p) |
293 | { | 296 | { |
294 | kfree(p->effect); | 297 | kfree(p->effect); |
295 | p->effect = NULL; | 298 | p->effect = NULL; |
296 | } | 299 | } |
297 | 300 | ||
298 | void | 301 | void |
299 | snd_emux_clear_effect(snd_emux_port_t *p) | 302 | snd_emux_clear_effect(struct snd_emux_port *p) |
300 | { | 303 | { |
301 | if (p->effect) { | 304 | if (p->effect) { |
302 | memset(p->effect, 0, sizeof(snd_emux_effect_table_t) * p->chset.max_channels); | 305 | memset(p->effect, 0, sizeof(struct snd_emux_effect_table) * |
306 | p->chset.max_channels); | ||
303 | } | 307 | } |
304 | } | 308 | } |
305 | 309 | ||
diff --git a/sound/synth/emux/emux_hwdep.c b/sound/synth/emux/emux_hwdep.c index 4182b44eb47e..9b63814c3f64 100644 --- a/sound/synth/emux/emux_hwdep.c +++ b/sound/synth/emux/emux_hwdep.c | |||
@@ -29,7 +29,7 @@ | |||
29 | * open the hwdep device | 29 | * open the hwdep device |
30 | */ | 30 | */ |
31 | static int | 31 | static int |
32 | snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file) | 32 | snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file) |
33 | { | 33 | { |
34 | return 0; | 34 | return 0; |
35 | } | 35 | } |
@@ -39,7 +39,7 @@ snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file) | |||
39 | * close the device | 39 | * close the device |
40 | */ | 40 | */ |
41 | static int | 41 | static int |
42 | snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file) | 42 | snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file) |
43 | { | 43 | { |
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
@@ -51,10 +51,10 @@ snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file) | |||
51 | * load patch | 51 | * load patch |
52 | */ | 52 | */ |
53 | static int | 53 | static int |
54 | snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg) | 54 | snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg) |
55 | { | 55 | { |
56 | int err; | 56 | int err; |
57 | soundfont_patch_info_t patch; | 57 | struct soundfont_patch_info patch; |
58 | 58 | ||
59 | if (copy_from_user(&patch, arg, sizeof(patch))) | 59 | if (copy_from_user(&patch, arg, sizeof(patch))) |
60 | return -EFAULT; | 60 | return -EFAULT; |
@@ -77,9 +77,9 @@ snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg) | |||
77 | * set misc mode | 77 | * set misc mode |
78 | */ | 78 | */ |
79 | static int | 79 | static int |
80 | snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg) | 80 | snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg) |
81 | { | 81 | { |
82 | struct sndrv_emux_misc_mode info; | 82 | struct snd_emux_misc_mode info; |
83 | int i; | 83 | int i; |
84 | 84 | ||
85 | if (copy_from_user(&info, arg, sizeof(info))) | 85 | if (copy_from_user(&info, arg, sizeof(info))) |
@@ -102,9 +102,10 @@ snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg) | |||
102 | * ioctl | 102 | * ioctl |
103 | */ | 103 | */ |
104 | static int | 104 | static int |
105 | snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg) | 105 | snd_emux_hwdep_ioctl(struct snd_hwdep * hw, struct file *file, |
106 | unsigned int cmd, unsigned long arg) | ||
106 | { | 107 | { |
107 | snd_emux_t *emu = hw->private_data; | 108 | struct snd_emux *emu = hw->private_data; |
108 | 109 | ||
109 | switch (cmd) { | 110 | switch (cmd) { |
110 | case SNDRV_EMUX_IOCTL_VERSION: | 111 | case SNDRV_EMUX_IOCTL_VERSION: |
@@ -136,9 +137,9 @@ snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsi | |||
136 | */ | 137 | */ |
137 | 138 | ||
138 | int | 139 | int |
139 | snd_emux_init_hwdep(snd_emux_t *emu) | 140 | snd_emux_init_hwdep(struct snd_emux *emu) |
140 | { | 141 | { |
141 | snd_hwdep_t *hw; | 142 | struct snd_hwdep *hw; |
142 | int err; | 143 | int err; |
143 | 144 | ||
144 | if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0) | 145 | if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0) |
@@ -162,7 +163,7 @@ snd_emux_init_hwdep(snd_emux_t *emu) | |||
162 | * unregister | 163 | * unregister |
163 | */ | 164 | */ |
164 | void | 165 | void |
165 | snd_emux_delete_hwdep(snd_emux_t *emu) | 166 | snd_emux_delete_hwdep(struct snd_emux *emu) |
166 | { | 167 | { |
167 | if (emu->hwdep) { | 168 | if (emu->hwdep) { |
168 | snd_device_free(emu->card, emu->hwdep); | 169 | snd_device_free(emu->card, emu->hwdep); |
diff --git a/sound/synth/emux/emux_nrpn.c b/sound/synth/emux/emux_nrpn.c index 25edff9e1fc2..c6917ba2c934 100644 --- a/sound/synth/emux/emux_nrpn.c +++ b/sound/synth/emux/emux_nrpn.c | |||
@@ -27,11 +27,11 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* NRPN / CC -> Emu8000 parameter converter */ | 29 | /* NRPN / CC -> Emu8000 parameter converter */ |
30 | typedef struct { | 30 | struct nrpn_conv_table { |
31 | int control; | 31 | int control; |
32 | int effect; | 32 | int effect; |
33 | int (*convert)(int val); | 33 | int (*convert)(int val); |
34 | } nrpn_conv_table; | 34 | }; |
35 | 35 | ||
36 | /* effect sensitivity */ | 36 | /* effect sensitivity */ |
37 | 37 | ||
@@ -48,8 +48,9 @@ typedef struct { | |||
48 | * convert NRPN/control values | 48 | * convert NRPN/control values |
49 | */ | 49 | */ |
50 | 50 | ||
51 | static int send_converted_effect(nrpn_conv_table *table, int num_tables, | 51 | static int send_converted_effect(struct nrpn_conv_table *table, int num_tables, |
52 | snd_emux_port_t *port, snd_midi_channel_t *chan, | 52 | struct snd_emux_port *port, |
53 | struct snd_midi_channel *chan, | ||
53 | int type, int val, int mode) | 54 | int type, int val, int mode) |
54 | { | 55 | { |
55 | int i, cval; | 56 | int i, cval; |
@@ -178,7 +179,7 @@ static int fx_conv_Q(int val) | |||
178 | } | 179 | } |
179 | 180 | ||
180 | 181 | ||
181 | static nrpn_conv_table awe_effects[] = | 182 | static struct nrpn_conv_table awe_effects[] = |
182 | { | 183 | { |
183 | { 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay}, | 184 | { 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay}, |
184 | { 1, EMUX_FX_LFO1_FREQ, fx_lfo1_freq}, | 185 | { 1, EMUX_FX_LFO1_FREQ, fx_lfo1_freq}, |
@@ -265,7 +266,7 @@ static int gs_vib_delay(int val) | |||
265 | return -(val - 64) * gs_sense[FX_VIBDELAY] / 50; | 266 | return -(val - 64) * gs_sense[FX_VIBDELAY] / 50; |
266 | } | 267 | } |
267 | 268 | ||
268 | static nrpn_conv_table gs_effects[] = | 269 | static struct nrpn_conv_table gs_effects[] = |
269 | { | 270 | { |
270 | {32, EMUX_FX_CUTOFF, gs_cutoff}, | 271 | {32, EMUX_FX_CUTOFF, gs_cutoff}, |
271 | {33, EMUX_FX_FILTERQ, gs_filterQ}, | 272 | {33, EMUX_FX_FILTERQ, gs_filterQ}, |
@@ -282,9 +283,10 @@ static nrpn_conv_table gs_effects[] = | |||
282 | * NRPN events | 283 | * NRPN events |
283 | */ | 284 | */ |
284 | void | 285 | void |
285 | snd_emux_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset) | 286 | snd_emux_nrpn(void *p, struct snd_midi_channel *chan, |
287 | struct snd_midi_channel_set *chset) | ||
286 | { | 288 | { |
287 | snd_emux_port_t *port; | 289 | struct snd_emux_port *port; |
288 | 290 | ||
289 | port = p; | 291 | port = p; |
290 | snd_assert(port != NULL, return); | 292 | snd_assert(port != NULL, return); |
@@ -348,7 +350,7 @@ static int xg_release(int val) | |||
348 | return -(val - 64) * xg_sense[FX_RELEASE] / 64; | 350 | return -(val - 64) * xg_sense[FX_RELEASE] / 64; |
349 | } | 351 | } |
350 | 352 | ||
351 | static nrpn_conv_table xg_effects[] = | 353 | static struct nrpn_conv_table xg_effects[] = |
352 | { | 354 | { |
353 | {71, EMUX_FX_CUTOFF, xg_cutoff}, | 355 | {71, EMUX_FX_CUTOFF, xg_cutoff}, |
354 | {74, EMUX_FX_FILTERQ, xg_filterQ}, | 356 | {74, EMUX_FX_FILTERQ, xg_filterQ}, |
@@ -357,7 +359,8 @@ static nrpn_conv_table xg_effects[] = | |||
357 | }; | 359 | }; |
358 | 360 | ||
359 | int | 361 | int |
360 | snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param) | 362 | snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan, |
363 | int param) | ||
361 | { | 364 | { |
362 | return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), | 365 | return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), |
363 | port, chan, param, | 366 | port, chan, param, |
@@ -369,10 +372,11 @@ snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param) | |||
369 | * receive sysex | 372 | * receive sysex |
370 | */ | 373 | */ |
371 | void | 374 | void |
372 | snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset) | 375 | snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, |
376 | struct snd_midi_channel_set *chset) | ||
373 | { | 377 | { |
374 | snd_emux_port_t *port; | 378 | struct snd_emux_port *port; |
375 | snd_emux_t *emu; | 379 | struct snd_emux *emu; |
376 | 380 | ||
377 | port = p; | 381 | port = p; |
378 | snd_assert(port != NULL, return); | 382 | snd_assert(port != NULL, return); |
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c index 5272f4ac8afd..dfbfcfbe5dd2 100644 --- a/sound/synth/emux/emux_oss.c +++ b/sound/synth/emux/emux_oss.c | |||
@@ -31,19 +31,25 @@ | |||
31 | #include "emux_voice.h" | 31 | #include "emux_voice.h" |
32 | #include <sound/asoundef.h> | 32 | #include <sound/asoundef.h> |
33 | 33 | ||
34 | static int snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure); | 34 | static int snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure); |
35 | static int snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg); | 35 | static int snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg); |
36 | static int snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg); | 36 | static int snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, |
37 | static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count); | 37 | unsigned long ioarg); |
38 | static int snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg); | 38 | static int snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format, |
39 | static int snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); | 39 | const char __user *buf, int offs, int count); |
40 | static void reset_port_mode(snd_emux_port_t *port, int midi_mode); | 40 | static int snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg); |
41 | static void emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop); | 41 | static int snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, |
42 | static void gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop); | 42 | void *private, int atomic, int hop); |
43 | static void fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop); | 43 | static void reset_port_mode(struct snd_emux_port *port, int midi_mode); |
44 | static void emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, | ||
45 | int cmd, unsigned char *event, int atomic, int hop); | ||
46 | static void gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, | ||
47 | int cmd, unsigned char *event, int atomic, int hop); | ||
48 | static void fake_event(struct snd_emux *emu, struct snd_emux_port *port, | ||
49 | int ch, int param, int val, int atomic, int hop); | ||
44 | 50 | ||
45 | /* operators */ | 51 | /* operators */ |
46 | static snd_seq_oss_callback_t oss_callback = { | 52 | static struct snd_seq_oss_callback oss_callback = { |
47 | .owner = THIS_MODULE, | 53 | .owner = THIS_MODULE, |
48 | .open = snd_emux_open_seq_oss, | 54 | .open = snd_emux_open_seq_oss, |
49 | .close = snd_emux_close_seq_oss, | 55 | .close = snd_emux_close_seq_oss, |
@@ -58,13 +64,13 @@ static snd_seq_oss_callback_t oss_callback = { | |||
58 | */ | 64 | */ |
59 | 65 | ||
60 | void | 66 | void |
61 | snd_emux_init_seq_oss(snd_emux_t *emu) | 67 | snd_emux_init_seq_oss(struct snd_emux *emu) |
62 | { | 68 | { |
63 | snd_seq_oss_reg_t *arg; | 69 | struct snd_seq_oss_reg *arg; |
64 | snd_seq_device_t *dev; | 70 | struct snd_seq_device *dev; |
65 | 71 | ||
66 | if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS, | 72 | if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS, |
67 | sizeof(snd_seq_oss_reg_t), &dev) < 0) | 73 | sizeof(struct snd_seq_oss_reg), &dev) < 0) |
68 | return; | 74 | return; |
69 | 75 | ||
70 | emu->oss_synth = dev; | 76 | emu->oss_synth = dev; |
@@ -85,7 +91,7 @@ snd_emux_init_seq_oss(snd_emux_t *emu) | |||
85 | * unregister | 91 | * unregister |
86 | */ | 92 | */ |
87 | void | 93 | void |
88 | snd_emux_detach_seq_oss(snd_emux_t *emu) | 94 | snd_emux_detach_seq_oss(struct snd_emux *emu) |
89 | { | 95 | { |
90 | if (emu->oss_synth) { | 96 | if (emu->oss_synth) { |
91 | snd_device_free(emu->card, emu->oss_synth); | 97 | snd_device_free(emu->card, emu->oss_synth); |
@@ -101,11 +107,11 @@ snd_emux_detach_seq_oss(snd_emux_t *emu) | |||
101 | * open port for OSS sequencer | 107 | * open port for OSS sequencer |
102 | */ | 108 | */ |
103 | static int | 109 | static int |
104 | snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure) | 110 | snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure) |
105 | { | 111 | { |
106 | snd_emux_t *emu; | 112 | struct snd_emux *emu; |
107 | snd_emux_port_t *p; | 113 | struct snd_emux_port *p; |
108 | snd_seq_port_callback_t callback; | 114 | struct snd_seq_port_callback callback; |
109 | char tmpname[64]; | 115 | char tmpname[64]; |
110 | 116 | ||
111 | emu = closure; | 117 | emu = closure; |
@@ -153,7 +159,7 @@ snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure) | |||
153 | * reset port mode | 159 | * reset port mode |
154 | */ | 160 | */ |
155 | static void | 161 | static void |
156 | reset_port_mode(snd_emux_port_t *port, int midi_mode) | 162 | reset_port_mode(struct snd_emux_port *port, int midi_mode) |
157 | { | 163 | { |
158 | if (midi_mode) { | 164 | if (midi_mode) { |
159 | port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI; | 165 | port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI; |
@@ -173,10 +179,10 @@ reset_port_mode(snd_emux_port_t *port, int midi_mode) | |||
173 | * close port | 179 | * close port |
174 | */ | 180 | */ |
175 | static int | 181 | static int |
176 | snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg) | 182 | snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg) |
177 | { | 183 | { |
178 | snd_emux_t *emu; | 184 | struct snd_emux *emu; |
179 | snd_emux_port_t *p; | 185 | struct snd_emux_port *p; |
180 | 186 | ||
181 | snd_assert(arg != NULL, return -ENXIO); | 187 | snd_assert(arg != NULL, return -ENXIO); |
182 | p = arg->private_data; | 188 | p = arg->private_data; |
@@ -200,11 +206,11 @@ snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg) | |||
200 | * load patch | 206 | * load patch |
201 | */ | 207 | */ |
202 | static int | 208 | static int |
203 | snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, | 209 | snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format, |
204 | const char __user *buf, int offs, int count) | 210 | const char __user *buf, int offs, int count) |
205 | { | 211 | { |
206 | snd_emux_t *emu; | 212 | struct snd_emux *emu; |
207 | snd_emux_port_t *p; | 213 | struct snd_emux_port *p; |
208 | int rc; | 214 | int rc; |
209 | 215 | ||
210 | snd_assert(arg != NULL, return -ENXIO); | 216 | snd_assert(arg != NULL, return -ENXIO); |
@@ -218,7 +224,7 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, | |||
218 | rc = snd_soundfont_load_guspatch(emu->sflist, buf, count, | 224 | rc = snd_soundfont_load_guspatch(emu->sflist, buf, count, |
219 | SF_CLIENT_NO(p->chset.port)); | 225 | SF_CLIENT_NO(p->chset.port)); |
220 | else if (format == SNDRV_OSS_SOUNDFONT_PATCH) { | 226 | else if (format == SNDRV_OSS_SOUNDFONT_PATCH) { |
221 | soundfont_patch_info_t patch; | 227 | struct soundfont_patch_info patch; |
222 | if (count < (int)sizeof(patch)) | 228 | if (count < (int)sizeof(patch)) |
223 | rc = -EINVAL; | 229 | rc = -EINVAL; |
224 | if (copy_from_user(&patch, buf, sizeof(patch))) | 230 | if (copy_from_user(&patch, buf, sizeof(patch))) |
@@ -242,10 +248,10 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, | |||
242 | * ioctl | 248 | * ioctl |
243 | */ | 249 | */ |
244 | static int | 250 | static int |
245 | snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg) | 251 | snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg) |
246 | { | 252 | { |
247 | snd_emux_port_t *p; | 253 | struct snd_emux_port *p; |
248 | snd_emux_t *emu; | 254 | struct snd_emux *emu; |
249 | 255 | ||
250 | snd_assert(arg != NULL, return -ENXIO); | 256 | snd_assert(arg != NULL, return -ENXIO); |
251 | p = arg->private_data; | 257 | p = arg->private_data; |
@@ -273,9 +279,9 @@ snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long i | |||
273 | * reset device | 279 | * reset device |
274 | */ | 280 | */ |
275 | static int | 281 | static int |
276 | snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg) | 282 | snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg) |
277 | { | 283 | { |
278 | snd_emux_port_t *p; | 284 | struct snd_emux_port *p; |
279 | 285 | ||
280 | snd_assert(arg != NULL, return -ENXIO); | 286 | snd_assert(arg != NULL, return -ENXIO); |
281 | p = arg->private_data; | 287 | p = arg->private_data; |
@@ -289,11 +295,11 @@ snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg) | |||
289 | * receive raw events: only SEQ_PRIVATE is accepted. | 295 | * receive raw events: only SEQ_PRIVATE is accepted. |
290 | */ | 296 | */ |
291 | static int | 297 | static int |
292 | snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data, | 298 | snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_data, |
293 | int atomic, int hop) | 299 | int atomic, int hop) |
294 | { | 300 | { |
295 | snd_emux_t *emu; | 301 | struct snd_emux *emu; |
296 | snd_emux_port_t *p; | 302 | struct snd_emux_port *p; |
297 | unsigned char cmd, *data; | 303 | unsigned char cmd, *data; |
298 | 304 | ||
299 | p = private_data; | 305 | p = private_data; |
@@ -320,14 +326,14 @@ snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data, | |||
320 | * OSS/AWE driver specific h/w controls | 326 | * OSS/AWE driver specific h/w controls |
321 | */ | 327 | */ |
322 | static void | 328 | static void |
323 | emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, | 329 | emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd, |
324 | unsigned char *event, int atomic, int hop) | 330 | unsigned char *event, int atomic, int hop) |
325 | { | 331 | { |
326 | int voice; | 332 | int voice; |
327 | unsigned short p1; | 333 | unsigned short p1; |
328 | short p2; | 334 | short p2; |
329 | int i; | 335 | int i; |
330 | snd_midi_channel_t *chan; | 336 | struct snd_midi_channel *chan; |
331 | 337 | ||
332 | voice = event[3]; | 338 | voice = event[3]; |
333 | if (voice < 0 || voice >= port->chset.max_channels) | 339 | if (voice < 0 || voice >= port->chset.max_channels) |
@@ -415,14 +421,14 @@ emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, | |||
415 | #include <linux/ultrasound.h> | 421 | #include <linux/ultrasound.h> |
416 | 422 | ||
417 | static void | 423 | static void |
418 | gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, | 424 | gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd, |
419 | unsigned char *event, int atomic, int hop) | 425 | unsigned char *event, int atomic, int hop) |
420 | { | 426 | { |
421 | int voice; | 427 | int voice; |
422 | unsigned short p1; | 428 | unsigned short p1; |
423 | short p2; | 429 | short p2; |
424 | int plong; | 430 | int plong; |
425 | snd_midi_channel_t *chan; | 431 | struct snd_midi_channel *chan; |
426 | 432 | ||
427 | if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH) | 433 | if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH) |
428 | return; | 434 | return; |
@@ -483,9 +489,9 @@ gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, | |||
483 | * send an event to midi emulation | 489 | * send an event to midi emulation |
484 | */ | 490 | */ |
485 | static void | 491 | static void |
486 | fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop) | 492 | fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop) |
487 | { | 493 | { |
488 | snd_seq_event_t ev; | 494 | struct snd_seq_event ev; |
489 | memset(&ev, 0, sizeof(ev)); | 495 | memset(&ev, 0, sizeof(ev)); |
490 | ev.type = SNDRV_SEQ_EVENT_CONTROLLER; | 496 | ev.type = SNDRV_SEQ_EVENT_CONTROLLER; |
491 | ev.data.control.channel = ch; | 497 | ev.data.control.channel = ch; |
diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c index 0f155d68de0d..a70a179f6947 100644 --- a/sound/synth/emux/emux_proc.c +++ b/sound/synth/emux/emux_proc.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #ifdef CONFIG_PROC_FS | 30 | #ifdef CONFIG_PROC_FS |
31 | 31 | ||
32 | static void | 32 | static void |
33 | snd_emux_proc_info_read(snd_info_entry_t *entry, | 33 | snd_emux_proc_info_read(struct snd_info_entry *entry, |
34 | snd_info_buffer_t *buf) | 34 | struct snd_info_buffer *buf) |
35 | { | 35 | { |
36 | snd_emux_t *emu; | 36 | struct snd_emux *emu; |
37 | int i; | 37 | int i; |
38 | 38 | ||
39 | emu = entry->private_data; | 39 | emu = entry->private_data; |
@@ -66,7 +66,7 @@ snd_emux_proc_info_read(snd_info_entry_t *entry, | |||
66 | } | 66 | } |
67 | #if 0 /* debug */ | 67 | #if 0 /* debug */ |
68 | if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) { | 68 | if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) { |
69 | snd_emux_voice_t *vp = &emu->voices[0]; | 69 | struct snd_emux_voice *vp = &emu->voices[0]; |
70 | snd_iprintf(buf, "voice 0: on\n"); | 70 | snd_iprintf(buf, "voice 0: on\n"); |
71 | snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n", | 71 | snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n", |
72 | vp->reg.parm.moddelay, | 72 | vp->reg.parm.moddelay, |
@@ -107,9 +107,9 @@ snd_emux_proc_info_read(snd_info_entry_t *entry, | |||
107 | } | 107 | } |
108 | 108 | ||
109 | 109 | ||
110 | void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device) | 110 | void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device) |
111 | { | 111 | { |
112 | snd_info_entry_t *entry; | 112 | struct snd_info_entry *entry; |
113 | char name[64]; | 113 | char name[64]; |
114 | 114 | ||
115 | sprintf(name, "wavetableD%d", device); | 115 | sprintf(name, "wavetableD%d", device); |
@@ -127,7 +127,7 @@ void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device) | |||
127 | emu->proc = entry; | 127 | emu->proc = entry; |
128 | } | 128 | } |
129 | 129 | ||
130 | void snd_emux_proc_free(snd_emux_t *emu) | 130 | void snd_emux_proc_free(struct snd_emux *emu) |
131 | { | 131 | { |
132 | if (emu->proc) { | 132 | if (emu->proc) { |
133 | snd_info_unregister(emu->proc); | 133 | snd_info_unregister(emu->proc); |
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index 8ccd33f4aa57..f5a832ff362c 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c | |||
@@ -25,15 +25,15 @@ | |||
25 | 25 | ||
26 | /* Prototypes for static functions */ | 26 | /* Prototypes for static functions */ |
27 | static void free_port(void *private); | 27 | static void free_port(void *private); |
28 | static void snd_emux_init_port(snd_emux_port_t *p); | 28 | static void snd_emux_init_port(struct snd_emux_port *p); |
29 | static int snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info); | 29 | static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info); |
30 | static int snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info); | 30 | static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info); |
31 | static int get_client(snd_card_t *card, int index, char *name); | 31 | static int get_client(struct snd_card *card, int index, char *name); |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * MIDI emulation operators | 34 | * MIDI emulation operators |
35 | */ | 35 | */ |
36 | static snd_midi_op_t emux_ops = { | 36 | static struct snd_midi_op emux_ops = { |
37 | snd_emux_note_on, | 37 | snd_emux_note_on, |
38 | snd_emux_note_off, | 38 | snd_emux_note_off, |
39 | snd_emux_key_press, | 39 | snd_emux_key_press, |
@@ -65,10 +65,10 @@ static snd_midi_op_t emux_ops = { | |||
65 | * can connect to these ports to play midi data. | 65 | * can connect to these ports to play midi data. |
66 | */ | 66 | */ |
67 | int | 67 | int |
68 | snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) | 68 | snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index) |
69 | { | 69 | { |
70 | int i; | 70 | int i; |
71 | snd_seq_port_callback_t pinfo; | 71 | struct snd_seq_port_callback pinfo; |
72 | char tmpname[64]; | 72 | char tmpname[64]; |
73 | 73 | ||
74 | sprintf(tmpname, "%s WaveTable", emu->name); | 74 | sprintf(tmpname, "%s WaveTable", emu->name); |
@@ -94,7 +94,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) | |||
94 | pinfo.event_input = snd_emux_event_input; | 94 | pinfo.event_input = snd_emux_event_input; |
95 | 95 | ||
96 | for (i = 0; i < emu->num_ports; i++) { | 96 | for (i = 0; i < emu->num_ports; i++) { |
97 | snd_emux_port_t *p; | 97 | struct snd_emux_port *p; |
98 | 98 | ||
99 | sprintf(tmpname, "%s Port %d", emu->name, i); | 99 | sprintf(tmpname, "%s Port %d", emu->name, i); |
100 | p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, | 100 | p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, |
@@ -119,7 +119,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index) | |||
119 | * destroy the kernel client. | 119 | * destroy the kernel client. |
120 | */ | 120 | */ |
121 | void | 121 | void |
122 | snd_emux_detach_seq(snd_emux_t *emu) | 122 | snd_emux_detach_seq(struct snd_emux *emu) |
123 | { | 123 | { |
124 | if (emu->voices) | 124 | if (emu->voices) |
125 | snd_emux_terminate_all(emu); | 125 | snd_emux_terminate_all(emu); |
@@ -137,12 +137,12 @@ snd_emux_detach_seq(snd_emux_t *emu) | |||
137 | * create a sequencer port and channel_set | 137 | * create a sequencer port and channel_set |
138 | */ | 138 | */ |
139 | 139 | ||
140 | snd_emux_port_t * | 140 | struct snd_emux_port * |
141 | snd_emux_create_port(snd_emux_t *emu, char *name, | 141 | snd_emux_create_port(struct snd_emux *emu, char *name, |
142 | int max_channels, int oss_port, | 142 | int max_channels, int oss_port, |
143 | snd_seq_port_callback_t *callback) | 143 | struct snd_seq_port_callback *callback) |
144 | { | 144 | { |
145 | snd_emux_port_t *p; | 145 | struct snd_emux_port *p; |
146 | int i, type, cap; | 146 | int i, type, cap; |
147 | 147 | ||
148 | /* Allocate structures for this channel */ | 148 | /* Allocate structures for this channel */ |
@@ -150,7 +150,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name, | |||
150 | snd_printk("no memory\n"); | 150 | snd_printk("no memory\n"); |
151 | return NULL; | 151 | return NULL; |
152 | } | 152 | } |
153 | p->chset.channels = kcalloc(max_channels, sizeof(snd_midi_channel_t), GFP_KERNEL); | 153 | p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL); |
154 | if (p->chset.channels == NULL) { | 154 | if (p->chset.channels == NULL) { |
155 | snd_printk("no memory\n"); | 155 | snd_printk("no memory\n"); |
156 | kfree(p); | 156 | kfree(p); |
@@ -190,7 +190,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name, | |||
190 | static void | 190 | static void |
191 | free_port(void *private_data) | 191 | free_port(void *private_data) |
192 | { | 192 | { |
193 | snd_emux_port_t *p; | 193 | struct snd_emux_port *p; |
194 | 194 | ||
195 | p = private_data; | 195 | p = private_data; |
196 | if (p) { | 196 | if (p) { |
@@ -209,7 +209,7 @@ free_port(void *private_data) | |||
209 | * initialize the port specific parameters | 209 | * initialize the port specific parameters |
210 | */ | 210 | */ |
211 | static void | 211 | static void |
212 | snd_emux_init_port(snd_emux_port_t *p) | 212 | snd_emux_init_port(struct snd_emux_port *p) |
213 | { | 213 | { |
214 | p->drum_flags = DEFAULT_DRUM_FLAGS; | 214 | p->drum_flags = DEFAULT_DRUM_FLAGS; |
215 | p->volume_atten = 0; | 215 | p->volume_atten = 0; |
@@ -222,7 +222,7 @@ snd_emux_init_port(snd_emux_port_t *p) | |||
222 | * reset port | 222 | * reset port |
223 | */ | 223 | */ |
224 | void | 224 | void |
225 | snd_emux_reset_port(snd_emux_port_t *port) | 225 | snd_emux_reset_port(struct snd_emux_port *port) |
226 | { | 226 | { |
227 | int i; | 227 | int i; |
228 | 228 | ||
@@ -241,7 +241,7 @@ snd_emux_reset_port(snd_emux_port_t *port) | |||
241 | port->ctrls[EMUX_MD_REALTIME_PAN] = 1; | 241 | port->ctrls[EMUX_MD_REALTIME_PAN] = 1; |
242 | 242 | ||
243 | for (i = 0; i < port->chset.max_channels; i++) { | 243 | for (i = 0; i < port->chset.max_channels; i++) { |
244 | snd_midi_channel_t *chan = port->chset.channels + i; | 244 | struct snd_midi_channel *chan = port->chset.channels + i; |
245 | chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0; | 245 | chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0; |
246 | } | 246 | } |
247 | } | 247 | } |
@@ -251,10 +251,10 @@ snd_emux_reset_port(snd_emux_port_t *port) | |||
251 | * input sequencer event | 251 | * input sequencer event |
252 | */ | 252 | */ |
253 | int | 253 | int |
254 | snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data, | 254 | snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data, |
255 | int atomic, int hop) | 255 | int atomic, int hop) |
256 | { | 256 | { |
257 | snd_emux_port_t *port; | 257 | struct snd_emux_port *port; |
258 | 258 | ||
259 | port = private_data; | 259 | port = private_data; |
260 | snd_assert(port != NULL && ev != NULL, return -EINVAL); | 260 | snd_assert(port != NULL && ev != NULL, return -EINVAL); |
@@ -269,7 +269,7 @@ snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data, | |||
269 | * increment usage count | 269 | * increment usage count |
270 | */ | 270 | */ |
271 | int | 271 | int |
272 | snd_emux_inc_count(snd_emux_t *emu) | 272 | snd_emux_inc_count(struct snd_emux *emu) |
273 | { | 273 | { |
274 | emu->used++; | 274 | emu->used++; |
275 | if (!try_module_get(emu->ops.owner)) | 275 | if (!try_module_get(emu->ops.owner)) |
@@ -288,7 +288,7 @@ snd_emux_inc_count(snd_emux_t *emu) | |||
288 | * decrease usage count | 288 | * decrease usage count |
289 | */ | 289 | */ |
290 | void | 290 | void |
291 | snd_emux_dec_count(snd_emux_t *emu) | 291 | snd_emux_dec_count(struct snd_emux *emu) |
292 | { | 292 | { |
293 | module_put(emu->card->module); | 293 | module_put(emu->card->module); |
294 | emu->used--; | 294 | emu->used--; |
@@ -302,10 +302,10 @@ snd_emux_dec_count(snd_emux_t *emu) | |||
302 | * Routine that is called upon a first use of a particular port | 302 | * Routine that is called upon a first use of a particular port |
303 | */ | 303 | */ |
304 | static int | 304 | static int |
305 | snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info) | 305 | snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info) |
306 | { | 306 | { |
307 | snd_emux_port_t *p; | 307 | struct snd_emux_port *p; |
308 | snd_emux_t *emu; | 308 | struct snd_emux *emu; |
309 | 309 | ||
310 | p = private_data; | 310 | p = private_data; |
311 | snd_assert(p != NULL, return -EINVAL); | 311 | snd_assert(p != NULL, return -EINVAL); |
@@ -323,10 +323,10 @@ snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info) | |||
323 | * Routine that is called upon the last unuse() of a particular port. | 323 | * Routine that is called upon the last unuse() of a particular port. |
324 | */ | 324 | */ |
325 | static int | 325 | static int |
326 | snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info) | 326 | snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info) |
327 | { | 327 | { |
328 | snd_emux_port_t *p; | 328 | struct snd_emux_port *p; |
329 | snd_emux_t *emu; | 329 | struct snd_emux *emu; |
330 | 330 | ||
331 | p = private_data; | 331 | p = private_data; |
332 | snd_assert(p != NULL, return -EINVAL); | 332 | snd_assert(p != NULL, return -EINVAL); |
@@ -345,10 +345,10 @@ snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info) | |||
345 | * Create a sequencer client | 345 | * Create a sequencer client |
346 | */ | 346 | */ |
347 | static int | 347 | static int |
348 | get_client(snd_card_t *card, int index, char *name) | 348 | get_client(struct snd_card *card, int index, char *name) |
349 | { | 349 | { |
350 | snd_seq_client_callback_t callbacks; | 350 | struct snd_seq_client_callback callbacks; |
351 | snd_seq_client_info_t cinfo; | 351 | struct snd_seq_client_info cinfo; |
352 | int client; | 352 | int client; |
353 | 353 | ||
354 | memset(&callbacks, 0, sizeof(callbacks)); | 354 | memset(&callbacks, 0, sizeof(callbacks)); |
@@ -374,7 +374,7 @@ get_client(snd_card_t *card, int index, char *name) | |||
374 | /* | 374 | /* |
375 | * attach virtual rawmidi devices | 375 | * attach virtual rawmidi devices |
376 | */ | 376 | */ |
377 | int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card) | 377 | int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) |
378 | { | 378 | { |
379 | int i; | 379 | int i; |
380 | 380 | ||
@@ -382,13 +382,13 @@ int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card) | |||
382 | if (emu->midi_ports <= 0) | 382 | if (emu->midi_ports <= 0) |
383 | return 0; | 383 | return 0; |
384 | 384 | ||
385 | emu->vmidi = kcalloc(emu->midi_ports, sizeof(snd_rawmidi_t*), GFP_KERNEL); | 385 | emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL); |
386 | if (emu->vmidi == NULL) | 386 | if (emu->vmidi == NULL) |
387 | return -ENOMEM; | 387 | return -ENOMEM; |
388 | 388 | ||
389 | for (i = 0; i < emu->midi_ports; i++) { | 389 | for (i = 0; i < emu->midi_ports; i++) { |
390 | snd_rawmidi_t *rmidi; | 390 | struct snd_rawmidi *rmidi; |
391 | snd_virmidi_dev_t *rdev; | 391 | struct snd_virmidi_dev *rdev; |
392 | if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0) | 392 | if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0) |
393 | goto __error; | 393 | goto __error; |
394 | rdev = rmidi->private_data; | 394 | rdev = rmidi->private_data; |
@@ -411,7 +411,7 @@ __error: | |||
411 | return -ENOMEM; | 411 | return -ENOMEM; |
412 | } | 412 | } |
413 | 413 | ||
414 | int snd_emux_delete_virmidi(snd_emux_t *emu) | 414 | int snd_emux_delete_virmidi(struct snd_emux *emu) |
415 | { | 415 | { |
416 | int i; | 416 | int i; |
417 | 417 | ||
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c index bd71b73be657..c387a83a655e 100644 --- a/sound/synth/emux/emux_synth.c +++ b/sound/synth/emux/emux_synth.c | |||
@@ -36,30 +36,34 @@ | |||
36 | #define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0) | 36 | #define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0) |
37 | #define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0) | 37 | #define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0) |
38 | 38 | ||
39 | static int get_zone(snd_emux_t *emu, snd_emux_port_t *port, int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table); | 39 | static int get_zone(struct snd_emux *emu, struct snd_emux_port *port, |
40 | static int get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan); | 40 | int *notep, int vel, struct snd_midi_channel *chan, |
41 | static void terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free); | 41 | struct snd_sf_zone **table); |
42 | static void exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass); | 42 | static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan); |
43 | static void terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free); | 43 | static void terminate_note1(struct snd_emux *emu, int note, |
44 | static void update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update); | 44 | struct snd_midi_channel *chan, int free); |
45 | static void setup_voice(snd_emux_voice_t *vp); | 45 | static void exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port, |
46 | static int calc_pan(snd_emux_voice_t *vp); | 46 | int exclass); |
47 | static int calc_volume(snd_emux_voice_t *vp); | 47 | static void terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free); |
48 | static int calc_pitch(snd_emux_voice_t *vp); | 48 | static void update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update); |
49 | static void setup_voice(struct snd_emux_voice *vp); | ||
50 | static int calc_pan(struct snd_emux_voice *vp); | ||
51 | static int calc_volume(struct snd_emux_voice *vp); | ||
52 | static int calc_pitch(struct snd_emux_voice *vp); | ||
49 | 53 | ||
50 | 54 | ||
51 | /* | 55 | /* |
52 | * Start a note. | 56 | * Start a note. |
53 | */ | 57 | */ |
54 | void | 58 | void |
55 | snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) | 59 | snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan) |
56 | { | 60 | { |
57 | snd_emux_t *emu; | 61 | struct snd_emux *emu; |
58 | int i, key, nvoices; | 62 | int i, key, nvoices; |
59 | snd_emux_voice_t *vp; | 63 | struct snd_emux_voice *vp; |
60 | snd_sf_zone_t *table[SNDRV_EMUX_MAX_MULTI_VOICES]; | 64 | struct snd_sf_zone *table[SNDRV_EMUX_MAX_MULTI_VOICES]; |
61 | unsigned long flags; | 65 | unsigned long flags; |
62 | snd_emux_port_t *port; | 66 | struct snd_emux_port *port; |
63 | 67 | ||
64 | port = p; | 68 | port = p; |
65 | snd_assert(port != NULL && chan != NULL, return); | 69 | snd_assert(port != NULL && chan != NULL, return); |
@@ -76,7 +80,7 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) | |||
76 | 80 | ||
77 | /* exclusive note off */ | 81 | /* exclusive note off */ |
78 | for (i = 0; i < nvoices; i++) { | 82 | for (i = 0; i < nvoices; i++) { |
79 | snd_sf_zone_t *zp = table[i]; | 83 | struct snd_sf_zone *zp = table[i]; |
80 | if (zp && zp->v.exclusiveClass) | 84 | if (zp && zp->v.exclusiveClass) |
81 | exclusive_note_off(emu, port, zp->v.exclusiveClass); | 85 | exclusive_note_off(emu, port, zp->v.exclusiveClass); |
82 | } | 86 | } |
@@ -138,7 +142,7 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) | |||
138 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT | 142 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT |
139 | if (port->port_mode == SNDRV_EMUX_PORT_MODE_OSS_SYNTH) { | 143 | if (port->port_mode == SNDRV_EMUX_PORT_MODE_OSS_SYNTH) { |
140 | /* clear voice position for the next note on this channel */ | 144 | /* clear voice position for the next note on this channel */ |
141 | snd_emux_effect_table_t *fx = chan->private; | 145 | struct snd_emux_effect_table *fx = chan->private; |
142 | if (fx) { | 146 | if (fx) { |
143 | fx->flag[EMUX_FX_SAMPLE_START] = 0; | 147 | fx->flag[EMUX_FX_SAMPLE_START] = 0; |
144 | fx->flag[EMUX_FX_COARSE_SAMPLE_START] = 0; | 148 | fx->flag[EMUX_FX_COARSE_SAMPLE_START] = 0; |
@@ -151,13 +155,13 @@ snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) | |||
151 | * Release a note in response to a midi note off. | 155 | * Release a note in response to a midi note off. |
152 | */ | 156 | */ |
153 | void | 157 | void |
154 | snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan) | 158 | snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan) |
155 | { | 159 | { |
156 | int ch; | 160 | int ch; |
157 | snd_emux_t *emu; | 161 | struct snd_emux *emu; |
158 | snd_emux_voice_t *vp; | 162 | struct snd_emux_voice *vp; |
159 | unsigned long flags; | 163 | unsigned long flags; |
160 | snd_emux_port_t *port; | 164 | struct snd_emux_port *port; |
161 | 165 | ||
162 | port = p; | 166 | port = p; |
163 | snd_assert(port != NULL && chan != NULL, return); | 167 | snd_assert(port != NULL && chan != NULL, return); |
@@ -199,8 +203,8 @@ snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan) | |||
199 | */ | 203 | */ |
200 | void snd_emux_timer_callback(unsigned long data) | 204 | void snd_emux_timer_callback(unsigned long data) |
201 | { | 205 | { |
202 | snd_emux_t *emu = (snd_emux_t*) data; | 206 | struct snd_emux *emu = (struct snd_emux *) data; |
203 | snd_emux_voice_t *vp; | 207 | struct snd_emux_voice *vp; |
204 | int ch, do_again = 0; | 208 | int ch, do_again = 0; |
205 | 209 | ||
206 | spin_lock(&emu->voice_lock); | 210 | spin_lock(&emu->voice_lock); |
@@ -228,13 +232,13 @@ void snd_emux_timer_callback(unsigned long data) | |||
228 | * key pressure change | 232 | * key pressure change |
229 | */ | 233 | */ |
230 | void | 234 | void |
231 | snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan) | 235 | snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan) |
232 | { | 236 | { |
233 | int ch; | 237 | int ch; |
234 | snd_emux_t *emu; | 238 | struct snd_emux *emu; |
235 | snd_emux_voice_t *vp; | 239 | struct snd_emux_voice *vp; |
236 | unsigned long flags; | 240 | unsigned long flags; |
237 | snd_emux_port_t *port; | 241 | struct snd_emux_port *port; |
238 | 242 | ||
239 | port = p; | 243 | port = p; |
240 | snd_assert(port != NULL && chan != NULL, return); | 244 | snd_assert(port != NULL && chan != NULL, return); |
@@ -260,10 +264,10 @@ snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan) | |||
260 | * Modulate the voices which belong to the channel | 264 | * Modulate the voices which belong to the channel |
261 | */ | 265 | */ |
262 | void | 266 | void |
263 | snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update) | 267 | snd_emux_update_channel(struct snd_emux_port *port, struct snd_midi_channel *chan, int update) |
264 | { | 268 | { |
265 | snd_emux_t *emu; | 269 | struct snd_emux *emu; |
266 | snd_emux_voice_t *vp; | 270 | struct snd_emux_voice *vp; |
267 | int i; | 271 | int i; |
268 | unsigned long flags; | 272 | unsigned long flags; |
269 | 273 | ||
@@ -287,10 +291,10 @@ snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int upd | |||
287 | * Modulate all the voices which belong to the port. | 291 | * Modulate all the voices which belong to the port. |
288 | */ | 292 | */ |
289 | void | 293 | void |
290 | snd_emux_update_port(snd_emux_port_t *port, int update) | 294 | snd_emux_update_port(struct snd_emux_port *port, int update) |
291 | { | 295 | { |
292 | snd_emux_t *emu; | 296 | struct snd_emux *emu; |
293 | snd_emux_voice_t *vp; | 297 | struct snd_emux_voice *vp; |
294 | int i; | 298 | int i; |
295 | unsigned long flags; | 299 | unsigned long flags; |
296 | 300 | ||
@@ -316,9 +320,9 @@ snd_emux_update_port(snd_emux_port_t *port, int update) | |||
316 | * control events, not just the midi controllers | 320 | * control events, not just the midi controllers |
317 | */ | 321 | */ |
318 | void | 322 | void |
319 | snd_emux_control(void *p, int type, snd_midi_channel_t *chan) | 323 | snd_emux_control(void *p, int type, struct snd_midi_channel *chan) |
320 | { | 324 | { |
321 | snd_emux_port_t *port; | 325 | struct snd_emux_port *port; |
322 | 326 | ||
323 | port = p; | 327 | port = p; |
324 | snd_assert(port != NULL && chan != NULL, return); | 328 | snd_assert(port != NULL && chan != NULL, return); |
@@ -364,10 +368,10 @@ snd_emux_control(void *p, int type, snd_midi_channel_t *chan) | |||
364 | * terminate note - if free flag is true, free the terminated voice | 368 | * terminate note - if free flag is true, free the terminated voice |
365 | */ | 369 | */ |
366 | static void | 370 | static void |
367 | terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free) | 371 | terminate_note1(struct snd_emux *emu, int note, struct snd_midi_channel *chan, int free) |
368 | { | 372 | { |
369 | int i; | 373 | int i; |
370 | snd_emux_voice_t *vp; | 374 | struct snd_emux_voice *vp; |
371 | unsigned long flags; | 375 | unsigned long flags; |
372 | 376 | ||
373 | spin_lock_irqsave(&emu->voice_lock, flags); | 377 | spin_lock_irqsave(&emu->voice_lock, flags); |
@@ -385,10 +389,10 @@ terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free) | |||
385 | * terminate note - exported for midi emulation | 389 | * terminate note - exported for midi emulation |
386 | */ | 390 | */ |
387 | void | 391 | void |
388 | snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan) | 392 | snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan) |
389 | { | 393 | { |
390 | snd_emux_t *emu; | 394 | struct snd_emux *emu; |
391 | snd_emux_port_t *port; | 395 | struct snd_emux_port *port; |
392 | 396 | ||
393 | port = p; | 397 | port = p; |
394 | snd_assert(port != NULL && chan != NULL, return); | 398 | snd_assert(port != NULL && chan != NULL, return); |
@@ -405,10 +409,10 @@ snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan) | |||
405 | * Terminate all the notes | 409 | * Terminate all the notes |
406 | */ | 410 | */ |
407 | void | 411 | void |
408 | snd_emux_terminate_all(snd_emux_t *emu) | 412 | snd_emux_terminate_all(struct snd_emux *emu) |
409 | { | 413 | { |
410 | int i; | 414 | int i; |
411 | snd_emux_voice_t *vp; | 415 | struct snd_emux_voice *vp; |
412 | unsigned long flags; | 416 | unsigned long flags; |
413 | 417 | ||
414 | spin_lock_irqsave(&emu->voice_lock, flags); | 418 | spin_lock_irqsave(&emu->voice_lock, flags); |
@@ -434,11 +438,11 @@ snd_emux_terminate_all(snd_emux_t *emu) | |||
434 | * Terminate all voices associated with the given port | 438 | * Terminate all voices associated with the given port |
435 | */ | 439 | */ |
436 | void | 440 | void |
437 | snd_emux_sounds_off_all(snd_emux_port_t *port) | 441 | snd_emux_sounds_off_all(struct snd_emux_port *port) |
438 | { | 442 | { |
439 | int i; | 443 | int i; |
440 | snd_emux_t *emu; | 444 | struct snd_emux *emu; |
441 | snd_emux_voice_t *vp; | 445 | struct snd_emux_voice *vp; |
442 | unsigned long flags; | 446 | unsigned long flags; |
443 | 447 | ||
444 | snd_assert(port != NULL, return); | 448 | snd_assert(port != NULL, return); |
@@ -468,9 +472,9 @@ snd_emux_sounds_off_all(snd_emux_port_t *port) | |||
468 | * is mainly for drums. | 472 | * is mainly for drums. |
469 | */ | 473 | */ |
470 | static void | 474 | static void |
471 | exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass) | 475 | exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port, int exclass) |
472 | { | 476 | { |
473 | snd_emux_voice_t *vp; | 477 | struct snd_emux_voice *vp; |
474 | int i; | 478 | int i; |
475 | unsigned long flags; | 479 | unsigned long flags; |
476 | 480 | ||
@@ -490,7 +494,7 @@ exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass) | |||
490 | * if free flag is true, call free_voice after termination | 494 | * if free flag is true, call free_voice after termination |
491 | */ | 495 | */ |
492 | static void | 496 | static void |
493 | terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free) | 497 | terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free) |
494 | { | 498 | { |
495 | emu->ops.terminate(vp); | 499 | emu->ops.terminate(vp); |
496 | vp->time = emu->use_time++; | 500 | vp->time = emu->use_time++; |
@@ -508,7 +512,7 @@ terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free) | |||
508 | * Modulate the voice | 512 | * Modulate the voice |
509 | */ | 513 | */ |
510 | static void | 514 | static void |
511 | update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update) | 515 | update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update) |
512 | { | 516 | { |
513 | if (!STATE_IS_PLAYING(vp->state)) | 517 | if (!STATE_IS_PLAYING(vp->state)) |
514 | return; | 518 | return; |
@@ -543,9 +547,9 @@ static unsigned short voltarget[16] = { | |||
543 | * will be needed later. | 547 | * will be needed later. |
544 | */ | 548 | */ |
545 | static void | 549 | static void |
546 | setup_voice(snd_emux_voice_t *vp) | 550 | setup_voice(struct snd_emux_voice *vp) |
547 | { | 551 | { |
548 | soundfont_voice_parm_t *parm; | 552 | struct soundfont_voice_parm *parm; |
549 | int pitch; | 553 | int pitch; |
550 | 554 | ||
551 | /* copy the original register values */ | 555 | /* copy the original register values */ |
@@ -636,9 +640,9 @@ static unsigned char pan_volumes[256] = { | |||
636 | }; | 640 | }; |
637 | 641 | ||
638 | static int | 642 | static int |
639 | calc_pan(snd_emux_voice_t *vp) | 643 | calc_pan(struct snd_emux_voice *vp) |
640 | { | 644 | { |
641 | snd_midi_channel_t *chan = vp->chan; | 645 | struct snd_midi_channel *chan = vp->chan; |
642 | int pan; | 646 | int pan; |
643 | 647 | ||
644 | /* pan & loop start (pan 8bit, MSB, 0:right, 0xff:left) */ | 648 | /* pan & loop start (pan 8bit, MSB, 0:right, 0xff:left) */ |
@@ -737,12 +741,12 @@ static unsigned char expressiontab[128] = { | |||
737 | * voice and channels parameters. | 741 | * voice and channels parameters. |
738 | */ | 742 | */ |
739 | static int | 743 | static int |
740 | calc_volume(snd_emux_voice_t *vp) | 744 | calc_volume(struct snd_emux_voice *vp) |
741 | { | 745 | { |
742 | int vol; | 746 | int vol; |
743 | int main_vol, expression_vol, master_vol; | 747 | int main_vol, expression_vol, master_vol; |
744 | snd_midi_channel_t *chan = vp->chan; | 748 | struct snd_midi_channel *chan = vp->chan; |
745 | snd_emux_port_t *port = vp->port; | 749 | struct snd_emux_port *port = vp->port; |
746 | 750 | ||
747 | expression_vol = chan->control[MIDI_CTL_MSB_EXPRESSION]; | 751 | expression_vol = chan->control[MIDI_CTL_MSB_EXPRESSION]; |
748 | LIMITMAX(vp->velocity, 127); | 752 | LIMITMAX(vp->velocity, 127); |
@@ -775,7 +779,7 @@ calc_volume(snd_emux_voice_t *vp) | |||
775 | 779 | ||
776 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT | 780 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT |
777 | if (chan->private) { | 781 | if (chan->private) { |
778 | snd_emux_effect_table_t *fx = chan->private; | 782 | struct snd_emux_effect_table *fx = chan->private; |
779 | vol += fx->val[EMUX_FX_ATTEN]; | 783 | vol += fx->val[EMUX_FX_ATTEN]; |
780 | } | 784 | } |
781 | #endif | 785 | #endif |
@@ -808,9 +812,9 @@ calc_volume(snd_emux_voice_t *vp) | |||
808 | */ | 812 | */ |
809 | 813 | ||
810 | static int | 814 | static int |
811 | calc_pitch(snd_emux_voice_t *vp) | 815 | calc_pitch(struct snd_emux_voice *vp) |
812 | { | 816 | { |
813 | snd_midi_channel_t *chan = vp->chan; | 817 | struct snd_midi_channel *chan = vp->chan; |
814 | int offset; | 818 | int offset; |
815 | 819 | ||
816 | /* calculate offset */ | 820 | /* calculate offset */ |
@@ -837,7 +841,7 @@ calc_pitch(snd_emux_voice_t *vp) | |||
837 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT | 841 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT |
838 | /* add initial pitch correction */ | 842 | /* add initial pitch correction */ |
839 | if (chan->private) { | 843 | if (chan->private) { |
840 | snd_emux_effect_table_t *fx = chan->private; | 844 | struct snd_emux_effect_table *fx = chan->private; |
841 | if (fx->flag[EMUX_FX_INIT_PITCH]) | 845 | if (fx->flag[EMUX_FX_INIT_PITCH]) |
842 | offset += fx->val[EMUX_FX_INIT_PITCH]; | 846 | offset += fx->val[EMUX_FX_INIT_PITCH]; |
843 | } | 847 | } |
@@ -857,7 +861,7 @@ calc_pitch(snd_emux_voice_t *vp) | |||
857 | * Get the bank number assigned to the channel | 861 | * Get the bank number assigned to the channel |
858 | */ | 862 | */ |
859 | static int | 863 | static int |
860 | get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan) | 864 | get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan) |
861 | { | 865 | { |
862 | int val; | 866 | int val; |
863 | 867 | ||
@@ -886,8 +890,9 @@ get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan) | |||
886 | * The resultant zones are stored on table. | 890 | * The resultant zones are stored on table. |
887 | */ | 891 | */ |
888 | static int | 892 | static int |
889 | get_zone(snd_emux_t *emu, snd_emux_port_t *port, | 893 | get_zone(struct snd_emux *emu, struct snd_emux_port *port, |
890 | int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table) | 894 | int *notep, int vel, struct snd_midi_channel *chan, |
895 | struct snd_sf_zone **table) | ||
891 | { | 896 | { |
892 | int preset, bank, def_preset, def_bank; | 897 | int preset, bank, def_preset, def_bank; |
893 | 898 | ||
@@ -910,9 +915,9 @@ get_zone(snd_emux_t *emu, snd_emux_port_t *port, | |||
910 | /* | 915 | /* |
911 | */ | 916 | */ |
912 | void | 917 | void |
913 | snd_emux_init_voices(snd_emux_t *emu) | 918 | snd_emux_init_voices(struct snd_emux *emu) |
914 | { | 919 | { |
915 | snd_emux_voice_t *vp; | 920 | struct snd_emux_voice *vp; |
916 | int i; | 921 | int i; |
917 | unsigned long flags; | 922 | unsigned long flags; |
918 | 923 | ||
@@ -932,7 +937,7 @@ snd_emux_init_voices(snd_emux_t *emu) | |||
932 | 937 | ||
933 | /* | 938 | /* |
934 | */ | 939 | */ |
935 | void snd_emux_lock_voice(snd_emux_t *emu, int voice) | 940 | void snd_emux_lock_voice(struct snd_emux *emu, int voice) |
936 | { | 941 | { |
937 | unsigned long flags; | 942 | unsigned long flags; |
938 | 943 | ||
@@ -947,7 +952,7 @@ void snd_emux_lock_voice(snd_emux_t *emu, int voice) | |||
947 | 952 | ||
948 | /* | 953 | /* |
949 | */ | 954 | */ |
950 | void snd_emux_unlock_voice(snd_emux_t *emu, int voice) | 955 | void snd_emux_unlock_voice(struct snd_emux *emu, int voice) |
951 | { | 956 | { |
952 | unsigned long flags; | 957 | unsigned long flags; |
953 | 958 | ||
diff --git a/sound/synth/emux/emux_voice.h b/sound/synth/emux/emux_voice.h index 67eb55348cdf..0a56ca18b165 100644 --- a/sound/synth/emux/emux_voice.h +++ b/sound/synth/emux/emux_voice.h | |||
@@ -29,60 +29,69 @@ | |||
29 | #include <sound/emux_synth.h> | 29 | #include <sound/emux_synth.h> |
30 | 30 | ||
31 | /* Prototypes for emux_seq.c */ | 31 | /* Prototypes for emux_seq.c */ |
32 | int snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index); | 32 | int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index); |
33 | void snd_emux_detach_seq(snd_emux_t *emu); | 33 | void snd_emux_detach_seq(struct snd_emux *emu); |
34 | snd_emux_port_t *snd_emux_create_port(snd_emux_t *emu, char *name, int max_channels, int type, snd_seq_port_callback_t *callback); | 34 | struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name, |
35 | void snd_emux_reset_port(snd_emux_port_t *port); | 35 | int max_channels, int type, |
36 | int snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); | 36 | struct snd_seq_port_callback *callback); |
37 | int snd_emux_inc_count(snd_emux_t *emu); | 37 | void snd_emux_reset_port(struct snd_emux_port *port); |
38 | void snd_emux_dec_count(snd_emux_t *emu); | 38 | int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private, |
39 | int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card); | 39 | int atomic, int hop); |
40 | int snd_emux_delete_virmidi(snd_emux_t *emu); | 40 | int snd_emux_inc_count(struct snd_emux *emu); |
41 | void snd_emux_dec_count(struct snd_emux *emu); | ||
42 | int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card); | ||
43 | int snd_emux_delete_virmidi(struct snd_emux *emu); | ||
41 | 44 | ||
42 | /* Prototypes for emux_synth.c */ | 45 | /* Prototypes for emux_synth.c */ |
43 | void snd_emux_init_voices(snd_emux_t *emu); | 46 | void snd_emux_init_voices(struct snd_emux *emu); |
44 | 47 | ||
45 | void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); | 48 | void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); |
46 | void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); | 49 | void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); |
47 | void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); | 50 | void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); |
48 | void snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan); | 51 | void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan); |
49 | void snd_emux_control(void *p, int type, struct snd_midi_channel *chan); | 52 | void snd_emux_control(void *p, int type, struct snd_midi_channel *chan); |
50 | 53 | ||
51 | void snd_emux_sounds_off_all(snd_emux_port_t *port); | 54 | void snd_emux_sounds_off_all(struct snd_emux_port *port); |
52 | void snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update); | 55 | void snd_emux_update_channel(struct snd_emux_port *port, |
53 | void snd_emux_update_port(snd_emux_port_t *port, int update); | 56 | struct snd_midi_channel *chan, int update); |
57 | void snd_emux_update_port(struct snd_emux_port *port, int update); | ||
54 | 58 | ||
55 | void snd_emux_timer_callback(unsigned long data); | 59 | void snd_emux_timer_callback(unsigned long data); |
56 | 60 | ||
57 | /* emux_effect.c */ | 61 | /* emux_effect.c */ |
58 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT | 62 | #ifdef SNDRV_EMUX_USE_RAW_EFFECT |
59 | void snd_emux_create_effect(snd_emux_port_t *p); | 63 | void snd_emux_create_effect(struct snd_emux_port *p); |
60 | void snd_emux_delete_effect(snd_emux_port_t *p); | 64 | void snd_emux_delete_effect(struct snd_emux_port *p); |
61 | void snd_emux_clear_effect(snd_emux_port_t *p); | 65 | void snd_emux_clear_effect(struct snd_emux_port *p); |
62 | void snd_emux_setup_effect(snd_emux_voice_t *vp); | 66 | void snd_emux_setup_effect(struct snd_emux_voice *vp); |
63 | void snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val); | 67 | void snd_emux_send_effect_oss(struct snd_emux_port *port, |
64 | void snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode); | 68 | struct snd_midi_channel *chan, int type, int val); |
69 | void snd_emux_send_effect(struct snd_emux_port *port, | ||
70 | struct snd_midi_channel *chan, int type, int val, int mode); | ||
65 | #endif | 71 | #endif |
66 | 72 | ||
67 | /* emux_nrpn.c */ | 73 | /* emux_nrpn.c */ |
68 | void snd_emux_sysex(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); | 74 | void snd_emux_sysex(void *private_data, unsigned char *buf, int len, |
69 | int snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param); | 75 | int parsed, struct snd_midi_channel_set *chset); |
70 | void snd_emux_nrpn(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); | 76 | int snd_emux_xg_control(struct snd_emux_port *port, |
77 | struct snd_midi_channel *chan, int param); | ||
78 | void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan, | ||
79 | struct snd_midi_channel_set *chset); | ||
71 | 80 | ||
72 | /* emux_oss.c */ | 81 | /* emux_oss.c */ |
73 | void snd_emux_init_seq_oss(snd_emux_t *emu); | 82 | void snd_emux_init_seq_oss(struct snd_emux *emu); |
74 | void snd_emux_detach_seq_oss(snd_emux_t *emu); | 83 | void snd_emux_detach_seq_oss(struct snd_emux *emu); |
75 | 84 | ||
76 | /* emux_proc.c */ | 85 | /* emux_proc.c */ |
77 | #ifdef CONFIG_PROC_FS | 86 | #ifdef CONFIG_PROC_FS |
78 | void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device); | 87 | void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device); |
79 | void snd_emux_proc_free(snd_emux_t *emu); | 88 | void snd_emux_proc_free(struct snd_emux *emu); |
80 | #endif | 89 | #endif |
81 | 90 | ||
82 | #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) | 91 | #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) |
83 | 92 | ||
84 | /* emux_hwdep.c */ | 93 | /* emux_hwdep.c */ |
85 | int snd_emux_init_hwdep(snd_emux_t *emu); | 94 | int snd_emux_init_hwdep(struct snd_emux *emu); |
86 | void snd_emux_delete_hwdep(snd_emux_t *emu); | 95 | void snd_emux_delete_hwdep(struct snd_emux *emu); |
87 | 96 | ||
88 | #endif | 97 | #endif |
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c index d0925ea50838..4c5754d4a2e8 100644 --- a/sound/synth/emux/soundfont.c +++ b/sound/synth/emux/soundfont.c | |||
@@ -34,38 +34,49 @@ | |||
34 | 34 | ||
35 | /* Prototypes for static functions */ | 35 | /* Prototypes for static functions */ |
36 | 36 | ||
37 | static int open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client); | 37 | static int open_patch(struct snd_sf_list *sflist, const char __user *data, |
38 | static snd_soundfont_t *newsf(snd_sf_list_t *sflist, int type, char *name); | 38 | int count, int client); |
39 | static int is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name); | 39 | static struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name); |
40 | static int close_patch(snd_sf_list_t *sflist); | 40 | static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name); |
41 | static int probe_data(snd_sf_list_t *sflist, int sample_id); | 41 | static int close_patch(struct snd_sf_list *sflist); |
42 | static void set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp); | 42 | static int probe_data(struct snd_sf_list *sflist, int sample_id); |
43 | static snd_sf_zone_t *sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf); | 43 | static void set_zone_counter(struct snd_sf_list *sflist, |
44 | static void set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp); | 44 | struct snd_soundfont *sf, struct snd_sf_zone *zp); |
45 | static snd_sf_sample_t *sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf); | 45 | static struct snd_sf_zone *sf_zone_new(struct snd_sf_list *sflist, |
46 | static void sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp); | 46 | struct snd_soundfont *sf); |
47 | static int load_map(snd_sf_list_t *sflist, const void __user *data, int count); | 47 | static void set_sample_counter(struct snd_sf_list *sflist, |
48 | static int load_info(snd_sf_list_t *sflist, const void __user *data, long count); | 48 | struct snd_soundfont *sf, struct snd_sf_sample *sp); |
49 | static int remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr); | 49 | static struct snd_sf_sample *sf_sample_new(struct snd_sf_list *sflist, |
50 | static void init_voice_info(soundfont_voice_info_t *avp); | 50 | struct snd_soundfont *sf); |
51 | static void init_voice_parm(soundfont_voice_parm_t *pp); | 51 | static void sf_sample_delete(struct snd_sf_list *sflist, |
52 | static snd_sf_sample_t *set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp); | 52 | struct snd_soundfont *sf, struct snd_sf_sample *sp); |
53 | static snd_sf_sample_t *find_sample(snd_soundfont_t *sf, int sample_id); | 53 | static int load_map(struct snd_sf_list *sflist, const void __user *data, int count); |
54 | static int load_data(snd_sf_list_t *sflist, const void __user *data, long count); | 54 | static int load_info(struct snd_sf_list *sflist, const void __user *data, long count); |
55 | static void rebuild_presets(snd_sf_list_t *sflist); | 55 | static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, |
56 | static void add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur); | 56 | int bank, int instr); |
57 | static void delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp); | 57 | static void init_voice_info(struct soundfont_voice_info *avp); |
58 | static snd_sf_zone_t *search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key); | 58 | static void init_voice_parm(struct soundfont_voice_parm *pp); |
59 | static int search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level); | 59 | static struct snd_sf_sample *set_sample(struct snd_soundfont *sf, |
60 | struct soundfont_voice_info *avp); | ||
61 | static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id); | ||
62 | static int load_data(struct snd_sf_list *sflist, const void __user *data, long count); | ||
63 | static void rebuild_presets(struct snd_sf_list *sflist); | ||
64 | static void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur); | ||
65 | static void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp); | ||
66 | static struct snd_sf_zone *search_first_zone(struct snd_sf_list *sflist, | ||
67 | int bank, int preset, int key); | ||
68 | static int search_zones(struct snd_sf_list *sflist, int *notep, int vel, | ||
69 | int preset, int bank, struct snd_sf_zone **table, | ||
70 | int max_layers, int level); | ||
60 | static int get_index(int bank, int instr, int key); | 71 | static int get_index(int bank, int instr, int key); |
61 | static void snd_sf_init(snd_sf_list_t *sflist); | 72 | static void snd_sf_init(struct snd_sf_list *sflist); |
62 | static void snd_sf_clear(snd_sf_list_t *sflist); | 73 | static void snd_sf_clear(struct snd_sf_list *sflist); |
63 | 74 | ||
64 | /* | 75 | /* |
65 | * lock access to sflist | 76 | * lock access to sflist |
66 | */ | 77 | */ |
67 | static void | 78 | static void |
68 | lock_preset(snd_sf_list_t *sflist) | 79 | lock_preset(struct snd_sf_list *sflist) |
69 | { | 80 | { |
70 | unsigned long flags; | 81 | unsigned long flags; |
71 | down(&sflist->presets_mutex); | 82 | down(&sflist->presets_mutex); |
@@ -79,7 +90,7 @@ lock_preset(snd_sf_list_t *sflist) | |||
79 | * remove lock | 90 | * remove lock |
80 | */ | 91 | */ |
81 | static void | 92 | static void |
82 | unlock_preset(snd_sf_list_t *sflist) | 93 | unlock_preset(struct snd_sf_list *sflist) |
83 | { | 94 | { |
84 | unsigned long flags; | 95 | unsigned long flags; |
85 | spin_lock_irqsave(&sflist->lock, flags); | 96 | spin_lock_irqsave(&sflist->lock, flags); |
@@ -93,7 +104,7 @@ unlock_preset(snd_sf_list_t *sflist) | |||
93 | * close the patch if the patch was opened by this client. | 104 | * close the patch if the patch was opened by this client. |
94 | */ | 105 | */ |
95 | int | 106 | int |
96 | snd_soundfont_close_check(snd_sf_list_t *sflist, int client) | 107 | snd_soundfont_close_check(struct snd_sf_list *sflist, int client) |
97 | { | 108 | { |
98 | unsigned long flags; | 109 | unsigned long flags; |
99 | spin_lock_irqsave(&sflist->lock, flags); | 110 | spin_lock_irqsave(&sflist->lock, flags); |
@@ -115,9 +126,10 @@ snd_soundfont_close_check(snd_sf_list_t *sflist, int client) | |||
115 | * it wants to do with it. | 126 | * it wants to do with it. |
116 | */ | 127 | */ |
117 | int | 128 | int |
118 | snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client) | 129 | snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data, |
130 | long count, int client) | ||
119 | { | 131 | { |
120 | soundfont_patch_info_t patch; | 132 | struct soundfont_patch_info patch; |
121 | unsigned long flags; | 133 | unsigned long flags; |
122 | int rc; | 134 | int rc; |
123 | 135 | ||
@@ -215,10 +227,11 @@ is_special_type(int type) | |||
215 | 227 | ||
216 | /* open patch; create sf list */ | 228 | /* open patch; create sf list */ |
217 | static int | 229 | static int |
218 | open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client) | 230 | open_patch(struct snd_sf_list *sflist, const char __user *data, |
231 | int count, int client) | ||
219 | { | 232 | { |
220 | soundfont_open_parm_t parm; | 233 | struct soundfont_open_parm parm; |
221 | snd_soundfont_t *sf; | 234 | struct snd_soundfont *sf; |
222 | unsigned long flags; | 235 | unsigned long flags; |
223 | 236 | ||
224 | spin_lock_irqsave(&sflist->lock, flags); | 237 | spin_lock_irqsave(&sflist->lock, flags); |
@@ -251,10 +264,10 @@ open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client | |||
251 | /* | 264 | /* |
252 | * Allocate a new soundfont structure. | 265 | * Allocate a new soundfont structure. |
253 | */ | 266 | */ |
254 | static snd_soundfont_t * | 267 | static struct snd_soundfont * |
255 | newsf(snd_sf_list_t *sflist, int type, char *name) | 268 | newsf(struct snd_sf_list *sflist, int type, char *name) |
256 | { | 269 | { |
257 | snd_soundfont_t *sf; | 270 | struct snd_soundfont *sf; |
258 | 271 | ||
259 | /* check the shared fonts */ | 272 | /* check the shared fonts */ |
260 | if (type & SNDRV_SFNT_PAT_SHARED) { | 273 | if (type & SNDRV_SFNT_PAT_SHARED) { |
@@ -287,7 +300,7 @@ newsf(snd_sf_list_t *sflist, int type, char *name) | |||
287 | 300 | ||
288 | /* check if the given name matches to the existing list */ | 301 | /* check if the given name matches to the existing list */ |
289 | static int | 302 | static int |
290 | is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name) | 303 | is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name) |
291 | { | 304 | { |
292 | return ((sf->type & SNDRV_SFNT_PAT_SHARED) && | 305 | return ((sf->type & SNDRV_SFNT_PAT_SHARED) && |
293 | (sf->type & 0x0f) == (type & 0x0f) && | 306 | (sf->type & 0x0f) == (type & 0x0f) && |
@@ -299,7 +312,7 @@ is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name) | |||
299 | * Close the current patch. | 312 | * Close the current patch. |
300 | */ | 313 | */ |
301 | static int | 314 | static int |
302 | close_patch(snd_sf_list_t *sflist) | 315 | close_patch(struct snd_sf_list *sflist) |
303 | { | 316 | { |
304 | unsigned long flags; | 317 | unsigned long flags; |
305 | 318 | ||
@@ -316,7 +329,7 @@ close_patch(snd_sf_list_t *sflist) | |||
316 | 329 | ||
317 | /* probe sample in the current list -- nothing to be loaded */ | 330 | /* probe sample in the current list -- nothing to be loaded */ |
318 | static int | 331 | static int |
319 | probe_data(snd_sf_list_t *sflist, int sample_id) | 332 | probe_data(struct snd_sf_list *sflist, int sample_id) |
320 | { | 333 | { |
321 | /* patch must be opened */ | 334 | /* patch must be opened */ |
322 | if (sflist->currsf) { | 335 | if (sflist->currsf) { |
@@ -331,7 +344,8 @@ probe_data(snd_sf_list_t *sflist, int sample_id) | |||
331 | * increment zone counter | 344 | * increment zone counter |
332 | */ | 345 | */ |
333 | static void | 346 | static void |
334 | set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp) | 347 | set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, |
348 | struct snd_sf_zone *zp) | ||
335 | { | 349 | { |
336 | zp->counter = sflist->zone_counter++; | 350 | zp->counter = sflist->zone_counter++; |
337 | if (sf->type & SNDRV_SFNT_PAT_LOCKED) | 351 | if (sf->type & SNDRV_SFNT_PAT_LOCKED) |
@@ -341,10 +355,10 @@ set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp) | |||
341 | /* | 355 | /* |
342 | * allocate a new zone record | 356 | * allocate a new zone record |
343 | */ | 357 | */ |
344 | static snd_sf_zone_t * | 358 | static struct snd_sf_zone * |
345 | sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) | 359 | sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) |
346 | { | 360 | { |
347 | snd_sf_zone_t *zp; | 361 | struct snd_sf_zone *zp; |
348 | 362 | ||
349 | if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL) | 363 | if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL) |
350 | return NULL; | 364 | return NULL; |
@@ -362,7 +376,8 @@ sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) | |||
362 | * increment sample couter | 376 | * increment sample couter |
363 | */ | 377 | */ |
364 | static void | 378 | static void |
365 | set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp) | 379 | set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, |
380 | struct snd_sf_sample *sp) | ||
366 | { | 381 | { |
367 | sp->counter = sflist->sample_counter++; | 382 | sp->counter = sflist->sample_counter++; |
368 | if (sf->type & SNDRV_SFNT_PAT_LOCKED) | 383 | if (sf->type & SNDRV_SFNT_PAT_LOCKED) |
@@ -372,10 +387,10 @@ set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t * | |||
372 | /* | 387 | /* |
373 | * allocate a new sample list record | 388 | * allocate a new sample list record |
374 | */ | 389 | */ |
375 | static snd_sf_sample_t * | 390 | static struct snd_sf_sample * |
376 | sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) | 391 | sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) |
377 | { | 392 | { |
378 | snd_sf_sample_t *sp; | 393 | struct snd_sf_sample *sp; |
379 | 394 | ||
380 | if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL) | 395 | if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL) |
381 | return NULL; | 396 | return NULL; |
@@ -392,7 +407,8 @@ sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf) | |||
392 | * only the last allocated sample can be deleted. | 407 | * only the last allocated sample can be deleted. |
393 | */ | 408 | */ |
394 | static void | 409 | static void |
395 | sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp) | 410 | sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, |
411 | struct snd_sf_sample *sp) | ||
396 | { | 412 | { |
397 | /* only last sample is accepted */ | 413 | /* only last sample is accepted */ |
398 | if (sp == sf->samples) { | 414 | if (sp == sf->samples) { |
@@ -404,11 +420,11 @@ sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp | |||
404 | 420 | ||
405 | /* load voice map */ | 421 | /* load voice map */ |
406 | static int | 422 | static int |
407 | load_map(snd_sf_list_t *sflist, const void __user *data, int count) | 423 | load_map(struct snd_sf_list *sflist, const void __user *data, int count) |
408 | { | 424 | { |
409 | snd_sf_zone_t *zp, *prevp; | 425 | struct snd_sf_zone *zp, *prevp; |
410 | snd_soundfont_t *sf; | 426 | struct snd_soundfont *sf; |
411 | soundfont_voice_map_t map; | 427 | struct soundfont_voice_map map; |
412 | 428 | ||
413 | /* get the link info */ | 429 | /* get the link info */ |
414 | if (count < (int)sizeof(map)) | 430 | if (count < (int)sizeof(map)) |
@@ -469,9 +485,10 @@ load_map(snd_sf_list_t *sflist, const void __user *data, int count) | |||
469 | 485 | ||
470 | /* remove the present instrument layers */ | 486 | /* remove the present instrument layers */ |
471 | static int | 487 | static int |
472 | remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr) | 488 | remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, |
489 | int bank, int instr) | ||
473 | { | 490 | { |
474 | snd_sf_zone_t *prev, *next, *p; | 491 | struct snd_sf_zone *prev, *next, *p; |
475 | int removed = 0; | 492 | int removed = 0; |
476 | 493 | ||
477 | prev = NULL; | 494 | prev = NULL; |
@@ -500,11 +517,11 @@ remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr) | |||
500 | * open soundfont. | 517 | * open soundfont. |
501 | */ | 518 | */ |
502 | static int | 519 | static int |
503 | load_info(snd_sf_list_t *sflist, const void __user *data, long count) | 520 | load_info(struct snd_sf_list *sflist, const void __user *data, long count) |
504 | { | 521 | { |
505 | snd_soundfont_t *sf; | 522 | struct snd_soundfont *sf; |
506 | snd_sf_zone_t *zone; | 523 | struct snd_sf_zone *zone; |
507 | soundfont_voice_rec_hdr_t hdr; | 524 | struct soundfont_voice_rec_hdr hdr; |
508 | int i; | 525 | int i; |
509 | 526 | ||
510 | /* patch must be opened */ | 527 | /* patch must be opened */ |
@@ -529,7 +546,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count) | |||
529 | return -EINVAL; | 546 | return -EINVAL; |
530 | } | 547 | } |
531 | 548 | ||
532 | if (count < (long)sizeof(soundfont_voice_info_t)*hdr.nvoices) { | 549 | if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) { |
533 | printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", | 550 | printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", |
534 | count, hdr.nvoices); | 551 | count, hdr.nvoices); |
535 | return -EINVAL; | 552 | return -EINVAL; |
@@ -553,7 +570,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count) | |||
553 | } | 570 | } |
554 | 571 | ||
555 | for (i = 0; i < hdr.nvoices; i++) { | 572 | for (i = 0; i < hdr.nvoices; i++) { |
556 | snd_sf_zone_t tmpzone; | 573 | struct snd_sf_zone tmpzone; |
557 | 574 | ||
558 | /* copy awe_voice_info parameters */ | 575 | /* copy awe_voice_info parameters */ |
559 | if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) { | 576 | if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) { |
@@ -590,7 +607,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count) | |||
590 | 607 | ||
591 | /* initialize voice_info record */ | 608 | /* initialize voice_info record */ |
592 | static void | 609 | static void |
593 | init_voice_info(soundfont_voice_info_t *avp) | 610 | init_voice_info(struct soundfont_voice_info *avp) |
594 | { | 611 | { |
595 | memset(avp, 0, sizeof(*avp)); | 612 | memset(avp, 0, sizeof(*avp)); |
596 | 613 | ||
@@ -614,7 +631,7 @@ init_voice_info(soundfont_voice_info_t *avp) | |||
614 | * Chorus and Reverb effects are zero. | 631 | * Chorus and Reverb effects are zero. |
615 | */ | 632 | */ |
616 | static void | 633 | static void |
617 | init_voice_parm(soundfont_voice_parm_t *pp) | 634 | init_voice_parm(struct soundfont_voice_parm *pp) |
618 | { | 635 | { |
619 | memset(pp, 0, sizeof(*pp)); | 636 | memset(pp, 0, sizeof(*pp)); |
620 | 637 | ||
@@ -635,10 +652,10 @@ init_voice_parm(soundfont_voice_parm_t *pp) | |||
635 | } | 652 | } |
636 | 653 | ||
637 | /* search the specified sample */ | 654 | /* search the specified sample */ |
638 | static snd_sf_sample_t * | 655 | static struct snd_sf_sample * |
639 | set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp) | 656 | set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp) |
640 | { | 657 | { |
641 | snd_sf_sample_t *sample; | 658 | struct snd_sf_sample *sample; |
642 | 659 | ||
643 | sample = find_sample(sf, avp->sample); | 660 | sample = find_sample(sf, avp->sample); |
644 | if (sample == NULL) | 661 | if (sample == NULL) |
@@ -661,10 +678,10 @@ set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp) | |||
661 | } | 678 | } |
662 | 679 | ||
663 | /* find the sample pointer with the given id in the soundfont */ | 680 | /* find the sample pointer with the given id in the soundfont */ |
664 | static snd_sf_sample_t * | 681 | static struct snd_sf_sample * |
665 | find_sample(snd_soundfont_t *sf, int sample_id) | 682 | find_sample(struct snd_soundfont *sf, int sample_id) |
666 | { | 683 | { |
667 | snd_sf_sample_t *p; | 684 | struct snd_sf_sample *p; |
668 | 685 | ||
669 | if (sf == NULL) | 686 | if (sf == NULL) |
670 | return NULL; | 687 | return NULL; |
@@ -684,11 +701,11 @@ find_sample(snd_soundfont_t *sf, int sample_id) | |||
684 | * routine. | 701 | * routine. |
685 | */ | 702 | */ |
686 | static int | 703 | static int |
687 | load_data(snd_sf_list_t *sflist, const void __user *data, long count) | 704 | load_data(struct snd_sf_list *sflist, const void __user *data, long count) |
688 | { | 705 | { |
689 | snd_soundfont_t *sf; | 706 | struct snd_soundfont *sf; |
690 | soundfont_sample_info_t sample_info; | 707 | struct soundfont_sample_info sample_info; |
691 | snd_sf_sample_t *sp; | 708 | struct snd_sf_sample *sp; |
692 | long off; | 709 | long off; |
693 | 710 | ||
694 | /* patch must be opened */ | 711 | /* patch must be opened */ |
@@ -922,12 +939,13 @@ int snd_sf_vol_table[128] = { | |||
922 | 939 | ||
923 | /* load GUS patch */ | 940 | /* load GUS patch */ |
924 | static int | 941 | static int |
925 | load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client) | 942 | load_guspatch(struct snd_sf_list *sflist, const char __user *data, |
943 | long count, int client) | ||
926 | { | 944 | { |
927 | struct patch_info patch; | 945 | struct patch_info patch; |
928 | snd_soundfont_t *sf; | 946 | struct snd_soundfont *sf; |
929 | snd_sf_zone_t *zone; | 947 | struct snd_sf_zone *zone; |
930 | snd_sf_sample_t *smp; | 948 | struct snd_sf_sample *smp; |
931 | int note, sample_id; | 949 | int note, sample_id; |
932 | int rc; | 950 | int rc; |
933 | 951 | ||
@@ -992,7 +1010,8 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl | |||
992 | */ | 1010 | */ |
993 | if (sflist->callback.sample_new) { | 1011 | if (sflist->callback.sample_new) { |
994 | rc = sflist->callback.sample_new | 1012 | rc = sflist->callback.sample_new |
995 | (sflist->callback.private_data, smp, sflist->memhdr, data, count); | 1013 | (sflist->callback.private_data, smp, sflist->memhdr, |
1014 | data, count); | ||
996 | if (rc < 0) { | 1015 | if (rc < 0) { |
997 | sf_sample_delete(sflist, sf, smp); | 1016 | sf_sample_delete(sflist, sf, smp); |
998 | return rc; | 1017 | return rc; |
@@ -1095,7 +1114,7 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl | |||
1095 | 1114 | ||
1096 | /* load GUS patch */ | 1115 | /* load GUS patch */ |
1097 | int | 1116 | int |
1098 | snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, | 1117 | snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data, |
1099 | long count, int client) | 1118 | long count, int client) |
1100 | { | 1119 | { |
1101 | int rc; | 1120 | int rc; |
@@ -1114,10 +1133,10 @@ snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, | |||
1114 | * bank/key combination). | 1133 | * bank/key combination). |
1115 | */ | 1134 | */ |
1116 | static void | 1135 | static void |
1117 | rebuild_presets(snd_sf_list_t *sflist) | 1136 | rebuild_presets(struct snd_sf_list *sflist) |
1118 | { | 1137 | { |
1119 | snd_soundfont_t *sf; | 1138 | struct snd_soundfont *sf; |
1120 | snd_sf_zone_t *cur; | 1139 | struct snd_sf_zone *cur; |
1121 | 1140 | ||
1122 | /* clear preset table */ | 1141 | /* clear preset table */ |
1123 | memset(sflist->presets, 0, sizeof(sflist->presets)); | 1142 | memset(sflist->presets, 0, sizeof(sflist->presets)); |
@@ -1142,15 +1161,15 @@ rebuild_presets(snd_sf_list_t *sflist) | |||
1142 | * add the given zone to preset table | 1161 | * add the given zone to preset table |
1143 | */ | 1162 | */ |
1144 | static void | 1163 | static void |
1145 | add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur) | 1164 | add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur) |
1146 | { | 1165 | { |
1147 | snd_sf_zone_t *zone; | 1166 | struct snd_sf_zone *zone; |
1148 | int index; | 1167 | int index; |
1149 | 1168 | ||
1150 | zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low); | 1169 | zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low); |
1151 | if (zone && zone->v.sf_id != cur->v.sf_id) { | 1170 | if (zone && zone->v.sf_id != cur->v.sf_id) { |
1152 | /* different instrument was already defined */ | 1171 | /* different instrument was already defined */ |
1153 | snd_sf_zone_t *p; | 1172 | struct snd_sf_zone *p; |
1154 | /* compare the allocated time */ | 1173 | /* compare the allocated time */ |
1155 | for (p = zone; p; p = p->next_zone) { | 1174 | for (p = zone; p; p = p->next_zone) { |
1156 | if (p->counter > cur->counter) | 1175 | if (p->counter > cur->counter) |
@@ -1174,10 +1193,10 @@ add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur) | |||
1174 | * delete the given zones from preset_table | 1193 | * delete the given zones from preset_table |
1175 | */ | 1194 | */ |
1176 | static void | 1195 | static void |
1177 | delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp) | 1196 | delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp) |
1178 | { | 1197 | { |
1179 | int index; | 1198 | int index; |
1180 | snd_sf_zone_t *p; | 1199 | struct snd_sf_zone *p; |
1181 | 1200 | ||
1182 | if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0) | 1201 | if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0) |
1183 | return; | 1202 | return; |
@@ -1200,10 +1219,10 @@ delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp) | |||
1200 | * This function returns the number of found zones. 0 if not found. | 1219 | * This function returns the number of found zones. 0 if not found. |
1201 | */ | 1220 | */ |
1202 | int | 1221 | int |
1203 | snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, | 1222 | snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel, |
1204 | int preset, int bank, | 1223 | int preset, int bank, |
1205 | int def_preset, int def_bank, | 1224 | int def_preset, int def_bank, |
1206 | snd_sf_zone_t **table, int max_layers) | 1225 | struct snd_sf_zone **table, int max_layers) |
1207 | { | 1226 | { |
1208 | int nvoices; | 1227 | int nvoices; |
1209 | unsigned long flags; | 1228 | unsigned long flags; |
@@ -1217,10 +1236,13 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, | |||
1217 | spin_unlock_irqrestore(&sflist->lock, flags); | 1236 | spin_unlock_irqrestore(&sflist->lock, flags); |
1218 | return 0; | 1237 | return 0; |
1219 | } | 1238 | } |
1220 | nvoices = search_zones(sflist, notep, vel, preset, bank, table, max_layers, 0); | 1239 | nvoices = search_zones(sflist, notep, vel, preset, bank, |
1240 | table, max_layers, 0); | ||
1221 | if (! nvoices) { | 1241 | if (! nvoices) { |
1222 | if (preset != def_preset || bank != def_bank) | 1242 | if (preset != def_preset || bank != def_bank) |
1223 | nvoices = search_zones(sflist, notep, vel, def_preset, def_bank, table, max_layers, 0); | 1243 | nvoices = search_zones(sflist, notep, vel, |
1244 | def_preset, def_bank, | ||
1245 | table, max_layers, 0); | ||
1224 | } | 1246 | } |
1225 | spin_unlock_irqrestore(&sflist->lock, flags); | 1247 | spin_unlock_irqrestore(&sflist->lock, flags); |
1226 | return nvoices; | 1248 | return nvoices; |
@@ -1230,11 +1252,11 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, | |||
1230 | /* | 1252 | /* |
1231 | * search the first matching zone | 1253 | * search the first matching zone |
1232 | */ | 1254 | */ |
1233 | static snd_sf_zone_t * | 1255 | static struct snd_sf_zone * |
1234 | search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key) | 1256 | search_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key) |
1235 | { | 1257 | { |
1236 | int index; | 1258 | int index; |
1237 | snd_sf_zone_t *zp; | 1259 | struct snd_sf_zone *zp; |
1238 | 1260 | ||
1239 | if ((index = get_index(bank, preset, key)) < 0) | 1261 | if ((index = get_index(bank, preset, key)) < 0) |
1240 | return NULL; | 1262 | return NULL; |
@@ -1250,9 +1272,11 @@ search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key) | |||
1250 | * search matching zones from sflist. can be called recursively. | 1272 | * search matching zones from sflist. can be called recursively. |
1251 | */ | 1273 | */ |
1252 | static int | 1274 | static int |
1253 | search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level) | 1275 | search_zones(struct snd_sf_list *sflist, int *notep, int vel, |
1276 | int preset, int bank, struct snd_sf_zone **table, | ||
1277 | int max_layers, int level) | ||
1254 | { | 1278 | { |
1255 | snd_sf_zone_t *zp; | 1279 | struct snd_sf_zone *zp; |
1256 | int nvoices; | 1280 | int nvoices; |
1257 | 1281 | ||
1258 | zp = search_first_zone(sflist, bank, preset, *notep); | 1282 | zp = search_first_zone(sflist, bank, preset, *notep); |
@@ -1310,7 +1334,7 @@ get_index(int bank, int instr, int key) | |||
1310 | * Initialise the sflist structure. | 1334 | * Initialise the sflist structure. |
1311 | */ | 1335 | */ |
1312 | static void | 1336 | static void |
1313 | snd_sf_init(snd_sf_list_t *sflist) | 1337 | snd_sf_init(struct snd_sf_list *sflist) |
1314 | { | 1338 | { |
1315 | memset(sflist->presets, 0, sizeof(sflist->presets)); | 1339 | memset(sflist->presets, 0, sizeof(sflist->presets)); |
1316 | 1340 | ||
@@ -1329,11 +1353,11 @@ snd_sf_init(snd_sf_list_t *sflist) | |||
1329 | * Release all list records | 1353 | * Release all list records |
1330 | */ | 1354 | */ |
1331 | static void | 1355 | static void |
1332 | snd_sf_clear(snd_sf_list_t *sflist) | 1356 | snd_sf_clear(struct snd_sf_list *sflist) |
1333 | { | 1357 | { |
1334 | snd_soundfont_t *sf, *nextsf; | 1358 | struct snd_soundfont *sf, *nextsf; |
1335 | snd_sf_zone_t *zp, *nextzp; | 1359 | struct snd_sf_zone *zp, *nextzp; |
1336 | snd_sf_sample_t *sp, *nextsp; | 1360 | struct snd_sf_sample *sp, *nextsp; |
1337 | 1361 | ||
1338 | for (sf = sflist->fonts; sf; sf = nextsf) { | 1362 | for (sf = sflist->fonts; sf; sf = nextsf) { |
1339 | nextsf = sf->next; | 1363 | nextsf = sf->next; |
@@ -1344,7 +1368,8 @@ snd_sf_clear(snd_sf_list_t *sflist) | |||
1344 | for (sp = sf->samples; sp; sp = nextsp) { | 1368 | for (sp = sf->samples; sp; sp = nextsp) { |
1345 | nextsp = sp->next; | 1369 | nextsp = sp->next; |
1346 | if (sflist->callback.sample_free) | 1370 | if (sflist->callback.sample_free) |
1347 | sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr); | 1371 | sflist->callback.sample_free(sflist->callback.private_data, |
1372 | sp, sflist->memhdr); | ||
1348 | kfree(sp); | 1373 | kfree(sp); |
1349 | } | 1374 | } |
1350 | kfree(sf); | 1375 | kfree(sf); |
@@ -1357,10 +1382,10 @@ snd_sf_clear(snd_sf_list_t *sflist) | |||
1357 | /* | 1382 | /* |
1358 | * Create a new sflist structure | 1383 | * Create a new sflist structure |
1359 | */ | 1384 | */ |
1360 | snd_sf_list_t * | 1385 | struct snd_sf_list * |
1361 | snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr) | 1386 | snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr) |
1362 | { | 1387 | { |
1363 | snd_sf_list_t *sflist; | 1388 | struct snd_sf_list *sflist; |
1364 | 1389 | ||
1365 | if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL) | 1390 | if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL) |
1366 | return NULL; | 1391 | return NULL; |
@@ -1381,7 +1406,7 @@ snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr) | |||
1381 | * Free everything allocated off the sflist structure. | 1406 | * Free everything allocated off the sflist structure. |
1382 | */ | 1407 | */ |
1383 | void | 1408 | void |
1384 | snd_sf_free(snd_sf_list_t *sflist) | 1409 | snd_sf_free(struct snd_sf_list *sflist) |
1385 | { | 1410 | { |
1386 | if (sflist == NULL) | 1411 | if (sflist == NULL) |
1387 | return; | 1412 | return; |
@@ -1400,7 +1425,7 @@ snd_sf_free(snd_sf_list_t *sflist) | |||
1400 | * The soundcard should be silet before calling this function. | 1425 | * The soundcard should be silet before calling this function. |
1401 | */ | 1426 | */ |
1402 | int | 1427 | int |
1403 | snd_soundfont_remove_samples(snd_sf_list_t *sflist) | 1428 | snd_soundfont_remove_samples(struct snd_sf_list *sflist) |
1404 | { | 1429 | { |
1405 | lock_preset(sflist); | 1430 | lock_preset(sflist); |
1406 | if (sflist->callback.sample_reset) | 1431 | if (sflist->callback.sample_reset) |
@@ -1416,11 +1441,11 @@ snd_soundfont_remove_samples(snd_sf_list_t *sflist) | |||
1416 | * The soundcard should be silent before calling this function. | 1441 | * The soundcard should be silent before calling this function. |
1417 | */ | 1442 | */ |
1418 | int | 1443 | int |
1419 | snd_soundfont_remove_unlocked(snd_sf_list_t *sflist) | 1444 | snd_soundfont_remove_unlocked(struct snd_sf_list *sflist) |
1420 | { | 1445 | { |
1421 | snd_soundfont_t *sf; | 1446 | struct snd_soundfont *sf; |
1422 | snd_sf_zone_t *zp, *nextzp; | 1447 | struct snd_sf_zone *zp, *nextzp; |
1423 | snd_sf_sample_t *sp, *nextsp; | 1448 | struct snd_sf_sample *sp, *nextsp; |
1424 | 1449 | ||
1425 | lock_preset(sflist); | 1450 | lock_preset(sflist); |
1426 | 1451 | ||
@@ -1446,7 +1471,8 @@ snd_soundfont_remove_unlocked(snd_sf_list_t *sflist) | |||
1446 | sf->samples = nextsp; | 1471 | sf->samples = nextsp; |
1447 | sflist->mem_used -= sp->v.truesize; | 1472 | sflist->mem_used -= sp->v.truesize; |
1448 | if (sflist->callback.sample_free) | 1473 | if (sflist->callback.sample_free) |
1449 | sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr); | 1474 | sflist->callback.sample_free(sflist->callback.private_data, |
1475 | sp, sflist->memhdr); | ||
1450 | kfree(sp); | 1476 | kfree(sp); |
1451 | } | 1477 | } |
1452 | } | 1478 | } |
diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c index 5f75bf31bc36..217e8e552a42 100644 --- a/sound/synth/util_mem.c +++ b/sound/synth/util_mem.c | |||
@@ -28,15 +28,15 @@ MODULE_AUTHOR("Takashi Iwai"); | |||
28 | MODULE_DESCRIPTION("Generic memory management routines for soundcard memory allocation"); | 28 | MODULE_DESCRIPTION("Generic memory management routines for soundcard memory allocation"); |
29 | MODULE_LICENSE("GPL"); | 29 | MODULE_LICENSE("GPL"); |
30 | 30 | ||
31 | #define get_memblk(p) list_entry(p, snd_util_memblk_t, list) | 31 | #define get_memblk(p) list_entry(p, struct snd_util_memblk, list) |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * create a new memory manager | 34 | * create a new memory manager |
35 | */ | 35 | */ |
36 | snd_util_memhdr_t * | 36 | struct snd_util_memhdr * |
37 | snd_util_memhdr_new(int memsize) | 37 | snd_util_memhdr_new(int memsize) |
38 | { | 38 | { |
39 | snd_util_memhdr_t *hdr; | 39 | struct snd_util_memhdr *hdr; |
40 | 40 | ||
41 | hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); | 41 | hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); |
42 | if (hdr == NULL) | 42 | if (hdr == NULL) |
@@ -51,7 +51,7 @@ snd_util_memhdr_new(int memsize) | |||
51 | /* | 51 | /* |
52 | * free a memory manager | 52 | * free a memory manager |
53 | */ | 53 | */ |
54 | void snd_util_memhdr_free(snd_util_memhdr_t *hdr) | 54 | void snd_util_memhdr_free(struct snd_util_memhdr *hdr) |
55 | { | 55 | { |
56 | struct list_head *p; | 56 | struct list_head *p; |
57 | 57 | ||
@@ -67,11 +67,11 @@ void snd_util_memhdr_free(snd_util_memhdr_t *hdr) | |||
67 | /* | 67 | /* |
68 | * allocate a memory block (without mutex) | 68 | * allocate a memory block (without mutex) |
69 | */ | 69 | */ |
70 | snd_util_memblk_t * | 70 | struct snd_util_memblk * |
71 | __snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) | 71 | __snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size) |
72 | { | 72 | { |
73 | snd_util_memblk_t *blk; | 73 | struct snd_util_memblk *blk; |
74 | snd_util_unit_t units, prev_offset; | 74 | unsigned int units, prev_offset; |
75 | struct list_head *p; | 75 | struct list_head *p; |
76 | 76 | ||
77 | snd_assert(hdr != NULL, return NULL); | 77 | snd_assert(hdr != NULL, return NULL); |
@@ -104,20 +104,21 @@ __found: | |||
104 | * create a new memory block with the given size | 104 | * create a new memory block with the given size |
105 | * the block is linked next to prev | 105 | * the block is linked next to prev |
106 | */ | 106 | */ |
107 | snd_util_memblk_t * | 107 | struct snd_util_memblk * |
108 | __snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, | 108 | __snd_util_memblk_new(struct snd_util_memhdr *hdr, unsigned int units, |
109 | struct list_head *prev) | 109 | struct list_head *prev) |
110 | { | 110 | { |
111 | snd_util_memblk_t *blk; | 111 | struct snd_util_memblk *blk; |
112 | 112 | ||
113 | blk = kmalloc(sizeof(snd_util_memblk_t) + hdr->block_extra_size, GFP_KERNEL); | 113 | blk = kmalloc(sizeof(struct snd_util_memblk) + hdr->block_extra_size, |
114 | GFP_KERNEL); | ||
114 | if (blk == NULL) | 115 | if (blk == NULL) |
115 | return NULL; | 116 | return NULL; |
116 | 117 | ||
117 | if (! prev || prev == &hdr->block) | 118 | if (! prev || prev == &hdr->block) |
118 | blk->offset = 0; | 119 | blk->offset = 0; |
119 | else { | 120 | else { |
120 | snd_util_memblk_t *p = get_memblk(prev); | 121 | struct snd_util_memblk *p = get_memblk(prev); |
121 | blk->offset = p->offset + p->size; | 122 | blk->offset = p->offset + p->size; |
122 | } | 123 | } |
123 | blk->size = units; | 124 | blk->size = units; |
@@ -131,10 +132,10 @@ __snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, | |||
131 | /* | 132 | /* |
132 | * allocate a memory block (with mutex) | 133 | * allocate a memory block (with mutex) |
133 | */ | 134 | */ |
134 | snd_util_memblk_t * | 135 | struct snd_util_memblk * |
135 | snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) | 136 | snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size) |
136 | { | 137 | { |
137 | snd_util_memblk_t *blk; | 138 | struct snd_util_memblk *blk; |
138 | down(&hdr->block_mutex); | 139 | down(&hdr->block_mutex); |
139 | blk = __snd_util_mem_alloc(hdr, size); | 140 | blk = __snd_util_mem_alloc(hdr, size); |
140 | up(&hdr->block_mutex); | 141 | up(&hdr->block_mutex); |
@@ -147,7 +148,7 @@ snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size) | |||
147 | * (without mutex) | 148 | * (without mutex) |
148 | */ | 149 | */ |
149 | void | 150 | void |
150 | __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) | 151 | __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk) |
151 | { | 152 | { |
152 | list_del(&blk->list); | 153 | list_del(&blk->list); |
153 | hdr->nblocks--; | 154 | hdr->nblocks--; |
@@ -158,7 +159,7 @@ __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) | |||
158 | /* | 159 | /* |
159 | * free a memory block (with mutex) | 160 | * free a memory block (with mutex) |
160 | */ | 161 | */ |
161 | int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) | 162 | int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk) |
162 | { | 163 | { |
163 | snd_assert(hdr && blk, return -EINVAL); | 164 | snd_assert(hdr && blk, return -EINVAL); |
164 | 165 | ||
@@ -171,7 +172,7 @@ int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk) | |||
171 | /* | 172 | /* |
172 | * return available memory size | 173 | * return available memory size |
173 | */ | 174 | */ |
174 | int snd_util_mem_avail(snd_util_memhdr_t *hdr) | 175 | int snd_util_mem_avail(struct snd_util_memhdr *hdr) |
175 | { | 176 | { |
176 | unsigned int size; | 177 | unsigned int size; |
177 | down(&hdr->block_mutex); | 178 | down(&hdr->block_mutex); |