diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:50:31 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:18:49 -0500 |
commit | 4b32f1aae23f566e98fda140836023dd8275b5de (patch) | |
tree | df972b04146507d918c6aa24ca5d3c7259910a71 | |
parent | eb4698f347ec908c365504c4edddadd1acd406ea (diff) |
[ALSA] Remove xxx_t typedefs: PCI emu10k1x
Modules: EMU10K1/EMU10K2 driver
Remove xxx_t typedefs from the PCI emu10k1x driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/emu10k1/emu10k1x.c | 337 |
1 files changed, 168 insertions, 169 deletions
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 6c61ac60afd7..1107c8ec7f78 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c | |||
@@ -195,30 +195,26 @@ MODULE_PARM_DESC(enable, "Enable the EMU10K1X soundcard."); | |||
195 | * playback. | 195 | * playback. |
196 | */ | 196 | */ |
197 | 197 | ||
198 | typedef struct snd_emu10k1x_voice emu10k1x_voice_t; | 198 | struct emu10k1x_voice { |
199 | typedef struct snd_emu10k1x emu10k1x_t; | 199 | struct emu10k1x *emu; |
200 | typedef struct snd_emu10k1x_pcm emu10k1x_pcm_t; | ||
201 | |||
202 | struct snd_emu10k1x_voice { | ||
203 | emu10k1x_t *emu; | ||
204 | int number; | 200 | int number; |
205 | int use; | 201 | int use; |
206 | 202 | ||
207 | emu10k1x_pcm_t *epcm; | 203 | struct emu10k1x_pcm *epcm; |
208 | }; | 204 | }; |
209 | 205 | ||
210 | struct snd_emu10k1x_pcm { | 206 | struct emu10k1x_pcm { |
211 | emu10k1x_t *emu; | 207 | struct emu10k1x *emu; |
212 | snd_pcm_substream_t *substream; | 208 | struct snd_pcm_substream *substream; |
213 | emu10k1x_voice_t *voice; | 209 | struct emu10k1x_voice *voice; |
214 | unsigned short running; | 210 | unsigned short running; |
215 | }; | 211 | }; |
216 | 212 | ||
217 | typedef struct { | 213 | struct emu10k1x_midi { |
218 | struct snd_emu10k1x *emu; | 214 | struct emu10k1x *emu; |
219 | snd_rawmidi_t *rmidi; | 215 | struct snd_rawmidi *rmidi; |
220 | snd_rawmidi_substream_t *substream_input; | 216 | struct snd_rawmidi_substream *substream_input; |
221 | snd_rawmidi_substream_t *substream_output; | 217 | struct snd_rawmidi_substream *substream_output; |
222 | unsigned int midi_mode; | 218 | unsigned int midi_mode; |
223 | spinlock_t input_lock; | 219 | spinlock_t input_lock; |
224 | spinlock_t output_lock; | 220 | spinlock_t output_lock; |
@@ -226,12 +222,12 @@ typedef struct { | |||
226 | int tx_enable, rx_enable; | 222 | int tx_enable, rx_enable; |
227 | int port; | 223 | int port; |
228 | int ipr_tx, ipr_rx; | 224 | int ipr_tx, ipr_rx; |
229 | void (*interrupt)(emu10k1x_t *emu, unsigned int status); | 225 | void (*interrupt)(struct emu10k1x *emu, unsigned int status); |
230 | } emu10k1x_midi_t; | 226 | }; |
231 | 227 | ||
232 | // definition of the chip-specific record | 228 | // definition of the chip-specific record |
233 | struct snd_emu10k1x { | 229 | struct emu10k1x { |
234 | snd_card_t *card; | 230 | struct snd_card *card; |
235 | struct pci_dev *pci; | 231 | struct pci_dev *pci; |
236 | 232 | ||
237 | unsigned long port; | 233 | unsigned long port; |
@@ -245,20 +241,20 @@ struct snd_emu10k1x { | |||
245 | spinlock_t emu_lock; | 241 | spinlock_t emu_lock; |
246 | spinlock_t voice_lock; | 242 | spinlock_t voice_lock; |
247 | 243 | ||
248 | ac97_t *ac97; | 244 | struct snd_ac97 *ac97; |
249 | snd_pcm_t *pcm; | 245 | struct snd_pcm *pcm; |
250 | 246 | ||
251 | emu10k1x_voice_t voices[3]; | 247 | struct emu10k1x_voice voices[3]; |
252 | emu10k1x_voice_t capture_voice; | 248 | struct emu10k1x_voice capture_voice; |
253 | u32 spdif_bits[3]; // SPDIF out setup | 249 | u32 spdif_bits[3]; // SPDIF out setup |
254 | 250 | ||
255 | struct snd_dma_buffer dma_buffer; | 251 | struct snd_dma_buffer dma_buffer; |
256 | 252 | ||
257 | emu10k1x_midi_t midi; | 253 | struct emu10k1x_midi midi; |
258 | }; | 254 | }; |
259 | 255 | ||
260 | /* hardware definition */ | 256 | /* hardware definition */ |
261 | static snd_pcm_hardware_t snd_emu10k1x_playback_hw = { | 257 | static struct snd_pcm_hardware snd_emu10k1x_playback_hw = { |
262 | .info = (SNDRV_PCM_INFO_MMAP | | 258 | .info = (SNDRV_PCM_INFO_MMAP | |
263 | SNDRV_PCM_INFO_INTERLEAVED | | 259 | SNDRV_PCM_INFO_INTERLEAVED | |
264 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 260 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -277,7 +273,7 @@ static snd_pcm_hardware_t snd_emu10k1x_playback_hw = { | |||
277 | .fifo_size = 0, | 273 | .fifo_size = 0, |
278 | }; | 274 | }; |
279 | 275 | ||
280 | static snd_pcm_hardware_t snd_emu10k1x_capture_hw = { | 276 | static struct snd_pcm_hardware snd_emu10k1x_capture_hw = { |
281 | .info = (SNDRV_PCM_INFO_MMAP | | 277 | .info = (SNDRV_PCM_INFO_MMAP | |
282 | SNDRV_PCM_INFO_INTERLEAVED | | 278 | SNDRV_PCM_INFO_INTERLEAVED | |
283 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 279 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -296,7 +292,7 @@ static snd_pcm_hardware_t snd_emu10k1x_capture_hw = { | |||
296 | .fifo_size = 0, | 292 | .fifo_size = 0, |
297 | }; | 293 | }; |
298 | 294 | ||
299 | static unsigned int snd_emu10k1x_ptr_read(emu10k1x_t * emu, | 295 | static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu, |
300 | unsigned int reg, | 296 | unsigned int reg, |
301 | unsigned int chn) | 297 | unsigned int chn) |
302 | { | 298 | { |
@@ -312,7 +308,7 @@ static unsigned int snd_emu10k1x_ptr_read(emu10k1x_t * emu, | |||
312 | return val; | 308 | return val; |
313 | } | 309 | } |
314 | 310 | ||
315 | static void snd_emu10k1x_ptr_write(emu10k1x_t *emu, | 311 | static void snd_emu10k1x_ptr_write(struct emu10k1x *emu, |
316 | unsigned int reg, | 312 | unsigned int reg, |
317 | unsigned int chn, | 313 | unsigned int chn, |
318 | unsigned int data) | 314 | unsigned int data) |
@@ -328,7 +324,7 @@ static void snd_emu10k1x_ptr_write(emu10k1x_t *emu, | |||
328 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 324 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
329 | } | 325 | } |
330 | 326 | ||
331 | static void snd_emu10k1x_intr_enable(emu10k1x_t *emu, unsigned int intrenb) | 327 | static void snd_emu10k1x_intr_enable(struct emu10k1x *emu, unsigned int intrenb) |
332 | { | 328 | { |
333 | unsigned long flags; | 329 | unsigned long flags; |
334 | unsigned int enable; | 330 | unsigned int enable; |
@@ -339,7 +335,7 @@ static void snd_emu10k1x_intr_enable(emu10k1x_t *emu, unsigned int intrenb) | |||
339 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 335 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
340 | } | 336 | } |
341 | 337 | ||
342 | static void snd_emu10k1x_intr_disable(emu10k1x_t *emu, unsigned int intrenb) | 338 | static void snd_emu10k1x_intr_disable(struct emu10k1x *emu, unsigned int intrenb) |
343 | { | 339 | { |
344 | unsigned long flags; | 340 | unsigned long flags; |
345 | unsigned int enable; | 341 | unsigned int enable; |
@@ -350,7 +346,7 @@ static void snd_emu10k1x_intr_disable(emu10k1x_t *emu, unsigned int intrenb) | |||
350 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 346 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
351 | } | 347 | } |
352 | 348 | ||
353 | static void snd_emu10k1x_gpio_write(emu10k1x_t *emu, unsigned int value) | 349 | static void snd_emu10k1x_gpio_write(struct emu10k1x *emu, unsigned int value) |
354 | { | 350 | { |
355 | unsigned long flags; | 351 | unsigned long flags; |
356 | 352 | ||
@@ -359,14 +355,14 @@ static void snd_emu10k1x_gpio_write(emu10k1x_t *emu, unsigned int value) | |||
359 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 355 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
360 | } | 356 | } |
361 | 357 | ||
362 | static void snd_emu10k1x_pcm_free_substream(snd_pcm_runtime_t *runtime) | 358 | static void snd_emu10k1x_pcm_free_substream(struct snd_pcm_runtime *runtime) |
363 | { | 359 | { |
364 | kfree(runtime->private_data); | 360 | kfree(runtime->private_data); |
365 | } | 361 | } |
366 | 362 | ||
367 | static void snd_emu10k1x_pcm_interrupt(emu10k1x_t *emu, emu10k1x_voice_t *voice) | 363 | static void snd_emu10k1x_pcm_interrupt(struct emu10k1x *emu, struct emu10k1x_voice *voice) |
368 | { | 364 | { |
369 | emu10k1x_pcm_t *epcm; | 365 | struct emu10k1x_pcm *epcm; |
370 | 366 | ||
371 | if ((epcm = voice->epcm) == NULL) | 367 | if ((epcm = voice->epcm) == NULL) |
372 | return; | 368 | return; |
@@ -382,11 +378,11 @@ static void snd_emu10k1x_pcm_interrupt(emu10k1x_t *emu, emu10k1x_voice_t *voice) | |||
382 | } | 378 | } |
383 | 379 | ||
384 | /* open callback */ | 380 | /* open callback */ |
385 | static int snd_emu10k1x_playback_open(snd_pcm_substream_t *substream) | 381 | static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream) |
386 | { | 382 | { |
387 | emu10k1x_t *chip = snd_pcm_substream_chip(substream); | 383 | struct emu10k1x *chip = snd_pcm_substream_chip(substream); |
388 | emu10k1x_pcm_t *epcm; | 384 | struct emu10k1x_pcm *epcm; |
389 | snd_pcm_runtime_t *runtime = substream->runtime; | 385 | struct snd_pcm_runtime *runtime = substream->runtime; |
390 | int err; | 386 | int err; |
391 | 387 | ||
392 | if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { | 388 | if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { |
@@ -410,17 +406,17 @@ static int snd_emu10k1x_playback_open(snd_pcm_substream_t *substream) | |||
410 | } | 406 | } |
411 | 407 | ||
412 | /* close callback */ | 408 | /* close callback */ |
413 | static int snd_emu10k1x_playback_close(snd_pcm_substream_t *substream) | 409 | static int snd_emu10k1x_playback_close(struct snd_pcm_substream *substream) |
414 | { | 410 | { |
415 | return 0; | 411 | return 0; |
416 | } | 412 | } |
417 | 413 | ||
418 | /* hw_params callback */ | 414 | /* hw_params callback */ |
419 | static int snd_emu10k1x_pcm_hw_params(snd_pcm_substream_t *substream, | 415 | static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream, |
420 | snd_pcm_hw_params_t * hw_params) | 416 | struct snd_pcm_hw_params *hw_params) |
421 | { | 417 | { |
422 | snd_pcm_runtime_t *runtime = substream->runtime; | 418 | struct snd_pcm_runtime *runtime = substream->runtime; |
423 | emu10k1x_pcm_t *epcm = runtime->private_data; | 419 | struct emu10k1x_pcm *epcm = runtime->private_data; |
424 | 420 | ||
425 | if (! epcm->voice) { | 421 | if (! epcm->voice) { |
426 | epcm->voice = &epcm->emu->voices[substream->pcm->device]; | 422 | epcm->voice = &epcm->emu->voices[substream->pcm->device]; |
@@ -433,10 +429,10 @@ static int snd_emu10k1x_pcm_hw_params(snd_pcm_substream_t *substream, | |||
433 | } | 429 | } |
434 | 430 | ||
435 | /* hw_free callback */ | 431 | /* hw_free callback */ |
436 | static int snd_emu10k1x_pcm_hw_free(snd_pcm_substream_t *substream) | 432 | static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream) |
437 | { | 433 | { |
438 | snd_pcm_runtime_t *runtime = substream->runtime; | 434 | struct snd_pcm_runtime *runtime = substream->runtime; |
439 | emu10k1x_pcm_t *epcm; | 435 | struct emu10k1x_pcm *epcm; |
440 | 436 | ||
441 | if (runtime->private_data == NULL) | 437 | if (runtime->private_data == NULL) |
442 | return 0; | 438 | return 0; |
@@ -453,11 +449,11 @@ static int snd_emu10k1x_pcm_hw_free(snd_pcm_substream_t *substream) | |||
453 | } | 449 | } |
454 | 450 | ||
455 | /* prepare callback */ | 451 | /* prepare callback */ |
456 | static int snd_emu10k1x_pcm_prepare(snd_pcm_substream_t *substream) | 452 | static int snd_emu10k1x_pcm_prepare(struct snd_pcm_substream *substream) |
457 | { | 453 | { |
458 | emu10k1x_t *emu = snd_pcm_substream_chip(substream); | 454 | struct emu10k1x *emu = snd_pcm_substream_chip(substream); |
459 | snd_pcm_runtime_t *runtime = substream->runtime; | 455 | struct snd_pcm_runtime *runtime = substream->runtime; |
460 | emu10k1x_pcm_t *epcm = runtime->private_data; | 456 | struct emu10k1x_pcm *epcm = runtime->private_data; |
461 | int voice = epcm->voice->number; | 457 | int voice = epcm->voice->number; |
462 | u32 *table_base = (u32 *)(emu->dma_buffer.area+1024*voice); | 458 | u32 *table_base = (u32 *)(emu->dma_buffer.area+1024*voice); |
463 | u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); | 459 | u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); |
@@ -482,12 +478,12 @@ static int snd_emu10k1x_pcm_prepare(snd_pcm_substream_t *substream) | |||
482 | } | 478 | } |
483 | 479 | ||
484 | /* trigger callback */ | 480 | /* trigger callback */ |
485 | static int snd_emu10k1x_pcm_trigger(snd_pcm_substream_t *substream, | 481 | static int snd_emu10k1x_pcm_trigger(struct snd_pcm_substream *substream, |
486 | int cmd) | 482 | int cmd) |
487 | { | 483 | { |
488 | emu10k1x_t *emu = snd_pcm_substream_chip(substream); | 484 | struct emu10k1x *emu = snd_pcm_substream_chip(substream); |
489 | snd_pcm_runtime_t *runtime = substream->runtime; | 485 | struct snd_pcm_runtime *runtime = substream->runtime; |
490 | emu10k1x_pcm_t *epcm = runtime->private_data; | 486 | struct emu10k1x_pcm *epcm = runtime->private_data; |
491 | int channel = epcm->voice->number; | 487 | int channel = epcm->voice->number; |
492 | int result = 0; | 488 | int result = 0; |
493 | 489 | ||
@@ -516,11 +512,11 @@ static int snd_emu10k1x_pcm_trigger(snd_pcm_substream_t *substream, | |||
516 | 512 | ||
517 | /* pointer callback */ | 513 | /* pointer callback */ |
518 | static snd_pcm_uframes_t | 514 | static snd_pcm_uframes_t |
519 | snd_emu10k1x_pcm_pointer(snd_pcm_substream_t *substream) | 515 | snd_emu10k1x_pcm_pointer(struct snd_pcm_substream *substream) |
520 | { | 516 | { |
521 | emu10k1x_t *emu = snd_pcm_substream_chip(substream); | 517 | struct emu10k1x *emu = snd_pcm_substream_chip(substream); |
522 | snd_pcm_runtime_t *runtime = substream->runtime; | 518 | struct snd_pcm_runtime *runtime = substream->runtime; |
523 | emu10k1x_pcm_t *epcm = runtime->private_data; | 519 | struct emu10k1x_pcm *epcm = runtime->private_data; |
524 | int channel = epcm->voice->number; | 520 | int channel = epcm->voice->number; |
525 | snd_pcm_uframes_t ptr = 0, ptr1 = 0, ptr2= 0,ptr3 = 0,ptr4 = 0; | 521 | snd_pcm_uframes_t ptr = 0, ptr1 = 0, ptr2= 0,ptr3 = 0,ptr4 = 0; |
526 | 522 | ||
@@ -547,7 +543,7 @@ snd_emu10k1x_pcm_pointer(snd_pcm_substream_t *substream) | |||
547 | } | 543 | } |
548 | 544 | ||
549 | /* operators */ | 545 | /* operators */ |
550 | static snd_pcm_ops_t snd_emu10k1x_playback_ops = { | 546 | static struct snd_pcm_ops snd_emu10k1x_playback_ops = { |
551 | .open = snd_emu10k1x_playback_open, | 547 | .open = snd_emu10k1x_playback_open, |
552 | .close = snd_emu10k1x_playback_close, | 548 | .close = snd_emu10k1x_playback_close, |
553 | .ioctl = snd_pcm_lib_ioctl, | 549 | .ioctl = snd_pcm_lib_ioctl, |
@@ -559,11 +555,11 @@ static snd_pcm_ops_t snd_emu10k1x_playback_ops = { | |||
559 | }; | 555 | }; |
560 | 556 | ||
561 | /* open_capture callback */ | 557 | /* open_capture callback */ |
562 | static int snd_emu10k1x_pcm_open_capture(snd_pcm_substream_t *substream) | 558 | static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream) |
563 | { | 559 | { |
564 | emu10k1x_t *chip = snd_pcm_substream_chip(substream); | 560 | struct emu10k1x *chip = snd_pcm_substream_chip(substream); |
565 | emu10k1x_pcm_t *epcm; | 561 | struct emu10k1x_pcm *epcm; |
566 | snd_pcm_runtime_t *runtime = substream->runtime; | 562 | struct snd_pcm_runtime *runtime = substream->runtime; |
567 | int err; | 563 | int err; |
568 | 564 | ||
569 | if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) | 565 | if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) |
@@ -587,17 +583,17 @@ static int snd_emu10k1x_pcm_open_capture(snd_pcm_substream_t *substream) | |||
587 | } | 583 | } |
588 | 584 | ||
589 | /* close callback */ | 585 | /* close callback */ |
590 | static int snd_emu10k1x_pcm_close_capture(snd_pcm_substream_t *substream) | 586 | static int snd_emu10k1x_pcm_close_capture(struct snd_pcm_substream *substream) |
591 | { | 587 | { |
592 | return 0; | 588 | return 0; |
593 | } | 589 | } |
594 | 590 | ||
595 | /* hw_params callback */ | 591 | /* hw_params callback */ |
596 | static int snd_emu10k1x_pcm_hw_params_capture(snd_pcm_substream_t *substream, | 592 | static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substream, |
597 | snd_pcm_hw_params_t * hw_params) | 593 | struct snd_pcm_hw_params *hw_params) |
598 | { | 594 | { |
599 | snd_pcm_runtime_t *runtime = substream->runtime; | 595 | struct snd_pcm_runtime *runtime = substream->runtime; |
600 | emu10k1x_pcm_t *epcm = runtime->private_data; | 596 | struct emu10k1x_pcm *epcm = runtime->private_data; |
601 | 597 | ||
602 | if (! epcm->voice) { | 598 | if (! epcm->voice) { |
603 | if (epcm->emu->capture_voice.use) | 599 | if (epcm->emu->capture_voice.use) |
@@ -612,11 +608,11 @@ static int snd_emu10k1x_pcm_hw_params_capture(snd_pcm_substream_t *substream, | |||
612 | } | 608 | } |
613 | 609 | ||
614 | /* hw_free callback */ | 610 | /* hw_free callback */ |
615 | static int snd_emu10k1x_pcm_hw_free_capture(snd_pcm_substream_t *substream) | 611 | static int snd_emu10k1x_pcm_hw_free_capture(struct snd_pcm_substream *substream) |
616 | { | 612 | { |
617 | snd_pcm_runtime_t *runtime = substream->runtime; | 613 | struct snd_pcm_runtime *runtime = substream->runtime; |
618 | 614 | ||
619 | emu10k1x_pcm_t *epcm; | 615 | struct emu10k1x_pcm *epcm; |
620 | 616 | ||
621 | if (runtime->private_data == NULL) | 617 | if (runtime->private_data == NULL) |
622 | return 0; | 618 | return 0; |
@@ -632,10 +628,10 @@ static int snd_emu10k1x_pcm_hw_free_capture(snd_pcm_substream_t *substream) | |||
632 | } | 628 | } |
633 | 629 | ||
634 | /* prepare capture callback */ | 630 | /* prepare capture callback */ |
635 | static int snd_emu10k1x_pcm_prepare_capture(snd_pcm_substream_t *substream) | 631 | static int snd_emu10k1x_pcm_prepare_capture(struct snd_pcm_substream *substream) |
636 | { | 632 | { |
637 | emu10k1x_t *emu = snd_pcm_substream_chip(substream); | 633 | struct emu10k1x *emu = snd_pcm_substream_chip(substream); |
638 | snd_pcm_runtime_t *runtime = substream->runtime; | 634 | struct snd_pcm_runtime *runtime = substream->runtime; |
639 | 635 | ||
640 | snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr); | 636 | snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr); |
641 | snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes | 637 | snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes |
@@ -646,12 +642,12 @@ static int snd_emu10k1x_pcm_prepare_capture(snd_pcm_substream_t *substream) | |||
646 | } | 642 | } |
647 | 643 | ||
648 | /* trigger_capture callback */ | 644 | /* trigger_capture callback */ |
649 | static int snd_emu10k1x_pcm_trigger_capture(snd_pcm_substream_t *substream, | 645 | static int snd_emu10k1x_pcm_trigger_capture(struct snd_pcm_substream *substream, |
650 | int cmd) | 646 | int cmd) |
651 | { | 647 | { |
652 | emu10k1x_t *emu = snd_pcm_substream_chip(substream); | 648 | struct emu10k1x *emu = snd_pcm_substream_chip(substream); |
653 | snd_pcm_runtime_t *runtime = substream->runtime; | 649 | struct snd_pcm_runtime *runtime = substream->runtime; |
654 | emu10k1x_pcm_t *epcm = runtime->private_data; | 650 | struct emu10k1x_pcm *epcm = runtime->private_data; |
655 | int result = 0; | 651 | int result = 0; |
656 | 652 | ||
657 | switch (cmd) { | 653 | switch (cmd) { |
@@ -676,11 +672,11 @@ static int snd_emu10k1x_pcm_trigger_capture(snd_pcm_substream_t *substream, | |||
676 | 672 | ||
677 | /* pointer_capture callback */ | 673 | /* pointer_capture callback */ |
678 | static snd_pcm_uframes_t | 674 | static snd_pcm_uframes_t |
679 | snd_emu10k1x_pcm_pointer_capture(snd_pcm_substream_t *substream) | 675 | snd_emu10k1x_pcm_pointer_capture(struct snd_pcm_substream *substream) |
680 | { | 676 | { |
681 | emu10k1x_t *emu = snd_pcm_substream_chip(substream); | 677 | struct emu10k1x *emu = snd_pcm_substream_chip(substream); |
682 | snd_pcm_runtime_t *runtime = substream->runtime; | 678 | struct snd_pcm_runtime *runtime = substream->runtime; |
683 | emu10k1x_pcm_t *epcm = runtime->private_data; | 679 | struct emu10k1x_pcm *epcm = runtime->private_data; |
684 | snd_pcm_uframes_t ptr; | 680 | snd_pcm_uframes_t ptr; |
685 | 681 | ||
686 | if (!epcm->running) | 682 | if (!epcm->running) |
@@ -693,7 +689,7 @@ snd_emu10k1x_pcm_pointer_capture(snd_pcm_substream_t *substream) | |||
693 | return ptr; | 689 | return ptr; |
694 | } | 690 | } |
695 | 691 | ||
696 | static snd_pcm_ops_t snd_emu10k1x_capture_ops = { | 692 | static struct snd_pcm_ops snd_emu10k1x_capture_ops = { |
697 | .open = snd_emu10k1x_pcm_open_capture, | 693 | .open = snd_emu10k1x_pcm_open_capture, |
698 | .close = snd_emu10k1x_pcm_close_capture, | 694 | .close = snd_emu10k1x_pcm_close_capture, |
699 | .ioctl = snd_pcm_lib_ioctl, | 695 | .ioctl = snd_pcm_lib_ioctl, |
@@ -704,10 +700,10 @@ static snd_pcm_ops_t snd_emu10k1x_capture_ops = { | |||
704 | .pointer = snd_emu10k1x_pcm_pointer_capture, | 700 | .pointer = snd_emu10k1x_pcm_pointer_capture, |
705 | }; | 701 | }; |
706 | 702 | ||
707 | static unsigned short snd_emu10k1x_ac97_read(ac97_t *ac97, | 703 | static unsigned short snd_emu10k1x_ac97_read(struct snd_ac97 *ac97, |
708 | unsigned short reg) | 704 | unsigned short reg) |
709 | { | 705 | { |
710 | emu10k1x_t *emu = ac97->private_data; | 706 | struct emu10k1x *emu = ac97->private_data; |
711 | unsigned long flags; | 707 | unsigned long flags; |
712 | unsigned short val; | 708 | unsigned short val; |
713 | 709 | ||
@@ -718,10 +714,10 @@ static unsigned short snd_emu10k1x_ac97_read(ac97_t *ac97, | |||
718 | return val; | 714 | return val; |
719 | } | 715 | } |
720 | 716 | ||
721 | static void snd_emu10k1x_ac97_write(ac97_t *ac97, | 717 | static void snd_emu10k1x_ac97_write(struct snd_ac97 *ac97, |
722 | unsigned short reg, unsigned short val) | 718 | unsigned short reg, unsigned short val) |
723 | { | 719 | { |
724 | emu10k1x_t *emu = ac97->private_data; | 720 | struct emu10k1x *emu = ac97->private_data; |
725 | unsigned long flags; | 721 | unsigned long flags; |
726 | 722 | ||
727 | spin_lock_irqsave(&emu->emu_lock, flags); | 723 | spin_lock_irqsave(&emu->emu_lock, flags); |
@@ -730,12 +726,12 @@ static void snd_emu10k1x_ac97_write(ac97_t *ac97, | |||
730 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 726 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
731 | } | 727 | } |
732 | 728 | ||
733 | static int snd_emu10k1x_ac97(emu10k1x_t *chip) | 729 | static int snd_emu10k1x_ac97(struct emu10k1x *chip) |
734 | { | 730 | { |
735 | ac97_bus_t *pbus; | 731 | struct snd_ac97_bus *pbus; |
736 | ac97_template_t ac97; | 732 | struct snd_ac97_template ac97; |
737 | int err; | 733 | int err; |
738 | static ac97_bus_ops_t ops = { | 734 | static struct snd_ac97_bus_ops ops = { |
739 | .write = snd_emu10k1x_ac97_write, | 735 | .write = snd_emu10k1x_ac97_write, |
740 | .read = snd_emu10k1x_ac97_read, | 736 | .read = snd_emu10k1x_ac97_read, |
741 | }; | 737 | }; |
@@ -750,7 +746,7 @@ static int snd_emu10k1x_ac97(emu10k1x_t *chip) | |||
750 | return snd_ac97_mixer(pbus, &ac97, &chip->ac97); | 746 | return snd_ac97_mixer(pbus, &ac97, &chip->ac97); |
751 | } | 747 | } |
752 | 748 | ||
753 | static int snd_emu10k1x_free(emu10k1x_t *chip) | 749 | static int snd_emu10k1x_free(struct emu10k1x *chip) |
754 | { | 750 | { |
755 | snd_emu10k1x_ptr_write(chip, TRIGGER_CHANNEL, 0, 0); | 751 | snd_emu10k1x_ptr_write(chip, TRIGGER_CHANNEL, 0, 0); |
756 | // disable interrupts | 752 | // disable interrupts |
@@ -777,9 +773,9 @@ static int snd_emu10k1x_free(emu10k1x_t *chip) | |||
777 | return 0; | 773 | return 0; |
778 | } | 774 | } |
779 | 775 | ||
780 | static int snd_emu10k1x_dev_free(snd_device_t *device) | 776 | static int snd_emu10k1x_dev_free(struct snd_device *device) |
781 | { | 777 | { |
782 | emu10k1x_t *chip = device->device_data; | 778 | struct emu10k1x *chip = device->device_data; |
783 | return snd_emu10k1x_free(chip); | 779 | return snd_emu10k1x_free(chip); |
784 | } | 780 | } |
785 | 781 | ||
@@ -788,8 +784,8 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id, | |||
788 | { | 784 | { |
789 | unsigned int status; | 785 | unsigned int status; |
790 | 786 | ||
791 | emu10k1x_t *chip = dev_id; | 787 | struct emu10k1x *chip = dev_id; |
792 | emu10k1x_voice_t *pvoice = chip->voices; | 788 | struct emu10k1x_voice *pvoice = chip->voices; |
793 | int i; | 789 | int i; |
794 | int mask; | 790 | int mask; |
795 | 791 | ||
@@ -800,8 +796,8 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id, | |||
800 | 796 | ||
801 | // capture interrupt | 797 | // capture interrupt |
802 | if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { | 798 | if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { |
803 | emu10k1x_voice_t *pvoice = &chip->capture_voice; | 799 | struct emu10k1x_voice *pvoice = &chip->capture_voice; |
804 | if(pvoice->use) | 800 | if (pvoice->use) |
805 | snd_emu10k1x_pcm_interrupt(chip, pvoice); | 801 | snd_emu10k1x_pcm_interrupt(chip, pvoice); |
806 | else | 802 | else |
807 | snd_emu10k1x_intr_disable(chip, | 803 | snd_emu10k1x_intr_disable(chip, |
@@ -835,9 +831,9 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id, | |||
835 | return IRQ_HANDLED; | 831 | return IRQ_HANDLED; |
836 | } | 832 | } |
837 | 833 | ||
838 | static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **rpcm) | 834 | static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct snd_pcm **rpcm) |
839 | { | 835 | { |
840 | snd_pcm_t *pcm; | 836 | struct snd_pcm *pcm; |
841 | int err; | 837 | int err; |
842 | int capture = 0; | 838 | int capture = 0; |
843 | 839 | ||
@@ -887,14 +883,14 @@ static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **r | |||
887 | return 0; | 883 | return 0; |
888 | } | 884 | } |
889 | 885 | ||
890 | static int __devinit snd_emu10k1x_create(snd_card_t *card, | 886 | static int __devinit snd_emu10k1x_create(struct snd_card *card, |
891 | struct pci_dev *pci, | 887 | struct pci_dev *pci, |
892 | emu10k1x_t **rchip) | 888 | struct emu10k1x **rchip) |
893 | { | 889 | { |
894 | emu10k1x_t *chip; | 890 | struct emu10k1x *chip; |
895 | int err; | 891 | int err; |
896 | int ch; | 892 | int ch; |
897 | static snd_device_ops_t ops = { | 893 | static struct snd_device_ops ops = { |
898 | .dev_free = snd_emu10k1x_dev_free, | 894 | .dev_free = snd_emu10k1x_dev_free, |
899 | }; | 895 | }; |
900 | 896 | ||
@@ -1008,10 +1004,10 @@ static int __devinit snd_emu10k1x_create(snd_card_t *card, | |||
1008 | return 0; | 1004 | return 0; |
1009 | } | 1005 | } |
1010 | 1006 | ||
1011 | static void snd_emu10k1x_proc_reg_read(snd_info_entry_t *entry, | 1007 | static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry, |
1012 | snd_info_buffer_t * buffer) | 1008 | struct snd_info_buffer *buffer) |
1013 | { | 1009 | { |
1014 | emu10k1x_t *emu = entry->private_data; | 1010 | struct emu10k1x *emu = entry->private_data; |
1015 | unsigned long value,value1,value2; | 1011 | unsigned long value,value1,value2; |
1016 | unsigned long flags; | 1012 | unsigned long flags; |
1017 | int i; | 1013 | int i; |
@@ -1036,10 +1032,10 @@ static void snd_emu10k1x_proc_reg_read(snd_info_entry_t *entry, | |||
1036 | } | 1032 | } |
1037 | } | 1033 | } |
1038 | 1034 | ||
1039 | static void snd_emu10k1x_proc_reg_write(snd_info_entry_t *entry, | 1035 | static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry, |
1040 | snd_info_buffer_t *buffer) | 1036 | struct snd_info_buffer *buffer) |
1041 | { | 1037 | { |
1042 | emu10k1x_t *emu = entry->private_data; | 1038 | struct emu10k1x *emu = entry->private_data; |
1043 | char line[64]; | 1039 | char line[64]; |
1044 | unsigned int reg, channel_id , val; | 1040 | unsigned int reg, channel_id , val; |
1045 | 1041 | ||
@@ -1053,9 +1049,9 @@ static void snd_emu10k1x_proc_reg_write(snd_info_entry_t *entry, | |||
1053 | } | 1049 | } |
1054 | } | 1050 | } |
1055 | 1051 | ||
1056 | static int __devinit snd_emu10k1x_proc_init(emu10k1x_t * emu) | 1052 | static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu) |
1057 | { | 1053 | { |
1058 | snd_info_entry_t *entry; | 1054 | struct snd_info_entry *entry; |
1059 | 1055 | ||
1060 | if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) { | 1056 | if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) { |
1061 | snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1x_proc_reg_read); | 1057 | snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1x_proc_reg_read); |
@@ -1068,7 +1064,7 @@ static int __devinit snd_emu10k1x_proc_init(emu10k1x_t * emu) | |||
1068 | return 0; | 1064 | return 0; |
1069 | } | 1065 | } |
1070 | 1066 | ||
1071 | static int snd_emu10k1x_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1067 | static int snd_emu10k1x_shared_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1072 | { | 1068 | { |
1073 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1069 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1074 | uinfo->count = 1; | 1070 | uinfo->count = 1; |
@@ -1077,20 +1073,20 @@ static int snd_emu10k1x_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem | |||
1077 | return 0; | 1073 | return 0; |
1078 | } | 1074 | } |
1079 | 1075 | ||
1080 | static int snd_emu10k1x_shared_spdif_get(snd_kcontrol_t * kcontrol, | 1076 | static int snd_emu10k1x_shared_spdif_get(struct snd_kcontrol *kcontrol, |
1081 | snd_ctl_elem_value_t * ucontrol) | 1077 | struct snd_ctl_elem_value *ucontrol) |
1082 | { | 1078 | { |
1083 | emu10k1x_t *emu = snd_kcontrol_chip(kcontrol); | 1079 | struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); |
1084 | 1080 | ||
1085 | ucontrol->value.integer.value[0] = (snd_emu10k1x_ptr_read(emu, SPDIF_SELECT, 0) == 0x700) ? 0 : 1; | 1081 | ucontrol->value.integer.value[0] = (snd_emu10k1x_ptr_read(emu, SPDIF_SELECT, 0) == 0x700) ? 0 : 1; |
1086 | 1082 | ||
1087 | return 0; | 1083 | return 0; |
1088 | } | 1084 | } |
1089 | 1085 | ||
1090 | static int snd_emu10k1x_shared_spdif_put(snd_kcontrol_t * kcontrol, | 1086 | static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol, |
1091 | snd_ctl_elem_value_t * ucontrol) | 1087 | struct snd_ctl_elem_value *ucontrol) |
1092 | { | 1088 | { |
1093 | emu10k1x_t *emu = snd_kcontrol_chip(kcontrol); | 1089 | struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); |
1094 | unsigned int val; | 1090 | unsigned int val; |
1095 | int change = 0; | 1091 | int change = 0; |
1096 | 1092 | ||
@@ -1110,7 +1106,7 @@ static int snd_emu10k1x_shared_spdif_put(snd_kcontrol_t * kcontrol, | |||
1110 | return change; | 1106 | return change; |
1111 | } | 1107 | } |
1112 | 1108 | ||
1113 | static snd_kcontrol_new_t snd_emu10k1x_shared_spdif __devinitdata = | 1109 | static struct snd_kcontrol_new snd_emu10k1x_shared_spdif __devinitdata = |
1114 | { | 1110 | { |
1115 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1111 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1116 | .name = "Analog/Digital Output Jack", | 1112 | .name = "Analog/Digital Output Jack", |
@@ -1119,17 +1115,17 @@ static snd_kcontrol_new_t snd_emu10k1x_shared_spdif __devinitdata = | |||
1119 | .put = snd_emu10k1x_shared_spdif_put | 1115 | .put = snd_emu10k1x_shared_spdif_put |
1120 | }; | 1116 | }; |
1121 | 1117 | ||
1122 | static int snd_emu10k1x_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1118 | static int snd_emu10k1x_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1123 | { | 1119 | { |
1124 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1120 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1125 | uinfo->count = 1; | 1121 | uinfo->count = 1; |
1126 | return 0; | 1122 | return 0; |
1127 | } | 1123 | } |
1128 | 1124 | ||
1129 | static int snd_emu10k1x_spdif_get(snd_kcontrol_t * kcontrol, | 1125 | static int snd_emu10k1x_spdif_get(struct snd_kcontrol *kcontrol, |
1130 | snd_ctl_elem_value_t * ucontrol) | 1126 | struct snd_ctl_elem_value *ucontrol) |
1131 | { | 1127 | { |
1132 | emu10k1x_t *emu = snd_kcontrol_chip(kcontrol); | 1128 | struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); |
1133 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1129 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1134 | 1130 | ||
1135 | ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff; | 1131 | ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff; |
@@ -1139,8 +1135,8 @@ static int snd_emu10k1x_spdif_get(snd_kcontrol_t * kcontrol, | |||
1139 | return 0; | 1135 | return 0; |
1140 | } | 1136 | } |
1141 | 1137 | ||
1142 | static int snd_emu10k1x_spdif_get_mask(snd_kcontrol_t * kcontrol, | 1138 | static int snd_emu10k1x_spdif_get_mask(struct snd_kcontrol *kcontrol, |
1143 | snd_ctl_elem_value_t * ucontrol) | 1139 | struct snd_ctl_elem_value *ucontrol) |
1144 | { | 1140 | { |
1145 | ucontrol->value.iec958.status[0] = 0xff; | 1141 | ucontrol->value.iec958.status[0] = 0xff; |
1146 | ucontrol->value.iec958.status[1] = 0xff; | 1142 | ucontrol->value.iec958.status[1] = 0xff; |
@@ -1149,10 +1145,10 @@ static int snd_emu10k1x_spdif_get_mask(snd_kcontrol_t * kcontrol, | |||
1149 | return 0; | 1145 | return 0; |
1150 | } | 1146 | } |
1151 | 1147 | ||
1152 | static int snd_emu10k1x_spdif_put(snd_kcontrol_t * kcontrol, | 1148 | static int snd_emu10k1x_spdif_put(struct snd_kcontrol *kcontrol, |
1153 | snd_ctl_elem_value_t * ucontrol) | 1149 | struct snd_ctl_elem_value *ucontrol) |
1154 | { | 1150 | { |
1155 | emu10k1x_t *emu = snd_kcontrol_chip(kcontrol); | 1151 | struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); |
1156 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1152 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1157 | int change; | 1153 | int change; |
1158 | unsigned int val; | 1154 | unsigned int val; |
@@ -1169,7 +1165,7 @@ static int snd_emu10k1x_spdif_put(snd_kcontrol_t * kcontrol, | |||
1169 | return change; | 1165 | return change; |
1170 | } | 1166 | } |
1171 | 1167 | ||
1172 | static snd_kcontrol_new_t snd_emu10k1x_spdif_mask_control = | 1168 | static struct snd_kcontrol_new snd_emu10k1x_spdif_mask_control = |
1173 | { | 1169 | { |
1174 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1170 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1175 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1171 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1179,7 +1175,7 @@ static snd_kcontrol_new_t snd_emu10k1x_spdif_mask_control = | |||
1179 | .get = snd_emu10k1x_spdif_get_mask | 1175 | .get = snd_emu10k1x_spdif_get_mask |
1180 | }; | 1176 | }; |
1181 | 1177 | ||
1182 | static snd_kcontrol_new_t snd_emu10k1x_spdif_control = | 1178 | static struct snd_kcontrol_new snd_emu10k1x_spdif_control = |
1183 | { | 1179 | { |
1184 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1180 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1185 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), | 1181 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), |
@@ -1189,11 +1185,11 @@ static snd_kcontrol_new_t snd_emu10k1x_spdif_control = | |||
1189 | .put = snd_emu10k1x_spdif_put | 1185 | .put = snd_emu10k1x_spdif_put |
1190 | }; | 1186 | }; |
1191 | 1187 | ||
1192 | static int __devinit snd_emu10k1x_mixer(emu10k1x_t *emu) | 1188 | static int __devinit snd_emu10k1x_mixer(struct emu10k1x *emu) |
1193 | { | 1189 | { |
1194 | int err; | 1190 | int err; |
1195 | snd_kcontrol_t *kctl; | 1191 | struct snd_kcontrol *kctl; |
1196 | snd_card_t *card = emu->card; | 1192 | struct snd_card *card = emu->card; |
1197 | 1193 | ||
1198 | if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu)) == NULL) | 1194 | if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu)) == NULL) |
1199 | return -ENOMEM; | 1195 | return -ENOMEM; |
@@ -1214,12 +1210,12 @@ static int __devinit snd_emu10k1x_mixer(emu10k1x_t *emu) | |||
1214 | #define EMU10K1X_MIDI_MODE_INPUT (1<<0) | 1210 | #define EMU10K1X_MIDI_MODE_INPUT (1<<0) |
1215 | #define EMU10K1X_MIDI_MODE_OUTPUT (1<<1) | 1211 | #define EMU10K1X_MIDI_MODE_OUTPUT (1<<1) |
1216 | 1212 | ||
1217 | static inline unsigned char mpu401_read(emu10k1x_t *emu, emu10k1x_midi_t *mpu, int idx) | 1213 | static inline unsigned char mpu401_read(struct emu10k1x *emu, struct emu10k1x_midi *mpu, int idx) |
1218 | { | 1214 | { |
1219 | return (unsigned char)snd_emu10k1x_ptr_read(emu, mpu->port + idx, 0); | 1215 | return (unsigned char)snd_emu10k1x_ptr_read(emu, mpu->port + idx, 0); |
1220 | } | 1216 | } |
1221 | 1217 | ||
1222 | static inline void mpu401_write(emu10k1x_t *emu, emu10k1x_midi_t *mpu, int data, int idx) | 1218 | static inline void mpu401_write(struct emu10k1x *emu, struct emu10k1x_midi *mpu, int data, int idx) |
1223 | { | 1219 | { |
1224 | snd_emu10k1x_ptr_write(emu, mpu->port + idx, 0, data); | 1220 | snd_emu10k1x_ptr_write(emu, mpu->port + idx, 0, data); |
1225 | } | 1221 | } |
@@ -1236,7 +1232,7 @@ static inline void mpu401_write(emu10k1x_t *emu, emu10k1x_midi_t *mpu, int data, | |||
1236 | #define MPU401_ENTER_UART 0x3f | 1232 | #define MPU401_ENTER_UART 0x3f |
1237 | #define MPU401_ACK 0xfe | 1233 | #define MPU401_ACK 0xfe |
1238 | 1234 | ||
1239 | static void mpu401_clear_rx(emu10k1x_t *emu, emu10k1x_midi_t *mpu) | 1235 | static void mpu401_clear_rx(struct emu10k1x *emu, struct emu10k1x_midi *mpu) |
1240 | { | 1236 | { |
1241 | int timeout = 100000; | 1237 | int timeout = 100000; |
1242 | for (; timeout > 0 && mpu401_input_avail(emu, mpu); timeout--) | 1238 | for (; timeout > 0 && mpu401_input_avail(emu, mpu); timeout--) |
@@ -1251,7 +1247,8 @@ static void mpu401_clear_rx(emu10k1x_t *emu, emu10k1x_midi_t *mpu) | |||
1251 | 1247 | ||
1252 | */ | 1248 | */ |
1253 | 1249 | ||
1254 | static void do_emu10k1x_midi_interrupt(emu10k1x_t *emu, emu10k1x_midi_t *midi, unsigned int status) | 1250 | static void do_emu10k1x_midi_interrupt(struct emu10k1x *emu, |
1251 | struct emu10k1x_midi *midi, unsigned int status) | ||
1255 | { | 1252 | { |
1256 | unsigned char byte; | 1253 | unsigned char byte; |
1257 | 1254 | ||
@@ -1284,12 +1281,13 @@ static void do_emu10k1x_midi_interrupt(emu10k1x_t *emu, emu10k1x_midi_t *midi, u | |||
1284 | spin_unlock(&midi->output_lock); | 1281 | spin_unlock(&midi->output_lock); |
1285 | } | 1282 | } |
1286 | 1283 | ||
1287 | static void snd_emu10k1x_midi_interrupt(emu10k1x_t *emu, unsigned int status) | 1284 | static void snd_emu10k1x_midi_interrupt(struct emu10k1x *emu, unsigned int status) |
1288 | { | 1285 | { |
1289 | do_emu10k1x_midi_interrupt(emu, &emu->midi, status); | 1286 | do_emu10k1x_midi_interrupt(emu, &emu->midi, status); |
1290 | } | 1287 | } |
1291 | 1288 | ||
1292 | static void snd_emu10k1x_midi_cmd(emu10k1x_t * emu, emu10k1x_midi_t *midi, unsigned char cmd, int ack) | 1289 | static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu, |
1290 | struct emu10k1x_midi *midi, unsigned char cmd, int ack) | ||
1293 | { | 1291 | { |
1294 | unsigned long flags; | 1292 | unsigned long flags; |
1295 | int timeout, ok; | 1293 | int timeout, ok; |
@@ -1321,10 +1319,10 @@ static void snd_emu10k1x_midi_cmd(emu10k1x_t * emu, emu10k1x_midi_t *midi, unsig | |||
1321 | mpu401_read_data(emu, midi)); | 1319 | mpu401_read_data(emu, midi)); |
1322 | } | 1320 | } |
1323 | 1321 | ||
1324 | static int snd_emu10k1x_midi_input_open(snd_rawmidi_substream_t * substream) | 1322 | static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream) |
1325 | { | 1323 | { |
1326 | emu10k1x_t *emu; | 1324 | struct emu10k1x *emu; |
1327 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data; | 1325 | struct emu10k1x_midi *midi = substream->rmidi->private_data; |
1328 | unsigned long flags; | 1326 | unsigned long flags; |
1329 | 1327 | ||
1330 | emu = midi->emu; | 1328 | emu = midi->emu; |
@@ -1342,10 +1340,10 @@ static int snd_emu10k1x_midi_input_open(snd_rawmidi_substream_t * substream) | |||
1342 | return 0; | 1340 | return 0; |
1343 | } | 1341 | } |
1344 | 1342 | ||
1345 | static int snd_emu10k1x_midi_output_open(snd_rawmidi_substream_t * substream) | 1343 | static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream) |
1346 | { | 1344 | { |
1347 | emu10k1x_t *emu; | 1345 | struct emu10k1x *emu; |
1348 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data; | 1346 | struct emu10k1x_midi *midi = substream->rmidi->private_data; |
1349 | unsigned long flags; | 1347 | unsigned long flags; |
1350 | 1348 | ||
1351 | emu = midi->emu; | 1349 | emu = midi->emu; |
@@ -1363,10 +1361,10 @@ static int snd_emu10k1x_midi_output_open(snd_rawmidi_substream_t * substream) | |||
1363 | return 0; | 1361 | return 0; |
1364 | } | 1362 | } |
1365 | 1363 | ||
1366 | static int snd_emu10k1x_midi_input_close(snd_rawmidi_substream_t * substream) | 1364 | static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream) |
1367 | { | 1365 | { |
1368 | emu10k1x_t *emu; | 1366 | struct emu10k1x *emu; |
1369 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data; | 1367 | struct emu10k1x_midi *midi = substream->rmidi->private_data; |
1370 | unsigned long flags; | 1368 | unsigned long flags; |
1371 | 1369 | ||
1372 | emu = midi->emu; | 1370 | emu = midi->emu; |
@@ -1384,10 +1382,10 @@ static int snd_emu10k1x_midi_input_close(snd_rawmidi_substream_t * substream) | |||
1384 | return 0; | 1382 | return 0; |
1385 | } | 1383 | } |
1386 | 1384 | ||
1387 | static int snd_emu10k1x_midi_output_close(snd_rawmidi_substream_t * substream) | 1385 | static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream) |
1388 | { | 1386 | { |
1389 | emu10k1x_t *emu; | 1387 | struct emu10k1x *emu; |
1390 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data; | 1388 | struct emu10k1x_midi *midi = substream->rmidi->private_data; |
1391 | unsigned long flags; | 1389 | unsigned long flags; |
1392 | 1390 | ||
1393 | emu = midi->emu; | 1391 | emu = midi->emu; |
@@ -1405,10 +1403,10 @@ static int snd_emu10k1x_midi_output_close(snd_rawmidi_substream_t * substream) | |||
1405 | return 0; | 1403 | return 0; |
1406 | } | 1404 | } |
1407 | 1405 | ||
1408 | static void snd_emu10k1x_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) | 1406 | static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) |
1409 | { | 1407 | { |
1410 | emu10k1x_t *emu; | 1408 | struct emu10k1x *emu; |
1411 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data; | 1409 | struct emu10k1x_midi *midi = substream->rmidi->private_data; |
1412 | emu = midi->emu; | 1410 | emu = midi->emu; |
1413 | snd_assert(emu, return); | 1411 | snd_assert(emu, return); |
1414 | 1412 | ||
@@ -1418,10 +1416,10 @@ static void snd_emu10k1x_midi_input_trigger(snd_rawmidi_substream_t * substream, | |||
1418 | snd_emu10k1x_intr_disable(emu, midi->rx_enable); | 1416 | snd_emu10k1x_intr_disable(emu, midi->rx_enable); |
1419 | } | 1417 | } |
1420 | 1418 | ||
1421 | static void snd_emu10k1x_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) | 1419 | static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
1422 | { | 1420 | { |
1423 | emu10k1x_t *emu; | 1421 | struct emu10k1x *emu; |
1424 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data; | 1422 | struct emu10k1x_midi *midi = substream->rmidi->private_data; |
1425 | unsigned long flags; | 1423 | unsigned long flags; |
1426 | 1424 | ||
1427 | emu = midi->emu; | 1425 | emu = midi->emu; |
@@ -1458,30 +1456,31 @@ static void snd_emu10k1x_midi_output_trigger(snd_rawmidi_substream_t * substream | |||
1458 | 1456 | ||
1459 | */ | 1457 | */ |
1460 | 1458 | ||
1461 | static snd_rawmidi_ops_t snd_emu10k1x_midi_output = | 1459 | static struct snd_rawmidi_ops snd_emu10k1x_midi_output = |
1462 | { | 1460 | { |
1463 | .open = snd_emu10k1x_midi_output_open, | 1461 | .open = snd_emu10k1x_midi_output_open, |
1464 | .close = snd_emu10k1x_midi_output_close, | 1462 | .close = snd_emu10k1x_midi_output_close, |
1465 | .trigger = snd_emu10k1x_midi_output_trigger, | 1463 | .trigger = snd_emu10k1x_midi_output_trigger, |
1466 | }; | 1464 | }; |
1467 | 1465 | ||
1468 | static snd_rawmidi_ops_t snd_emu10k1x_midi_input = | 1466 | static struct snd_rawmidi_ops snd_emu10k1x_midi_input = |
1469 | { | 1467 | { |
1470 | .open = snd_emu10k1x_midi_input_open, | 1468 | .open = snd_emu10k1x_midi_input_open, |
1471 | .close = snd_emu10k1x_midi_input_close, | 1469 | .close = snd_emu10k1x_midi_input_close, |
1472 | .trigger = snd_emu10k1x_midi_input_trigger, | 1470 | .trigger = snd_emu10k1x_midi_input_trigger, |
1473 | }; | 1471 | }; |
1474 | 1472 | ||
1475 | static void snd_emu10k1x_midi_free(snd_rawmidi_t *rmidi) | 1473 | static void snd_emu10k1x_midi_free(struct snd_rawmidi *rmidi) |
1476 | { | 1474 | { |
1477 | emu10k1x_midi_t *midi = (emu10k1x_midi_t *)rmidi->private_data; | 1475 | struct emu10k1x_midi *midi = rmidi->private_data; |
1478 | midi->interrupt = NULL; | 1476 | midi->interrupt = NULL; |
1479 | midi->rmidi = NULL; | 1477 | midi->rmidi = NULL; |
1480 | } | 1478 | } |
1481 | 1479 | ||
1482 | static int __devinit emu10k1x_midi_init(emu10k1x_t *emu, emu10k1x_midi_t *midi, int device, char *name) | 1480 | static int __devinit emu10k1x_midi_init(struct emu10k1x *emu, |
1481 | struct emu10k1x_midi *midi, int device, char *name) | ||
1483 | { | 1482 | { |
1484 | snd_rawmidi_t *rmidi; | 1483 | struct snd_rawmidi *rmidi; |
1485 | int err; | 1484 | int err; |
1486 | 1485 | ||
1487 | if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0) | 1486 | if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0) |
@@ -1502,9 +1501,9 @@ static int __devinit emu10k1x_midi_init(emu10k1x_t *emu, emu10k1x_midi_t *midi, | |||
1502 | return 0; | 1501 | return 0; |
1503 | } | 1502 | } |
1504 | 1503 | ||
1505 | static int __devinit snd_emu10k1x_midi(emu10k1x_t *emu) | 1504 | static int __devinit snd_emu10k1x_midi(struct emu10k1x *emu) |
1506 | { | 1505 | { |
1507 | emu10k1x_midi_t *midi = &emu->midi; | 1506 | struct emu10k1x_midi *midi = &emu->midi; |
1508 | int err; | 1507 | int err; |
1509 | 1508 | ||
1510 | if ((err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)")) < 0) | 1509 | if ((err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)")) < 0) |
@@ -1523,8 +1522,8 @@ static int __devinit snd_emu10k1x_probe(struct pci_dev *pci, | |||
1523 | const struct pci_device_id *pci_id) | 1522 | const struct pci_device_id *pci_id) |
1524 | { | 1523 | { |
1525 | static int dev; | 1524 | static int dev; |
1526 | snd_card_t *card; | 1525 | struct snd_card *card; |
1527 | emu10k1x_t *chip; | 1526 | struct emu10k1x *chip; |
1528 | int err; | 1527 | int err; |
1529 | 1528 | ||
1530 | if (dev >= SNDRV_CARDS) | 1529 | if (dev >= SNDRV_CARDS) |