diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:50:13 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:18:47 -0500 |
commit | eb4698f347ec908c365504c4edddadd1acd406ea (patch) | |
tree | 4962019c8bf4a52e35ab55137e17aa150edf9661 /sound/pci/emu10k1/emu10k1_callback.c | |
parent | 3d19f804ef5f1d15fe001fc8d1ed58fac9d591fb (diff) |
[ALSA] Remove xxx_t typedefs: PCI emu10k1
Modules: EMU10K1/EMU10K2 driver
Remove xxx_t typedefs from the PCI emu10k1 driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_callback.c')
-rw-r--r-- | sound/pci/emu10k1/emu10k1_callback.c | 105 |
1 files changed, 54 insertions, 51 deletions
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c index 6589bf24abcd..01965bd99966 100644 --- a/sound/pci/emu10k1/emu10k1_callback.c +++ b/sound/pci/emu10k1/emu10k1_callback.c | |||
@@ -27,26 +27,28 @@ enum { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* Keeps track of what we are finding */ | 29 | /* Keeps track of what we are finding */ |
30 | typedef struct best_voice { | 30 | struct best_voice { |
31 | unsigned int time; | 31 | unsigned int time; |
32 | int voice; | 32 | int voice; |
33 | } best_voice_t; | 33 | }; |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * prototypes | 36 | * prototypes |
37 | */ | 37 | */ |
38 | static void lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_only); | 38 | static void lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw, |
39 | static snd_emux_voice_t *get_voice(snd_emux_t *emu, snd_emux_port_t *port); | 39 | struct best_voice *best, int active_only); |
40 | static int start_voice(snd_emux_voice_t *vp); | 40 | static struct snd_emux_voice *get_voice(struct snd_emux *emu, |
41 | static void trigger_voice(snd_emux_voice_t *vp); | 41 | struct snd_emux_port *port); |
42 | static void release_voice(snd_emux_voice_t *vp); | 42 | static int start_voice(struct snd_emux_voice *vp); |
43 | static void update_voice(snd_emux_voice_t *vp, int update); | 43 | static void trigger_voice(struct snd_emux_voice *vp); |
44 | static void terminate_voice(snd_emux_voice_t *vp); | 44 | static void release_voice(struct snd_emux_voice *vp); |
45 | static void free_voice(snd_emux_voice_t *vp); | 45 | static void update_voice(struct snd_emux_voice *vp, int update); |
46 | 46 | static void terminate_voice(struct snd_emux_voice *vp); | |
47 | static void set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp); | 47 | static void free_voice(struct snd_emux_voice *vp); |
48 | static void set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp); | 48 | |
49 | static void set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp); | 49 | static void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); |
50 | static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); | ||
51 | static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); | ||
50 | 52 | ||
51 | /* | 53 | /* |
52 | * Ensure a value is between two points | 54 | * Ensure a value is between two points |
@@ -59,7 +61,7 @@ static void set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp); | |||
59 | /* | 61 | /* |
60 | * set up operators | 62 | * set up operators |
61 | */ | 63 | */ |
62 | static snd_emux_operators_t emu10k1_ops = { | 64 | static struct snd_emux_operators emu10k1_ops = { |
63 | .owner = THIS_MODULE, | 65 | .owner = THIS_MODULE, |
64 | .get_voice = get_voice, | 66 | .get_voice = get_voice, |
65 | .prepare = start_voice, | 67 | .prepare = start_voice, |
@@ -73,7 +75,7 @@ static snd_emux_operators_t emu10k1_ops = { | |||
73 | }; | 75 | }; |
74 | 76 | ||
75 | void | 77 | void |
76 | snd_emu10k1_ops_setup(snd_emux_t *emu) | 78 | snd_emu10k1_ops_setup(struct snd_emux *emu) |
77 | { | 79 | { |
78 | emu->ops = emu10k1_ops; | 80 | emu->ops = emu10k1_ops; |
79 | } | 81 | } |
@@ -85,11 +87,11 @@ snd_emu10k1_ops_setup(snd_emux_t *emu) | |||
85 | * terminate most inactive voice and give it as a pcm voice. | 87 | * terminate most inactive voice and give it as a pcm voice. |
86 | */ | 88 | */ |
87 | int | 89 | int |
88 | snd_emu10k1_synth_get_voice(emu10k1_t *hw) | 90 | snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) |
89 | { | 91 | { |
90 | snd_emux_t *emu; | 92 | struct snd_emux *emu; |
91 | snd_emux_voice_t *vp; | 93 | struct snd_emux_voice *vp; |
92 | best_voice_t best[V_END]; | 94 | struct best_voice best[V_END]; |
93 | unsigned long flags; | 95 | unsigned long flags; |
94 | int i; | 96 | int i; |
95 | 97 | ||
@@ -123,10 +125,10 @@ snd_emu10k1_synth_get_voice(emu10k1_t *hw) | |||
123 | * turn off the voice (not terminated) | 125 | * turn off the voice (not terminated) |
124 | */ | 126 | */ |
125 | static void | 127 | static void |
126 | release_voice(snd_emux_voice_t *vp) | 128 | release_voice(struct snd_emux_voice *vp) |
127 | { | 129 | { |
128 | int dcysusv; | 130 | int dcysusv; |
129 | emu10k1_t *hw; | 131 | struct snd_emu10k1 *hw; |
130 | 132 | ||
131 | hw = vp->hw; | 133 | hw = vp->hw; |
132 | dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; | 134 | dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; |
@@ -140,16 +142,16 @@ release_voice(snd_emux_voice_t *vp) | |||
140 | * terminate the voice | 142 | * terminate the voice |
141 | */ | 143 | */ |
142 | static void | 144 | static void |
143 | terminate_voice(snd_emux_voice_t *vp) | 145 | terminate_voice(struct snd_emux_voice *vp) |
144 | { | 146 | { |
145 | emu10k1_t *hw; | 147 | struct snd_emu10k1 *hw; |
146 | 148 | ||
147 | snd_assert(vp, return); | 149 | snd_assert(vp, return); |
148 | hw = vp->hw; | 150 | hw = vp->hw; |
149 | snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); | 151 | snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); |
150 | if (vp->block) { | 152 | if (vp->block) { |
151 | emu10k1_memblk_t *emem; | 153 | struct snd_emu10k1_memblk *emem; |
152 | emem = (emu10k1_memblk_t *)vp->block; | 154 | emem = (struct snd_emu10k1_memblk *)vp->block; |
153 | if (emem->map_locked > 0) | 155 | if (emem->map_locked > 0) |
154 | emem->map_locked--; | 156 | emem->map_locked--; |
155 | } | 157 | } |
@@ -159,9 +161,9 @@ terminate_voice(snd_emux_voice_t *vp) | |||
159 | * release the voice to system | 161 | * release the voice to system |
160 | */ | 162 | */ |
161 | static void | 163 | static void |
162 | free_voice(snd_emux_voice_t *vp) | 164 | free_voice(struct snd_emux_voice *vp) |
163 | { | 165 | { |
164 | emu10k1_t *hw; | 166 | struct snd_emu10k1 *hw; |
165 | 167 | ||
166 | hw = vp->hw; | 168 | hw = vp->hw; |
167 | if (vp->ch >= 0) { | 169 | if (vp->ch >= 0) { |
@@ -181,9 +183,9 @@ free_voice(snd_emux_voice_t *vp) | |||
181 | * update registers | 183 | * update registers |
182 | */ | 184 | */ |
183 | static void | 185 | static void |
184 | update_voice(snd_emux_voice_t *vp, int update) | 186 | update_voice(struct snd_emux_voice *vp, int update) |
185 | { | 187 | { |
186 | emu10k1_t *hw; | 188 | struct snd_emu10k1 *hw; |
187 | 189 | ||
188 | hw = vp->hw; | 190 | hw = vp->hw; |
189 | if (update & SNDRV_EMUX_UPDATE_VOLUME) | 191 | if (update & SNDRV_EMUX_UPDATE_VOLUME) |
@@ -210,10 +212,11 @@ update_voice(snd_emux_voice_t *vp, int update) | |||
210 | */ | 212 | */ |
211 | /* spinlock held! */ | 213 | /* spinlock held! */ |
212 | static void | 214 | static void |
213 | lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_only) | 215 | lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw, |
216 | struct best_voice *best, int active_only) | ||
214 | { | 217 | { |
215 | snd_emux_voice_t *vp; | 218 | struct snd_emux_voice *vp; |
216 | best_voice_t *bp; | 219 | struct best_voice *bp; |
217 | int i; | 220 | int i; |
218 | 221 | ||
219 | for (i = 0; i < V_END; i++) { | 222 | for (i = 0; i < V_END; i++) { |
@@ -274,12 +277,12 @@ lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_onl | |||
274 | * | 277 | * |
275 | * emu->voice_lock is already held. | 278 | * emu->voice_lock is already held. |
276 | */ | 279 | */ |
277 | static snd_emux_voice_t * | 280 | static struct snd_emux_voice * |
278 | get_voice(snd_emux_t *emu, snd_emux_port_t *port) | 281 | get_voice(struct snd_emux *emu, struct snd_emux_port *port) |
279 | { | 282 | { |
280 | emu10k1_t *hw; | 283 | struct snd_emu10k1 *hw; |
281 | snd_emux_voice_t *vp; | 284 | struct snd_emux_voice *vp; |
282 | best_voice_t best[V_END]; | 285 | struct best_voice best[V_END]; |
283 | int i; | 286 | int i; |
284 | 287 | ||
285 | hw = emu->hw; | 288 | hw = emu->hw; |
@@ -290,7 +293,7 @@ get_voice(snd_emux_t *emu, snd_emux_port_t *port) | |||
290 | vp = &emu->voices[best[i].voice]; | 293 | vp = &emu->voices[best[i].voice]; |
291 | if (vp->ch < 0) { | 294 | if (vp->ch < 0) { |
292 | /* allocate a voice */ | 295 | /* allocate a voice */ |
293 | emu10k1_voice_t *hwvoice; | 296 | struct snd_emu10k1_voice *hwvoice; |
294 | if (snd_emu10k1_voice_alloc(hw, EMU10K1_SYNTH, 1, &hwvoice) < 0 || hwvoice == NULL) | 297 | if (snd_emu10k1_voice_alloc(hw, EMU10K1_SYNTH, 1, &hwvoice) < 0 || hwvoice == NULL) |
295 | continue; | 298 | continue; |
296 | vp->ch = hwvoice->number; | 299 | vp->ch = hwvoice->number; |
@@ -308,21 +311,21 @@ get_voice(snd_emux_t *emu, snd_emux_port_t *port) | |||
308 | * prepare envelopes and LFOs | 311 | * prepare envelopes and LFOs |
309 | */ | 312 | */ |
310 | static int | 313 | static int |
311 | start_voice(snd_emux_voice_t *vp) | 314 | start_voice(struct snd_emux_voice *vp) |
312 | { | 315 | { |
313 | unsigned int temp; | 316 | unsigned int temp; |
314 | int ch; | 317 | int ch; |
315 | unsigned int addr, mapped_offset; | 318 | unsigned int addr, mapped_offset; |
316 | snd_midi_channel_t *chan; | 319 | struct snd_midi_channel *chan; |
317 | emu10k1_t *hw; | 320 | struct snd_emu10k1 *hw; |
318 | emu10k1_memblk_t *emem; | 321 | struct snd_emu10k1_memblk *emem; |
319 | 322 | ||
320 | hw = vp->hw; | 323 | hw = vp->hw; |
321 | ch = vp->ch; | 324 | ch = vp->ch; |
322 | snd_assert(ch >= 0, return -EINVAL); | 325 | snd_assert(ch >= 0, return -EINVAL); |
323 | chan = vp->chan; | 326 | chan = vp->chan; |
324 | 327 | ||
325 | emem = (emu10k1_memblk_t *)vp->block; | 328 | emem = (struct snd_emu10k1_memblk *)vp->block; |
326 | if (emem == NULL) | 329 | if (emem == NULL) |
327 | return -EINVAL; | 330 | return -EINVAL; |
328 | emem->map_locked++; | 331 | emem->map_locked++; |
@@ -463,15 +466,15 @@ start_voice(snd_emux_voice_t *vp) | |||
463 | * Start envelope | 466 | * Start envelope |
464 | */ | 467 | */ |
465 | static void | 468 | static void |
466 | trigger_voice(snd_emux_voice_t *vp) | 469 | trigger_voice(struct snd_emux_voice *vp) |
467 | { | 470 | { |
468 | unsigned int temp, ptarget; | 471 | unsigned int temp, ptarget; |
469 | emu10k1_t *hw; | 472 | struct snd_emu10k1 *hw; |
470 | emu10k1_memblk_t *emem; | 473 | struct snd_emu10k1_memblk *emem; |
471 | 474 | ||
472 | hw = vp->hw; | 475 | hw = vp->hw; |
473 | 476 | ||
474 | emem = (emu10k1_memblk_t *)vp->block; | 477 | emem = (struct snd_emu10k1_memblk *)vp->block; |
475 | if (! emem || emem->mapped_page < 0) | 478 | if (! emem || emem->mapped_page < 0) |
476 | return; /* not mapped */ | 479 | return; /* not mapped */ |
477 | 480 | ||
@@ -495,7 +498,7 @@ trigger_voice(snd_emux_voice_t *vp) | |||
495 | 498 | ||
496 | /* set lfo1 modulation height and cutoff */ | 499 | /* set lfo1 modulation height and cutoff */ |
497 | static void | 500 | static void |
498 | set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp) | 501 | set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) |
499 | { | 502 | { |
500 | unsigned short fmmod; | 503 | unsigned short fmmod; |
501 | short pitch; | 504 | short pitch; |
@@ -513,7 +516,7 @@ set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp) | |||
513 | 516 | ||
514 | /* set lfo2 pitch & frequency */ | 517 | /* set lfo2 pitch & frequency */ |
515 | static void | 518 | static void |
516 | set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp) | 519 | set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) |
517 | { | 520 | { |
518 | unsigned short fm2frq2; | 521 | unsigned short fm2frq2; |
519 | short pitch; | 522 | short pitch; |
@@ -531,7 +534,7 @@ set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp) | |||
531 | 534 | ||
532 | /* set filterQ */ | 535 | /* set filterQ */ |
533 | static void | 536 | static void |
534 | set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp) | 537 | set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) |
535 | { | 538 | { |
536 | unsigned int val; | 539 | unsigned int val; |
537 | val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE; | 540 | val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE; |