diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:55:40 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:19:01 -0500 |
commit | e4a3d145455159955d6ac1df976b2ed2a135b858 (patch) | |
tree | 71a0a4f0a71d07d153d32d88430f21ac4efcdde7 /sound/pci/ca0106 | |
parent | 2fd16874aa6322e8b61879a78f3b485999506833 (diff) |
[ALSA] Remove xxx_t typedefs: PCI CA0106
Modules: CA0106 driver
Remove xxx_t typedefs from the PCI CA0106 driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ca0106')
-rw-r--r-- | sound/pci/ca0106/ca0106.h | 54 | ||||
-rw-r--r-- | sound/pci/ca0106/ca0106_main.c | 234 | ||||
-rw-r--r-- | sound/pci/ca0106/ca0106_mixer.c | 99 | ||||
-rw-r--r-- | sound/pci/ca0106/ca0106_proc.c | 60 | ||||
-rw-r--r-- | sound/pci/ca0106/ca_midi.c | 49 | ||||
-rw-r--r-- | sound/pci/ca0106/ca_midi.h | 25 |
6 files changed, 263 insertions, 258 deletions
diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h index 9a4b6406f7a5..7088317ec4ce 100644 --- a/sound/pci/ca0106/ca0106.h +++ b/sound/pci/ca0106/ca0106.h | |||
@@ -554,37 +554,35 @@ | |||
554 | 554 | ||
555 | #include "ca_midi.h" | 555 | #include "ca_midi.h" |
556 | 556 | ||
557 | typedef struct snd_ca0106_channel ca0106_channel_t; | 557 | struct snd_ca0106; |
558 | typedef struct snd_ca0106 ca0106_t; | ||
559 | typedef struct snd_ca0106_pcm ca0106_pcm_t; | ||
560 | 558 | ||
561 | struct snd_ca0106_channel { | 559 | struct snd_ca0106_channel { |
562 | ca0106_t *emu; | 560 | struct snd_ca0106 *emu; |
563 | int number; | 561 | int number; |
564 | int use; | 562 | int use; |
565 | void (*interrupt)(ca0106_t *emu, ca0106_channel_t *channel); | 563 | void (*interrupt)(struct snd_ca0106 *emu, struct snd_ca0106_channel *channel); |
566 | ca0106_pcm_t *epcm; | 564 | struct snd_ca0106_pcm *epcm; |
567 | }; | 565 | }; |
568 | 566 | ||
569 | struct snd_ca0106_pcm { | 567 | struct snd_ca0106_pcm { |
570 | ca0106_t *emu; | 568 | struct snd_ca0106 *emu; |
571 | snd_pcm_substream_t *substream; | 569 | struct snd_pcm_substream *substream; |
572 | int channel_id; | 570 | int channel_id; |
573 | unsigned short running; | 571 | unsigned short running; |
574 | }; | 572 | }; |
575 | 573 | ||
576 | typedef struct { | 574 | struct snd_ca0106_details { |
577 | u32 serial; | 575 | u32 serial; |
578 | char * name; | 576 | char * name; |
579 | int ac97; | 577 | int ac97; |
580 | int gpio_type; | 578 | int gpio_type; |
581 | int i2c_adc; | 579 | int i2c_adc; |
582 | } ca0106_details_t; | 580 | }; |
583 | 581 | ||
584 | // definition of the chip-specific record | 582 | // definition of the chip-specific record |
585 | struct snd_ca0106 { | 583 | struct snd_ca0106 { |
586 | snd_card_t *card; | 584 | struct snd_card *card; |
587 | ca0106_details_t *details; | 585 | struct snd_ca0106_details *details; |
588 | struct pci_dev *pci; | 586 | struct pci_dev *pci; |
589 | 587 | ||
590 | unsigned long port; | 588 | unsigned long port; |
@@ -597,11 +595,11 @@ struct snd_ca0106 { | |||
597 | 595 | ||
598 | spinlock_t emu_lock; | 596 | spinlock_t emu_lock; |
599 | 597 | ||
600 | ac97_t *ac97; | 598 | struct snd_ac97 *ac97; |
601 | snd_pcm_t *pcm; | 599 | struct snd_pcm *pcm; |
602 | 600 | ||
603 | ca0106_channel_t playback_channels[4]; | 601 | struct snd_ca0106_channel playback_channels[4]; |
604 | ca0106_channel_t capture_channels[4]; | 602 | struct snd_ca0106_channel capture_channels[4]; |
605 | u32 spdif_bits[4]; /* s/pdif out setup */ | 603 | u32 spdif_bits[4]; /* s/pdif out setup */ |
606 | int spdif_enable; | 604 | int spdif_enable; |
607 | int capture_source; | 605 | int capture_source; |
@@ -609,22 +607,22 @@ struct snd_ca0106 { | |||
609 | 607 | ||
610 | struct snd_dma_buffer buffer; | 608 | struct snd_dma_buffer buffer; |
611 | 609 | ||
612 | ca_midi_t midi; | 610 | struct snd_ca_midi midi; |
613 | ca_midi_t midi2; | 611 | struct snd_ca_midi midi2; |
614 | }; | 612 | }; |
615 | 613 | ||
616 | int __devinit snd_ca0106_mixer(ca0106_t *emu); | 614 | int snd_ca0106_mixer(struct snd_ca0106 *emu); |
617 | int __devinit snd_ca0106_proc_init(ca0106_t * emu); | 615 | int snd_ca0106_proc_init(struct snd_ca0106 * emu); |
618 | 616 | ||
619 | unsigned int snd_ca0106_ptr_read(ca0106_t * emu, | 617 | unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu, |
620 | unsigned int reg, | 618 | unsigned int reg, |
621 | unsigned int chn); | 619 | unsigned int chn); |
622 | 620 | ||
623 | void snd_ca0106_ptr_write(ca0106_t *emu, | 621 | void snd_ca0106_ptr_write(struct snd_ca0106 *emu, |
624 | unsigned int reg, | 622 | unsigned int reg, |
625 | unsigned int chn, | 623 | unsigned int chn, |
626 | unsigned int data); | 624 | unsigned int data); |
627 | 625 | ||
628 | int snd_ca0106_i2c_write(ca0106_t *emu, u32 reg, u32 value); | 626 | int snd_ca0106_i2c_write(struct snd_ca0106 *emu, u32 reg, u32 value); |
629 | 627 | ||
630 | 628 | ||
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 0120c4683c79..744f97183723 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -164,7 +164,7 @@ MODULE_PARM_DESC(enable, "Enable the CA0106 soundcard."); | |||
164 | 164 | ||
165 | #include "ca0106.h" | 165 | #include "ca0106.h" |
166 | 166 | ||
167 | static ca0106_details_t ca0106_chip_details[] = { | 167 | static struct snd_ca0106_details ca0106_chip_details[] = { |
168 | /* AudigyLS[SB0310] */ | 168 | /* AudigyLS[SB0310] */ |
169 | { .serial = 0x10021102, | 169 | { .serial = 0x10021102, |
170 | .name = "AudigyLS [SB0310]", | 170 | .name = "AudigyLS [SB0310]", |
@@ -201,7 +201,7 @@ static ca0106_details_t ca0106_chip_details[] = { | |||
201 | }; | 201 | }; |
202 | 202 | ||
203 | /* hardware definition */ | 203 | /* hardware definition */ |
204 | static snd_pcm_hardware_t snd_ca0106_playback_hw = { | 204 | static struct snd_pcm_hardware snd_ca0106_playback_hw = { |
205 | .info = (SNDRV_PCM_INFO_MMAP | | 205 | .info = (SNDRV_PCM_INFO_MMAP | |
206 | SNDRV_PCM_INFO_INTERLEAVED | | 206 | SNDRV_PCM_INFO_INTERLEAVED | |
207 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 207 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -221,7 +221,7 @@ static snd_pcm_hardware_t snd_ca0106_playback_hw = { | |||
221 | .fifo_size = 0, | 221 | .fifo_size = 0, |
222 | }; | 222 | }; |
223 | 223 | ||
224 | static snd_pcm_hardware_t snd_ca0106_capture_hw = { | 224 | static struct snd_pcm_hardware snd_ca0106_capture_hw = { |
225 | .info = (SNDRV_PCM_INFO_MMAP | | 225 | .info = (SNDRV_PCM_INFO_MMAP | |
226 | SNDRV_PCM_INFO_INTERLEAVED | | 226 | SNDRV_PCM_INFO_INTERLEAVED | |
227 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 227 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -241,7 +241,7 @@ static snd_pcm_hardware_t snd_ca0106_capture_hw = { | |||
241 | .fifo_size = 0, | 241 | .fifo_size = 0, |
242 | }; | 242 | }; |
243 | 243 | ||
244 | unsigned int snd_ca0106_ptr_read(ca0106_t * emu, | 244 | unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu, |
245 | unsigned int reg, | 245 | unsigned int reg, |
246 | unsigned int chn) | 246 | unsigned int chn) |
247 | { | 247 | { |
@@ -257,7 +257,7 @@ unsigned int snd_ca0106_ptr_read(ca0106_t * emu, | |||
257 | return val; | 257 | return val; |
258 | } | 258 | } |
259 | 259 | ||
260 | void snd_ca0106_ptr_write(ca0106_t *emu, | 260 | void snd_ca0106_ptr_write(struct snd_ca0106 *emu, |
261 | unsigned int reg, | 261 | unsigned int reg, |
262 | unsigned int chn, | 262 | unsigned int chn, |
263 | unsigned int data) | 263 | unsigned int data) |
@@ -273,7 +273,7 @@ void snd_ca0106_ptr_write(ca0106_t *emu, | |||
273 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 273 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
274 | } | 274 | } |
275 | 275 | ||
276 | int snd_ca0106_i2c_write(ca0106_t *emu, | 276 | int snd_ca0106_i2c_write(struct snd_ca0106 *emu, |
277 | u32 reg, | 277 | u32 reg, |
278 | u32 value) | 278 | u32 value) |
279 | { | 279 | { |
@@ -325,7 +325,7 @@ int snd_ca0106_i2c_write(ca0106_t *emu, | |||
325 | } | 325 | } |
326 | 326 | ||
327 | 327 | ||
328 | static void snd_ca0106_intr_enable(ca0106_t *emu, unsigned int intrenb) | 328 | static void snd_ca0106_intr_enable(struct snd_ca0106 *emu, unsigned int intrenb) |
329 | { | 329 | { |
330 | unsigned long flags; | 330 | unsigned long flags; |
331 | unsigned int enable; | 331 | unsigned int enable; |
@@ -336,7 +336,7 @@ static void snd_ca0106_intr_enable(ca0106_t *emu, unsigned int intrenb) | |||
336 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 336 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
337 | } | 337 | } |
338 | 338 | ||
339 | static void snd_ca0106_intr_disable(ca0106_t *emu, unsigned int intrenb) | 339 | static void snd_ca0106_intr_disable(struct snd_ca0106 *emu, unsigned int intrenb) |
340 | { | 340 | { |
341 | unsigned long flags; | 341 | unsigned long flags; |
342 | unsigned int enable; | 342 | unsigned int enable; |
@@ -348,18 +348,19 @@ static void snd_ca0106_intr_disable(ca0106_t *emu, unsigned int intrenb) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | 350 | ||
351 | static void snd_ca0106_pcm_free_substream(snd_pcm_runtime_t *runtime) | 351 | static void snd_ca0106_pcm_free_substream(struct snd_pcm_runtime *runtime) |
352 | { | 352 | { |
353 | kfree(runtime->private_data); | 353 | kfree(runtime->private_data); |
354 | } | 354 | } |
355 | 355 | ||
356 | /* open_playback callback */ | 356 | /* open_playback callback */ |
357 | static int snd_ca0106_pcm_open_playback_channel(snd_pcm_substream_t *substream, int channel_id) | 357 | static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substream, |
358 | int channel_id) | ||
358 | { | 359 | { |
359 | ca0106_t *chip = snd_pcm_substream_chip(substream); | 360 | struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); |
360 | ca0106_channel_t *channel = &(chip->playback_channels[channel_id]); | 361 | struct snd_ca0106_channel *channel = &(chip->playback_channels[channel_id]); |
361 | ca0106_pcm_t *epcm; | 362 | struct snd_ca0106_pcm *epcm; |
362 | snd_pcm_runtime_t *runtime = substream->runtime; | 363 | struct snd_pcm_runtime *runtime = substream->runtime; |
363 | int err; | 364 | int err; |
364 | 365 | ||
365 | epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); | 366 | epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); |
@@ -390,43 +391,44 @@ static int snd_ca0106_pcm_open_playback_channel(snd_pcm_substream_t *substream, | |||
390 | } | 391 | } |
391 | 392 | ||
392 | /* close callback */ | 393 | /* close callback */ |
393 | static int snd_ca0106_pcm_close_playback(snd_pcm_substream_t *substream) | 394 | static int snd_ca0106_pcm_close_playback(struct snd_pcm_substream *substream) |
394 | { | 395 | { |
395 | ca0106_t *chip = snd_pcm_substream_chip(substream); | 396 | struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); |
396 | snd_pcm_runtime_t *runtime = substream->runtime; | 397 | struct snd_pcm_runtime *runtime = substream->runtime; |
397 | ca0106_pcm_t *epcm = runtime->private_data; | 398 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
398 | chip->playback_channels[epcm->channel_id].use=0; | 399 | chip->playback_channels[epcm->channel_id].use = 0; |
399 | /* FIXME: maybe zero others */ | 400 | /* FIXME: maybe zero others */ |
400 | return 0; | 401 | return 0; |
401 | } | 402 | } |
402 | 403 | ||
403 | static int snd_ca0106_pcm_open_playback_front(snd_pcm_substream_t *substream) | 404 | static int snd_ca0106_pcm_open_playback_front(struct snd_pcm_substream *substream) |
404 | { | 405 | { |
405 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL); | 406 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL); |
406 | } | 407 | } |
407 | 408 | ||
408 | static int snd_ca0106_pcm_open_playback_center_lfe(snd_pcm_substream_t *substream) | 409 | static int snd_ca0106_pcm_open_playback_center_lfe(struct snd_pcm_substream *substream) |
409 | { | 410 | { |
410 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_CENTER_LFE_CHANNEL); | 411 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_CENTER_LFE_CHANNEL); |
411 | } | 412 | } |
412 | 413 | ||
413 | static int snd_ca0106_pcm_open_playback_unknown(snd_pcm_substream_t *substream) | 414 | static int snd_ca0106_pcm_open_playback_unknown(struct snd_pcm_substream *substream) |
414 | { | 415 | { |
415 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_UNKNOWN_CHANNEL); | 416 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_UNKNOWN_CHANNEL); |
416 | } | 417 | } |
417 | 418 | ||
418 | static int snd_ca0106_pcm_open_playback_rear(snd_pcm_substream_t *substream) | 419 | static int snd_ca0106_pcm_open_playback_rear(struct snd_pcm_substream *substream) |
419 | { | 420 | { |
420 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_REAR_CHANNEL); | 421 | return snd_ca0106_pcm_open_playback_channel(substream, PCM_REAR_CHANNEL); |
421 | } | 422 | } |
422 | 423 | ||
423 | /* open_capture callback */ | 424 | /* open_capture callback */ |
424 | static int snd_ca0106_pcm_open_capture_channel(snd_pcm_substream_t *substream, int channel_id) | 425 | static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substream, |
426 | int channel_id) | ||
425 | { | 427 | { |
426 | ca0106_t *chip = snd_pcm_substream_chip(substream); | 428 | struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); |
427 | ca0106_channel_t *channel = &(chip->capture_channels[channel_id]); | 429 | struct snd_ca0106_channel *channel = &(chip->capture_channels[channel_id]); |
428 | ca0106_pcm_t *epcm; | 430 | struct snd_ca0106_pcm *epcm; |
429 | snd_pcm_runtime_t *runtime = substream->runtime; | 431 | struct snd_pcm_runtime *runtime = substream->runtime; |
430 | int err; | 432 | int err; |
431 | 433 | ||
432 | epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); | 434 | epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); |
@@ -449,7 +451,7 @@ static int snd_ca0106_pcm_open_capture_channel(snd_pcm_substream_t *substream, i | |||
449 | channel->use = 1; | 451 | channel->use = 1; |
450 | //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); | 452 | //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); |
451 | //channel->interrupt = snd_ca0106_pcm_channel_interrupt; | 453 | //channel->interrupt = snd_ca0106_pcm_channel_interrupt; |
452 | channel->epcm = epcm; | 454 | channel->epcm = epcm; |
453 | if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) | 455 | if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) |
454 | return err; | 456 | return err; |
455 | //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); | 457 | //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); |
@@ -459,70 +461,70 @@ static int snd_ca0106_pcm_open_capture_channel(snd_pcm_substream_t *substream, i | |||
459 | } | 461 | } |
460 | 462 | ||
461 | /* close callback */ | 463 | /* close callback */ |
462 | static int snd_ca0106_pcm_close_capture(snd_pcm_substream_t *substream) | 464 | static int snd_ca0106_pcm_close_capture(struct snd_pcm_substream *substream) |
463 | { | 465 | { |
464 | ca0106_t *chip = snd_pcm_substream_chip(substream); | 466 | struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); |
465 | snd_pcm_runtime_t *runtime = substream->runtime; | 467 | struct snd_pcm_runtime *runtime = substream->runtime; |
466 | ca0106_pcm_t *epcm = runtime->private_data; | 468 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
467 | chip->capture_channels[epcm->channel_id].use=0; | 469 | chip->capture_channels[epcm->channel_id].use = 0; |
468 | /* FIXME: maybe zero others */ | 470 | /* FIXME: maybe zero others */ |
469 | return 0; | 471 | return 0; |
470 | } | 472 | } |
471 | 473 | ||
472 | static int snd_ca0106_pcm_open_0_capture(snd_pcm_substream_t *substream) | 474 | static int snd_ca0106_pcm_open_0_capture(struct snd_pcm_substream *substream) |
473 | { | 475 | { |
474 | return snd_ca0106_pcm_open_capture_channel(substream, 0); | 476 | return snd_ca0106_pcm_open_capture_channel(substream, 0); |
475 | } | 477 | } |
476 | 478 | ||
477 | static int snd_ca0106_pcm_open_1_capture(snd_pcm_substream_t *substream) | 479 | static int snd_ca0106_pcm_open_1_capture(struct snd_pcm_substream *substream) |
478 | { | 480 | { |
479 | return snd_ca0106_pcm_open_capture_channel(substream, 1); | 481 | return snd_ca0106_pcm_open_capture_channel(substream, 1); |
480 | } | 482 | } |
481 | 483 | ||
482 | static int snd_ca0106_pcm_open_2_capture(snd_pcm_substream_t *substream) | 484 | static int snd_ca0106_pcm_open_2_capture(struct snd_pcm_substream *substream) |
483 | { | 485 | { |
484 | return snd_ca0106_pcm_open_capture_channel(substream, 2); | 486 | return snd_ca0106_pcm_open_capture_channel(substream, 2); |
485 | } | 487 | } |
486 | 488 | ||
487 | static int snd_ca0106_pcm_open_3_capture(snd_pcm_substream_t *substream) | 489 | static int snd_ca0106_pcm_open_3_capture(struct snd_pcm_substream *substream) |
488 | { | 490 | { |
489 | return snd_ca0106_pcm_open_capture_channel(substream, 3); | 491 | return snd_ca0106_pcm_open_capture_channel(substream, 3); |
490 | } | 492 | } |
491 | 493 | ||
492 | /* hw_params callback */ | 494 | /* hw_params callback */ |
493 | static int snd_ca0106_pcm_hw_params_playback(snd_pcm_substream_t *substream, | 495 | static int snd_ca0106_pcm_hw_params_playback(struct snd_pcm_substream *substream, |
494 | snd_pcm_hw_params_t * hw_params) | 496 | struct snd_pcm_hw_params *hw_params) |
495 | { | 497 | { |
496 | return snd_pcm_lib_malloc_pages(substream, | 498 | return snd_pcm_lib_malloc_pages(substream, |
497 | params_buffer_bytes(hw_params)); | 499 | params_buffer_bytes(hw_params)); |
498 | } | 500 | } |
499 | 501 | ||
500 | /* hw_free callback */ | 502 | /* hw_free callback */ |
501 | static int snd_ca0106_pcm_hw_free_playback(snd_pcm_substream_t *substream) | 503 | static int snd_ca0106_pcm_hw_free_playback(struct snd_pcm_substream *substream) |
502 | { | 504 | { |
503 | return snd_pcm_lib_free_pages(substream); | 505 | return snd_pcm_lib_free_pages(substream); |
504 | } | 506 | } |
505 | 507 | ||
506 | /* hw_params callback */ | 508 | /* hw_params callback */ |
507 | static int snd_ca0106_pcm_hw_params_capture(snd_pcm_substream_t *substream, | 509 | static int snd_ca0106_pcm_hw_params_capture(struct snd_pcm_substream *substream, |
508 | snd_pcm_hw_params_t * hw_params) | 510 | struct snd_pcm_hw_params *hw_params) |
509 | { | 511 | { |
510 | return snd_pcm_lib_malloc_pages(substream, | 512 | return snd_pcm_lib_malloc_pages(substream, |
511 | params_buffer_bytes(hw_params)); | 513 | params_buffer_bytes(hw_params)); |
512 | } | 514 | } |
513 | 515 | ||
514 | /* hw_free callback */ | 516 | /* hw_free callback */ |
515 | static int snd_ca0106_pcm_hw_free_capture(snd_pcm_substream_t *substream) | 517 | static int snd_ca0106_pcm_hw_free_capture(struct snd_pcm_substream *substream) |
516 | { | 518 | { |
517 | return snd_pcm_lib_free_pages(substream); | 519 | return snd_pcm_lib_free_pages(substream); |
518 | } | 520 | } |
519 | 521 | ||
520 | /* prepare playback callback */ | 522 | /* prepare playback callback */ |
521 | static int snd_ca0106_pcm_prepare_playback(snd_pcm_substream_t *substream) | 523 | static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream) |
522 | { | 524 | { |
523 | ca0106_t *emu = snd_pcm_substream_chip(substream); | 525 | struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); |
524 | snd_pcm_runtime_t *runtime = substream->runtime; | 526 | struct snd_pcm_runtime *runtime = substream->runtime; |
525 | ca0106_pcm_t *epcm = runtime->private_data; | 527 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
526 | int channel = epcm->channel_id; | 528 | int channel = epcm->channel_id; |
527 | u32 *table_base = (u32 *)(emu->buffer.area+(8*16*channel)); | 529 | u32 *table_base = (u32 *)(emu->buffer.area+(8*16*channel)); |
528 | u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); | 530 | u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); |
@@ -619,11 +621,11 @@ static int snd_ca0106_pcm_prepare_playback(snd_pcm_substream_t *substream) | |||
619 | } | 621 | } |
620 | 622 | ||
621 | /* prepare capture callback */ | 623 | /* prepare capture callback */ |
622 | static int snd_ca0106_pcm_prepare_capture(snd_pcm_substream_t *substream) | 624 | static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream) |
623 | { | 625 | { |
624 | ca0106_t *emu = snd_pcm_substream_chip(substream); | 626 | struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); |
625 | snd_pcm_runtime_t *runtime = substream->runtime; | 627 | struct snd_pcm_runtime *runtime = substream->runtime; |
626 | ca0106_pcm_t *epcm = runtime->private_data; | 628 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
627 | int channel = epcm->channel_id; | 629 | int channel = epcm->channel_id; |
628 | u32 hcfg_mask = HCFG_CAPTURE_S32_LE; | 630 | u32 hcfg_mask = HCFG_CAPTURE_S32_LE; |
629 | u32 hcfg_set = 0x00000000; | 631 | u32 hcfg_set = 0x00000000; |
@@ -690,16 +692,16 @@ static int snd_ca0106_pcm_prepare_capture(snd_pcm_substream_t *substream) | |||
690 | } | 692 | } |
691 | 693 | ||
692 | /* trigger_playback callback */ | 694 | /* trigger_playback callback */ |
693 | static int snd_ca0106_pcm_trigger_playback(snd_pcm_substream_t *substream, | 695 | static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, |
694 | int cmd) | 696 | int cmd) |
695 | { | 697 | { |
696 | ca0106_t *emu = snd_pcm_substream_chip(substream); | 698 | struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); |
697 | snd_pcm_runtime_t *runtime; | 699 | struct snd_pcm_runtime *runtime; |
698 | ca0106_pcm_t *epcm; | 700 | struct snd_ca0106_pcm *epcm; |
699 | int channel; | 701 | int channel; |
700 | int result = 0; | 702 | int result = 0; |
701 | struct list_head *pos; | 703 | struct list_head *pos; |
702 | snd_pcm_substream_t *s; | 704 | struct snd_pcm_substream *s; |
703 | u32 basic = 0; | 705 | u32 basic = 0; |
704 | u32 extended = 0; | 706 | u32 extended = 0; |
705 | int running=0; | 707 | int running=0; |
@@ -743,12 +745,12 @@ static int snd_ca0106_pcm_trigger_playback(snd_pcm_substream_t *substream, | |||
743 | } | 745 | } |
744 | 746 | ||
745 | /* trigger_capture callback */ | 747 | /* trigger_capture callback */ |
746 | static int snd_ca0106_pcm_trigger_capture(snd_pcm_substream_t *substream, | 748 | static int snd_ca0106_pcm_trigger_capture(struct snd_pcm_substream *substream, |
747 | int cmd) | 749 | int cmd) |
748 | { | 750 | { |
749 | ca0106_t *emu = snd_pcm_substream_chip(substream); | 751 | struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); |
750 | snd_pcm_runtime_t *runtime = substream->runtime; | 752 | struct snd_pcm_runtime *runtime = substream->runtime; |
751 | ca0106_pcm_t *epcm = runtime->private_data; | 753 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
752 | int channel = epcm->channel_id; | 754 | int channel = epcm->channel_id; |
753 | int result = 0; | 755 | int result = 0; |
754 | 756 | ||
@@ -772,11 +774,11 @@ static int snd_ca0106_pcm_trigger_capture(snd_pcm_substream_t *substream, | |||
772 | 774 | ||
773 | /* pointer_playback callback */ | 775 | /* pointer_playback callback */ |
774 | static snd_pcm_uframes_t | 776 | static snd_pcm_uframes_t |
775 | snd_ca0106_pcm_pointer_playback(snd_pcm_substream_t *substream) | 777 | snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream) |
776 | { | 778 | { |
777 | ca0106_t *emu = snd_pcm_substream_chip(substream); | 779 | struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); |
778 | snd_pcm_runtime_t *runtime = substream->runtime; | 780 | struct snd_pcm_runtime *runtime = substream->runtime; |
779 | ca0106_pcm_t *epcm = runtime->private_data; | 781 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
780 | snd_pcm_uframes_t ptr, ptr1, ptr2,ptr3,ptr4 = 0; | 782 | snd_pcm_uframes_t ptr, ptr1, ptr2,ptr3,ptr4 = 0; |
781 | int channel = epcm->channel_id; | 783 | int channel = epcm->channel_id; |
782 | 784 | ||
@@ -799,11 +801,11 @@ snd_ca0106_pcm_pointer_playback(snd_pcm_substream_t *substream) | |||
799 | 801 | ||
800 | /* pointer_capture callback */ | 802 | /* pointer_capture callback */ |
801 | static snd_pcm_uframes_t | 803 | static snd_pcm_uframes_t |
802 | snd_ca0106_pcm_pointer_capture(snd_pcm_substream_t *substream) | 804 | snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream) |
803 | { | 805 | { |
804 | ca0106_t *emu = snd_pcm_substream_chip(substream); | 806 | struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); |
805 | snd_pcm_runtime_t *runtime = substream->runtime; | 807 | struct snd_pcm_runtime *runtime = substream->runtime; |
806 | ca0106_pcm_t *epcm = runtime->private_data; | 808 | struct snd_ca0106_pcm *epcm = runtime->private_data; |
807 | snd_pcm_uframes_t ptr, ptr1, ptr2 = 0; | 809 | snd_pcm_uframes_t ptr, ptr1, ptr2 = 0; |
808 | int channel = channel=epcm->channel_id; | 810 | int channel = channel=epcm->channel_id; |
809 | 811 | ||
@@ -821,7 +823,7 @@ snd_ca0106_pcm_pointer_capture(snd_pcm_substream_t *substream) | |||
821 | } | 823 | } |
822 | 824 | ||
823 | /* operators */ | 825 | /* operators */ |
824 | static snd_pcm_ops_t snd_ca0106_playback_front_ops = { | 826 | static struct snd_pcm_ops snd_ca0106_playback_front_ops = { |
825 | .open = snd_ca0106_pcm_open_playback_front, | 827 | .open = snd_ca0106_pcm_open_playback_front, |
826 | .close = snd_ca0106_pcm_close_playback, | 828 | .close = snd_ca0106_pcm_close_playback, |
827 | .ioctl = snd_pcm_lib_ioctl, | 829 | .ioctl = snd_pcm_lib_ioctl, |
@@ -832,7 +834,7 @@ static snd_pcm_ops_t snd_ca0106_playback_front_ops = { | |||
832 | .pointer = snd_ca0106_pcm_pointer_playback, | 834 | .pointer = snd_ca0106_pcm_pointer_playback, |
833 | }; | 835 | }; |
834 | 836 | ||
835 | static snd_pcm_ops_t snd_ca0106_capture_0_ops = { | 837 | static struct snd_pcm_ops snd_ca0106_capture_0_ops = { |
836 | .open = snd_ca0106_pcm_open_0_capture, | 838 | .open = snd_ca0106_pcm_open_0_capture, |
837 | .close = snd_ca0106_pcm_close_capture, | 839 | .close = snd_ca0106_pcm_close_capture, |
838 | .ioctl = snd_pcm_lib_ioctl, | 840 | .ioctl = snd_pcm_lib_ioctl, |
@@ -843,7 +845,7 @@ static snd_pcm_ops_t snd_ca0106_capture_0_ops = { | |||
843 | .pointer = snd_ca0106_pcm_pointer_capture, | 845 | .pointer = snd_ca0106_pcm_pointer_capture, |
844 | }; | 846 | }; |
845 | 847 | ||
846 | static snd_pcm_ops_t snd_ca0106_capture_1_ops = { | 848 | static struct snd_pcm_ops snd_ca0106_capture_1_ops = { |
847 | .open = snd_ca0106_pcm_open_1_capture, | 849 | .open = snd_ca0106_pcm_open_1_capture, |
848 | .close = snd_ca0106_pcm_close_capture, | 850 | .close = snd_ca0106_pcm_close_capture, |
849 | .ioctl = snd_pcm_lib_ioctl, | 851 | .ioctl = snd_pcm_lib_ioctl, |
@@ -854,7 +856,7 @@ static snd_pcm_ops_t snd_ca0106_capture_1_ops = { | |||
854 | .pointer = snd_ca0106_pcm_pointer_capture, | 856 | .pointer = snd_ca0106_pcm_pointer_capture, |
855 | }; | 857 | }; |
856 | 858 | ||
857 | static snd_pcm_ops_t snd_ca0106_capture_2_ops = { | 859 | static struct snd_pcm_ops snd_ca0106_capture_2_ops = { |
858 | .open = snd_ca0106_pcm_open_2_capture, | 860 | .open = snd_ca0106_pcm_open_2_capture, |
859 | .close = snd_ca0106_pcm_close_capture, | 861 | .close = snd_ca0106_pcm_close_capture, |
860 | .ioctl = snd_pcm_lib_ioctl, | 862 | .ioctl = snd_pcm_lib_ioctl, |
@@ -865,7 +867,7 @@ static snd_pcm_ops_t snd_ca0106_capture_2_ops = { | |||
865 | .pointer = snd_ca0106_pcm_pointer_capture, | 867 | .pointer = snd_ca0106_pcm_pointer_capture, |
866 | }; | 868 | }; |
867 | 869 | ||
868 | static snd_pcm_ops_t snd_ca0106_capture_3_ops = { | 870 | static struct snd_pcm_ops snd_ca0106_capture_3_ops = { |
869 | .open = snd_ca0106_pcm_open_3_capture, | 871 | .open = snd_ca0106_pcm_open_3_capture, |
870 | .close = snd_ca0106_pcm_close_capture, | 872 | .close = snd_ca0106_pcm_close_capture, |
871 | .ioctl = snd_pcm_lib_ioctl, | 873 | .ioctl = snd_pcm_lib_ioctl, |
@@ -876,7 +878,7 @@ static snd_pcm_ops_t snd_ca0106_capture_3_ops = { | |||
876 | .pointer = snd_ca0106_pcm_pointer_capture, | 878 | .pointer = snd_ca0106_pcm_pointer_capture, |
877 | }; | 879 | }; |
878 | 880 | ||
879 | static snd_pcm_ops_t snd_ca0106_playback_center_lfe_ops = { | 881 | static struct snd_pcm_ops snd_ca0106_playback_center_lfe_ops = { |
880 | .open = snd_ca0106_pcm_open_playback_center_lfe, | 882 | .open = snd_ca0106_pcm_open_playback_center_lfe, |
881 | .close = snd_ca0106_pcm_close_playback, | 883 | .close = snd_ca0106_pcm_close_playback, |
882 | .ioctl = snd_pcm_lib_ioctl, | 884 | .ioctl = snd_pcm_lib_ioctl, |
@@ -887,7 +889,7 @@ static snd_pcm_ops_t snd_ca0106_playback_center_lfe_ops = { | |||
887 | .pointer = snd_ca0106_pcm_pointer_playback, | 889 | .pointer = snd_ca0106_pcm_pointer_playback, |
888 | }; | 890 | }; |
889 | 891 | ||
890 | static snd_pcm_ops_t snd_ca0106_playback_unknown_ops = { | 892 | static struct snd_pcm_ops snd_ca0106_playback_unknown_ops = { |
891 | .open = snd_ca0106_pcm_open_playback_unknown, | 893 | .open = snd_ca0106_pcm_open_playback_unknown, |
892 | .close = snd_ca0106_pcm_close_playback, | 894 | .close = snd_ca0106_pcm_close_playback, |
893 | .ioctl = snd_pcm_lib_ioctl, | 895 | .ioctl = snd_pcm_lib_ioctl, |
@@ -898,7 +900,7 @@ static snd_pcm_ops_t snd_ca0106_playback_unknown_ops = { | |||
898 | .pointer = snd_ca0106_pcm_pointer_playback, | 900 | .pointer = snd_ca0106_pcm_pointer_playback, |
899 | }; | 901 | }; |
900 | 902 | ||
901 | static snd_pcm_ops_t snd_ca0106_playback_rear_ops = { | 903 | static struct snd_pcm_ops snd_ca0106_playback_rear_ops = { |
902 | .open = snd_ca0106_pcm_open_playback_rear, | 904 | .open = snd_ca0106_pcm_open_playback_rear, |
903 | .close = snd_ca0106_pcm_close_playback, | 905 | .close = snd_ca0106_pcm_close_playback, |
904 | .ioctl = snd_pcm_lib_ioctl, | 906 | .ioctl = snd_pcm_lib_ioctl, |
@@ -910,10 +912,10 @@ static snd_pcm_ops_t snd_ca0106_playback_rear_ops = { | |||
910 | }; | 912 | }; |
911 | 913 | ||
912 | 914 | ||
913 | static unsigned short snd_ca0106_ac97_read(ac97_t *ac97, | 915 | static unsigned short snd_ca0106_ac97_read(struct snd_ac97 *ac97, |
914 | unsigned short reg) | 916 | unsigned short reg) |
915 | { | 917 | { |
916 | ca0106_t *emu = ac97->private_data; | 918 | struct snd_ca0106 *emu = ac97->private_data; |
917 | unsigned long flags; | 919 | unsigned long flags; |
918 | unsigned short val; | 920 | unsigned short val; |
919 | 921 | ||
@@ -924,10 +926,10 @@ static unsigned short snd_ca0106_ac97_read(ac97_t *ac97, | |||
924 | return val; | 926 | return val; |
925 | } | 927 | } |
926 | 928 | ||
927 | static void snd_ca0106_ac97_write(ac97_t *ac97, | 929 | static void snd_ca0106_ac97_write(struct snd_ac97 *ac97, |
928 | unsigned short reg, unsigned short val) | 930 | unsigned short reg, unsigned short val) |
929 | { | 931 | { |
930 | ca0106_t *emu = ac97->private_data; | 932 | struct snd_ca0106 *emu = ac97->private_data; |
931 | unsigned long flags; | 933 | unsigned long flags; |
932 | 934 | ||
933 | spin_lock_irqsave(&emu->emu_lock, flags); | 935 | spin_lock_irqsave(&emu->emu_lock, flags); |
@@ -936,12 +938,12 @@ static void snd_ca0106_ac97_write(ac97_t *ac97, | |||
936 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 938 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
937 | } | 939 | } |
938 | 940 | ||
939 | static int snd_ca0106_ac97(ca0106_t *chip) | 941 | static int snd_ca0106_ac97(struct snd_ca0106 *chip) |
940 | { | 942 | { |
941 | ac97_bus_t *pbus; | 943 | struct snd_ac97_bus *pbus; |
942 | ac97_template_t ac97; | 944 | struct snd_ac97_template ac97; |
943 | int err; | 945 | int err; |
944 | static ac97_bus_ops_t ops = { | 946 | static struct snd_ac97_bus_ops ops = { |
945 | .write = snd_ca0106_ac97_write, | 947 | .write = snd_ca0106_ac97_write, |
946 | .read = snd_ca0106_ac97_read, | 948 | .read = snd_ca0106_ac97_read, |
947 | }; | 949 | }; |
@@ -956,7 +958,7 @@ static int snd_ca0106_ac97(ca0106_t *chip) | |||
956 | return snd_ac97_mixer(pbus, &ac97, &chip->ac97); | 958 | return snd_ac97_mixer(pbus, &ac97, &chip->ac97); |
957 | } | 959 | } |
958 | 960 | ||
959 | static int snd_ca0106_free(ca0106_t *chip) | 961 | static int snd_ca0106_free(struct snd_ca0106 *chip) |
960 | { | 962 | { |
961 | if (chip->res_port != NULL) { /* avoid access to already used hardware */ | 963 | if (chip->res_port != NULL) { /* avoid access to already used hardware */ |
962 | // disable interrupts | 964 | // disable interrupts |
@@ -989,9 +991,9 @@ static int snd_ca0106_free(ca0106_t *chip) | |||
989 | return 0; | 991 | return 0; |
990 | } | 992 | } |
991 | 993 | ||
992 | static int snd_ca0106_dev_free(snd_device_t *device) | 994 | static int snd_ca0106_dev_free(struct snd_device *device) |
993 | { | 995 | { |
994 | ca0106_t *chip = device->device_data; | 996 | struct snd_ca0106 *chip = device->device_data; |
995 | return snd_ca0106_free(chip); | 997 | return snd_ca0106_free(chip); |
996 | } | 998 | } |
997 | 999 | ||
@@ -1000,14 +1002,13 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id, | |||
1000 | { | 1002 | { |
1001 | unsigned int status; | 1003 | unsigned int status; |
1002 | 1004 | ||
1003 | ca0106_t *chip = dev_id; | 1005 | struct snd_ca0106 *chip = dev_id; |
1004 | int i; | 1006 | int i; |
1005 | int mask; | 1007 | int mask; |
1006 | unsigned int stat76; | 1008 | unsigned int stat76; |
1007 | ca0106_channel_t *pchannel; | 1009 | struct snd_ca0106_channel *pchannel; |
1008 | 1010 | ||
1009 | status = inl(chip->port + IPR); | 1011 | status = inl(chip->port + IPR); |
1010 | |||
1011 | if (! status) | 1012 | if (! status) |
1012 | return IRQ_NONE; | 1013 | return IRQ_NONE; |
1013 | 1014 | ||
@@ -1059,10 +1060,10 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id, | |||
1059 | return IRQ_HANDLED; | 1060 | return IRQ_HANDLED; |
1060 | } | 1061 | } |
1061 | 1062 | ||
1062 | static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm) | 1063 | static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct snd_pcm **rpcm) |
1063 | { | 1064 | { |
1064 | snd_pcm_t *pcm; | 1065 | struct snd_pcm *pcm; |
1065 | snd_pcm_substream_t *substream; | 1066 | struct snd_pcm_substream *substream; |
1066 | int err; | 1067 | int err; |
1067 | 1068 | ||
1068 | if (rpcm) | 1069 | if (rpcm) |
@@ -1122,15 +1123,15 @@ static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm) | |||
1122 | return 0; | 1123 | return 0; |
1123 | } | 1124 | } |
1124 | 1125 | ||
1125 | static int __devinit snd_ca0106_create(snd_card_t *card, | 1126 | static int __devinit snd_ca0106_create(struct snd_card *card, |
1126 | struct pci_dev *pci, | 1127 | struct pci_dev *pci, |
1127 | ca0106_t **rchip) | 1128 | struct snd_ca0106 **rchip) |
1128 | { | 1129 | { |
1129 | ca0106_t *chip; | 1130 | struct snd_ca0106 *chip; |
1130 | ca0106_details_t *c; | 1131 | struct snd_ca0106_details *c; |
1131 | int err; | 1132 | int err; |
1132 | int ch; | 1133 | int ch; |
1133 | static snd_device_ops_t ops = { | 1134 | static struct snd_device_ops ops = { |
1134 | .dev_free = snd_ca0106_dev_free, | 1135 | .dev_free = snd_ca0106_dev_free, |
1135 | }; | 1136 | }; |
1136 | 1137 | ||
@@ -1314,39 +1315,40 @@ static int __devinit snd_ca0106_create(snd_card_t *card, | |||
1314 | } | 1315 | } |
1315 | 1316 | ||
1316 | 1317 | ||
1317 | static void ca0106_midi_interrupt_enable(ca_midi_t *midi, int intr) | 1318 | static void ca0106_midi_interrupt_enable(struct snd_ca_midi *midi, int intr) |
1318 | { | 1319 | { |
1319 | snd_ca0106_intr_enable((ca0106_t *)(midi->dev_id), intr); | 1320 | snd_ca0106_intr_enable((struct snd_ca0106 *)(midi->dev_id), intr); |
1320 | } | 1321 | } |
1321 | 1322 | ||
1322 | static void ca0106_midi_interrupt_disable(ca_midi_t *midi, int intr) | 1323 | static void ca0106_midi_interrupt_disable(struct snd_ca_midi *midi, int intr) |
1323 | { | 1324 | { |
1324 | snd_ca0106_intr_disable((ca0106_t *)(midi->dev_id), intr); | 1325 | snd_ca0106_intr_disable((struct snd_ca0106 *)(midi->dev_id), intr); |
1325 | } | 1326 | } |
1326 | 1327 | ||
1327 | static unsigned char ca0106_midi_read(ca_midi_t *midi, int idx) | 1328 | static unsigned char ca0106_midi_read(struct snd_ca_midi *midi, int idx) |
1328 | { | 1329 | { |
1329 | return (unsigned char)snd_ca0106_ptr_read((ca0106_t *)(midi->dev_id), midi->port + idx, 0); | 1330 | return (unsigned char)snd_ca0106_ptr_read((struct snd_ca0106 *)(midi->dev_id), |
1331 | midi->port + idx, 0); | ||
1330 | } | 1332 | } |
1331 | 1333 | ||
1332 | static void ca0106_midi_write(ca_midi_t *midi, int data, int idx) | 1334 | static void ca0106_midi_write(struct snd_ca_midi *midi, int data, int idx) |
1333 | { | 1335 | { |
1334 | snd_ca0106_ptr_write((ca0106_t *)(midi->dev_id), midi->port + idx, 0, data); | 1336 | snd_ca0106_ptr_write((struct snd_ca0106 *)(midi->dev_id), midi->port + idx, 0, data); |
1335 | } | 1337 | } |
1336 | 1338 | ||
1337 | static snd_card_t *ca0106_dev_id_card(void *dev_id) | 1339 | static struct snd_card *ca0106_dev_id_card(void *dev_id) |
1338 | { | 1340 | { |
1339 | return ((ca0106_t *)dev_id)->card; | 1341 | return ((struct snd_ca0106 *)dev_id)->card; |
1340 | } | 1342 | } |
1341 | 1343 | ||
1342 | static int ca0106_dev_id_port(void *dev_id) | 1344 | static int ca0106_dev_id_port(void *dev_id) |
1343 | { | 1345 | { |
1344 | return ((ca0106_t *)dev_id)->port; | 1346 | return ((struct snd_ca0106 *)dev_id)->port; |
1345 | } | 1347 | } |
1346 | 1348 | ||
1347 | static int __devinit snd_ca0106_midi(ca0106_t *chip, unsigned int channel) | 1349 | static int __devinit snd_ca0106_midi(struct snd_ca0106 *chip, unsigned int channel) |
1348 | { | 1350 | { |
1349 | ca_midi_t *midi; | 1351 | struct snd_ca_midi *midi; |
1350 | char *name; | 1352 | char *name; |
1351 | int err; | 1353 | int err; |
1352 | 1354 | ||
@@ -1399,8 +1401,8 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci, | |||
1399 | const struct pci_device_id *pci_id) | 1401 | const struct pci_device_id *pci_id) |
1400 | { | 1402 | { |
1401 | static int dev; | 1403 | static int dev; |
1402 | snd_card_t *card; | 1404 | struct snd_card *card; |
1403 | ca0106_t *chip; | 1405 | struct snd_ca0106 *chip; |
1404 | int err; | 1406 | int err; |
1405 | 1407 | ||
1406 | if (dev >= SNDRV_CARDS) | 1408 | if (dev >= SNDRV_CARDS) |
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c index 0730dc7c66e5..39100cb62c4f 100644 --- a/sound/pci/ca0106/ca0106_mixer.c +++ b/sound/pci/ca0106/ca0106_mixer.c | |||
@@ -73,7 +73,8 @@ | |||
73 | 73 | ||
74 | #include "ca0106.h" | 74 | #include "ca0106.h" |
75 | 75 | ||
76 | static int snd_ca0106_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 76 | static int snd_ca0106_shared_spdif_info(struct snd_kcontrol *kcontrol, |
77 | struct snd_ctl_elem_info *uinfo) | ||
77 | { | 78 | { |
78 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 79 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
79 | uinfo->count = 1; | 80 | uinfo->count = 1; |
@@ -82,19 +83,19 @@ static int snd_ca0106_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i | |||
82 | return 0; | 83 | return 0; |
83 | } | 84 | } |
84 | 85 | ||
85 | static int snd_ca0106_shared_spdif_get(snd_kcontrol_t * kcontrol, | 86 | static int snd_ca0106_shared_spdif_get(struct snd_kcontrol *kcontrol, |
86 | snd_ctl_elem_value_t * ucontrol) | 87 | struct snd_ctl_elem_value *ucontrol) |
87 | { | 88 | { |
88 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 89 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
89 | 90 | ||
90 | ucontrol->value.enumerated.item[0] = emu->spdif_enable; | 91 | ucontrol->value.enumerated.item[0] = emu->spdif_enable; |
91 | return 0; | 92 | return 0; |
92 | } | 93 | } |
93 | 94 | ||
94 | static int snd_ca0106_shared_spdif_put(snd_kcontrol_t * kcontrol, | 95 | static int snd_ca0106_shared_spdif_put(struct snd_kcontrol *kcontrol, |
95 | snd_ctl_elem_value_t * ucontrol) | 96 | struct snd_ctl_elem_value *ucontrol) |
96 | { | 97 | { |
97 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 98 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
98 | unsigned int val; | 99 | unsigned int val; |
99 | int change = 0; | 100 | int change = 0; |
100 | u32 mask; | 101 | u32 mask; |
@@ -125,7 +126,8 @@ static int snd_ca0106_shared_spdif_put(snd_kcontrol_t * kcontrol, | |||
125 | return change; | 126 | return change; |
126 | } | 127 | } |
127 | 128 | ||
128 | static int snd_ca0106_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 129 | static int snd_ca0106_capture_source_info(struct snd_kcontrol *kcontrol, |
130 | struct snd_ctl_elem_info *uinfo) | ||
129 | { | 131 | { |
130 | static char *texts[6] = { | 132 | static char *texts[6] = { |
131 | "SPDIF out", "i2s mixer out", "SPDIF in", "i2s in", "AC97 in", "SRC out" | 133 | "SPDIF out", "i2s mixer out", "SPDIF in", "i2s in", "AC97 in", "SRC out" |
@@ -140,19 +142,19 @@ static int snd_ca0106_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem | |||
140 | return 0; | 142 | return 0; |
141 | } | 143 | } |
142 | 144 | ||
143 | static int snd_ca0106_capture_source_get(snd_kcontrol_t * kcontrol, | 145 | static int snd_ca0106_capture_source_get(struct snd_kcontrol *kcontrol, |
144 | snd_ctl_elem_value_t * ucontrol) | 146 | struct snd_ctl_elem_value *ucontrol) |
145 | { | 147 | { |
146 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 148 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
147 | 149 | ||
148 | ucontrol->value.enumerated.item[0] = emu->capture_source; | 150 | ucontrol->value.enumerated.item[0] = emu->capture_source; |
149 | return 0; | 151 | return 0; |
150 | } | 152 | } |
151 | 153 | ||
152 | static int snd_ca0106_capture_source_put(snd_kcontrol_t * kcontrol, | 154 | static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol, |
153 | snd_ctl_elem_value_t * ucontrol) | 155 | struct snd_ctl_elem_value *ucontrol) |
154 | { | 156 | { |
155 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 157 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
156 | unsigned int val; | 158 | unsigned int val; |
157 | int change = 0; | 159 | int change = 0; |
158 | u32 mask; | 160 | u32 mask; |
@@ -169,7 +171,8 @@ static int snd_ca0106_capture_source_put(snd_kcontrol_t * kcontrol, | |||
169 | return change; | 171 | return change; |
170 | } | 172 | } |
171 | 173 | ||
172 | static int snd_ca0106_capture_mic_line_in_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 174 | static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol, |
175 | struct snd_ctl_elem_info *uinfo) | ||
173 | { | 176 | { |
174 | static char *texts[2] = { "Line in", "Mic in" }; | 177 | static char *texts[2] = { "Line in", "Mic in" }; |
175 | 178 | ||
@@ -182,19 +185,19 @@ static int snd_ca0106_capture_mic_line_in_info(snd_kcontrol_t *kcontrol, snd_ctl | |||
182 | return 0; | 185 | return 0; |
183 | } | 186 | } |
184 | 187 | ||
185 | static int snd_ca0106_capture_mic_line_in_get(snd_kcontrol_t * kcontrol, | 188 | static int snd_ca0106_capture_mic_line_in_get(struct snd_kcontrol *kcontrol, |
186 | snd_ctl_elem_value_t * ucontrol) | 189 | struct snd_ctl_elem_value *ucontrol) |
187 | { | 190 | { |
188 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 191 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
189 | 192 | ||
190 | ucontrol->value.enumerated.item[0] = emu->capture_mic_line_in; | 193 | ucontrol->value.enumerated.item[0] = emu->capture_mic_line_in; |
191 | return 0; | 194 | return 0; |
192 | } | 195 | } |
193 | 196 | ||
194 | static int snd_ca0106_capture_mic_line_in_put(snd_kcontrol_t * kcontrol, | 197 | static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol, |
195 | snd_ctl_elem_value_t * ucontrol) | 198 | struct snd_ctl_elem_value *ucontrol) |
196 | { | 199 | { |
197 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 200 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
198 | unsigned int val; | 201 | unsigned int val; |
199 | int change = 0; | 202 | int change = 0; |
200 | u32 tmp; | 203 | u32 tmp; |
@@ -219,7 +222,7 @@ static int snd_ca0106_capture_mic_line_in_put(snd_kcontrol_t * kcontrol, | |||
219 | return change; | 222 | return change; |
220 | } | 223 | } |
221 | 224 | ||
222 | static snd_kcontrol_new_t snd_ca0106_capture_mic_line_in __devinitdata = | 225 | static struct snd_kcontrol_new snd_ca0106_capture_mic_line_in __devinitdata = |
223 | { | 226 | { |
224 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 227 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
225 | .name = "Mic/Line in Capture", | 228 | .name = "Mic/Line in Capture", |
@@ -228,17 +231,18 @@ static snd_kcontrol_new_t snd_ca0106_capture_mic_line_in __devinitdata = | |||
228 | .put = snd_ca0106_capture_mic_line_in_put | 231 | .put = snd_ca0106_capture_mic_line_in_put |
229 | }; | 232 | }; |
230 | 233 | ||
231 | static int snd_ca0106_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 234 | static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol, |
235 | struct snd_ctl_elem_info *uinfo) | ||
232 | { | 236 | { |
233 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 237 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
234 | uinfo->count = 1; | 238 | uinfo->count = 1; |
235 | return 0; | 239 | return 0; |
236 | } | 240 | } |
237 | 241 | ||
238 | static int snd_ca0106_spdif_get(snd_kcontrol_t * kcontrol, | 242 | static int snd_ca0106_spdif_get(struct snd_kcontrol *kcontrol, |
239 | snd_ctl_elem_value_t * ucontrol) | 243 | struct snd_ctl_elem_value *ucontrol) |
240 | { | 244 | { |
241 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 245 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
242 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 246 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
243 | 247 | ||
244 | ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff; | 248 | ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff; |
@@ -248,8 +252,8 @@ static int snd_ca0106_spdif_get(snd_kcontrol_t * kcontrol, | |||
248 | return 0; | 252 | return 0; |
249 | } | 253 | } |
250 | 254 | ||
251 | static int snd_ca0106_spdif_get_mask(snd_kcontrol_t * kcontrol, | 255 | static int snd_ca0106_spdif_get_mask(struct snd_kcontrol *kcontrol, |
252 | snd_ctl_elem_value_t * ucontrol) | 256 | struct snd_ctl_elem_value *ucontrol) |
253 | { | 257 | { |
254 | ucontrol->value.iec958.status[0] = 0xff; | 258 | ucontrol->value.iec958.status[0] = 0xff; |
255 | ucontrol->value.iec958.status[1] = 0xff; | 259 | ucontrol->value.iec958.status[1] = 0xff; |
@@ -258,10 +262,10 @@ static int snd_ca0106_spdif_get_mask(snd_kcontrol_t * kcontrol, | |||
258 | return 0; | 262 | return 0; |
259 | } | 263 | } |
260 | 264 | ||
261 | static int snd_ca0106_spdif_put(snd_kcontrol_t * kcontrol, | 265 | static int snd_ca0106_spdif_put(struct snd_kcontrol *kcontrol, |
262 | snd_ctl_elem_value_t * ucontrol) | 266 | struct snd_ctl_elem_value *ucontrol) |
263 | { | 267 | { |
264 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 268 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
265 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 269 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
266 | int change; | 270 | int change; |
267 | unsigned int val; | 271 | unsigned int val; |
@@ -278,7 +282,8 @@ static int snd_ca0106_spdif_put(snd_kcontrol_t * kcontrol, | |||
278 | return change; | 282 | return change; |
279 | } | 283 | } |
280 | 284 | ||
281 | static int snd_ca0106_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 285 | static int snd_ca0106_volume_info(struct snd_kcontrol *kcontrol, |
286 | struct snd_ctl_elem_info *uinfo) | ||
282 | { | 287 | { |
283 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 288 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
284 | uinfo->count = 2; | 289 | uinfo->count = 2; |
@@ -287,10 +292,10 @@ static int snd_ca0106_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
287 | return 0; | 292 | return 0; |
288 | } | 293 | } |
289 | 294 | ||
290 | static int snd_ca0106_volume_get(snd_kcontrol_t * kcontrol, | 295 | static int snd_ca0106_volume_get(struct snd_kcontrol *kcontrol, |
291 | snd_ctl_elem_value_t * ucontrol) | 296 | struct snd_ctl_elem_value *ucontrol) |
292 | { | 297 | { |
293 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 298 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
294 | unsigned int value; | 299 | unsigned int value; |
295 | int channel_id, reg; | 300 | int channel_id, reg; |
296 | 301 | ||
@@ -303,10 +308,10 @@ static int snd_ca0106_volume_get(snd_kcontrol_t * kcontrol, | |||
303 | return 0; | 308 | return 0; |
304 | } | 309 | } |
305 | 310 | ||
306 | static int snd_ca0106_volume_put(snd_kcontrol_t * kcontrol, | 311 | static int snd_ca0106_volume_put(struct snd_kcontrol *kcontrol, |
307 | snd_ctl_elem_value_t * ucontrol) | 312 | struct snd_ctl_elem_value *ucontrol) |
308 | { | 313 | { |
309 | ca0106_t *emu = snd_kcontrol_chip(kcontrol); | 314 | struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); |
310 | unsigned int oval, nval; | 315 | unsigned int oval, nval; |
311 | int channel_id, reg; | 316 | int channel_id, reg; |
312 | 317 | ||
@@ -334,7 +339,7 @@ static int snd_ca0106_volume_put(snd_kcontrol_t * kcontrol, | |||
334 | } | 339 | } |
335 | 340 | ||
336 | 341 | ||
337 | static snd_kcontrol_new_t snd_ca0106_volume_ctls[] __devinitdata = { | 342 | static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = { |
338 | CA_VOLUME("Analog Front Playback Volume", | 343 | CA_VOLUME("Analog Front Playback Volume", |
339 | CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2), | 344 | CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2), |
340 | CA_VOLUME("Analog Rear Playback Volume", | 345 | CA_VOLUME("Analog Rear Playback Volume", |
@@ -388,18 +393,18 @@ static snd_kcontrol_new_t snd_ca0106_volume_ctls[] __devinitdata = { | |||
388 | }, | 393 | }, |
389 | }; | 394 | }; |
390 | 395 | ||
391 | static int __devinit remove_ctl(snd_card_t *card, const char *name) | 396 | static int __devinit remove_ctl(struct snd_card *card, const char *name) |
392 | { | 397 | { |
393 | snd_ctl_elem_id_t id; | 398 | struct snd_ctl_elem_id id; |
394 | memset(&id, 0, sizeof(id)); | 399 | memset(&id, 0, sizeof(id)); |
395 | strcpy(id.name, name); | 400 | strcpy(id.name, name); |
396 | id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; | 401 | id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; |
397 | return snd_ctl_remove_id(card, &id); | 402 | return snd_ctl_remove_id(card, &id); |
398 | } | 403 | } |
399 | 404 | ||
400 | static snd_kcontrol_t __devinit *ctl_find(snd_card_t *card, const char *name) | 405 | static struct snd_kcontrol __devinit *ctl_find(struct snd_card *card, const char *name) |
401 | { | 406 | { |
402 | snd_ctl_elem_id_t sid; | 407 | struct snd_ctl_elem_id sid; |
403 | memset(&sid, 0, sizeof(sid)); | 408 | memset(&sid, 0, sizeof(sid)); |
404 | /* FIXME: strcpy is bad. */ | 409 | /* FIXME: strcpy is bad. */ |
405 | strcpy(sid.name, name); | 410 | strcpy(sid.name, name); |
@@ -407,9 +412,9 @@ static snd_kcontrol_t __devinit *ctl_find(snd_card_t *card, const char *name) | |||
407 | return snd_ctl_find_id(card, &sid); | 412 | return snd_ctl_find_id(card, &sid); |
408 | } | 413 | } |
409 | 414 | ||
410 | static int __devinit rename_ctl(snd_card_t *card, const char *src, const char *dst) | 415 | static int __devinit rename_ctl(struct snd_card *card, const char *src, const char *dst) |
411 | { | 416 | { |
412 | snd_kcontrol_t *kctl = ctl_find(card, src); | 417 | struct snd_kcontrol *kctl = ctl_find(card, src); |
413 | if (kctl) { | 418 | if (kctl) { |
414 | strcpy(kctl->id.name, dst); | 419 | strcpy(kctl->id.name, dst); |
415 | return 0; | 420 | return 0; |
@@ -417,10 +422,10 @@ static int __devinit rename_ctl(snd_card_t *card, const char *src, const char *d | |||
417 | return -ENOENT; | 422 | return -ENOENT; |
418 | } | 423 | } |
419 | 424 | ||
420 | int __devinit snd_ca0106_mixer(ca0106_t *emu) | 425 | int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu) |
421 | { | 426 | { |
422 | int i, err; | 427 | int i, err; |
423 | snd_card_t *card = emu->card; | 428 | struct snd_card *card = emu->card; |
424 | char **c; | 429 | char **c; |
425 | static char *ca0106_remove_ctls[] = { | 430 | static char *ca0106_remove_ctls[] = { |
426 | "Master Mono Playback Switch", | 431 | "Master Mono Playback Switch", |
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c index 1c9cc821d1b9..94b622599386 100644 --- a/sound/pci/ca0106/ca0106_proc.c +++ b/sound/pci/ca0106/ca0106_proc.c | |||
@@ -97,7 +97,7 @@ static struct snd_ca0106_category_str snd_ca0106_con_category[] = { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | 99 | ||
100 | static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value) | 100 | static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 value) |
101 | { | 101 | { |
102 | int i; | 102 | int i; |
103 | u32 status[4]; | 103 | u32 status[4]; |
@@ -271,10 +271,10 @@ static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value) | |||
271 | } | 271 | } |
272 | } | 272 | } |
273 | 273 | ||
274 | static void snd_ca0106_proc_iec958(snd_info_entry_t *entry, | 274 | static void snd_ca0106_proc_iec958(struct snd_info_entry *entry, |
275 | snd_info_buffer_t * buffer) | 275 | struct snd_info_buffer *buffer) |
276 | { | 276 | { |
277 | ca0106_t *emu = entry->private_data; | 277 | struct snd_ca0106 *emu = entry->private_data; |
278 | u32 value; | 278 | u32 value; |
279 | 279 | ||
280 | value = snd_ca0106_ptr_read(emu, SAMPLE_RATE_TRACKER_STATUS, 0); | 280 | value = snd_ca0106_ptr_read(emu, SAMPLE_RATE_TRACKER_STATUS, 0); |
@@ -293,10 +293,10 @@ static void snd_ca0106_proc_iec958(snd_info_entry_t *entry, | |||
293 | snd_iprintf(buffer, "\n"); | 293 | snd_iprintf(buffer, "\n"); |
294 | } | 294 | } |
295 | 295 | ||
296 | static void snd_ca0106_proc_reg_write32(snd_info_entry_t *entry, | 296 | static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry, |
297 | snd_info_buffer_t * buffer) | 297 | struct snd_info_buffer *buffer) |
298 | { | 298 | { |
299 | ca0106_t *emu = entry->private_data; | 299 | struct snd_ca0106 *emu = entry->private_data; |
300 | unsigned long flags; | 300 | unsigned long flags; |
301 | char line[64]; | 301 | char line[64]; |
302 | u32 reg, val; | 302 | u32 reg, val; |
@@ -311,10 +311,10 @@ static void snd_ca0106_proc_reg_write32(snd_info_entry_t *entry, | |||
311 | } | 311 | } |
312 | } | 312 | } |
313 | 313 | ||
314 | static void snd_ca0106_proc_reg_read32(snd_info_entry_t *entry, | 314 | static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry, |
315 | snd_info_buffer_t * buffer) | 315 | struct snd_info_buffer *buffer) |
316 | { | 316 | { |
317 | ca0106_t *emu = entry->private_data; | 317 | struct snd_ca0106 *emu = entry->private_data; |
318 | unsigned long value; | 318 | unsigned long value; |
319 | unsigned long flags; | 319 | unsigned long flags; |
320 | int i; | 320 | int i; |
@@ -327,10 +327,10 @@ static void snd_ca0106_proc_reg_read32(snd_info_entry_t *entry, | |||
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | ||
330 | static void snd_ca0106_proc_reg_read16(snd_info_entry_t *entry, | 330 | static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry, |
331 | snd_info_buffer_t * buffer) | 331 | struct snd_info_buffer *buffer) |
332 | { | 332 | { |
333 | ca0106_t *emu = entry->private_data; | 333 | struct snd_ca0106 *emu = entry->private_data; |
334 | unsigned int value; | 334 | unsigned int value; |
335 | unsigned long flags; | 335 | unsigned long flags; |
336 | int i; | 336 | int i; |
@@ -343,10 +343,10 @@ static void snd_ca0106_proc_reg_read16(snd_info_entry_t *entry, | |||
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | static void snd_ca0106_proc_reg_read8(snd_info_entry_t *entry, | 346 | static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry, |
347 | snd_info_buffer_t * buffer) | 347 | struct snd_info_buffer *buffer) |
348 | { | 348 | { |
349 | ca0106_t *emu = entry->private_data; | 349 | struct snd_ca0106 *emu = entry->private_data; |
350 | unsigned int value; | 350 | unsigned int value; |
351 | unsigned long flags; | 351 | unsigned long flags; |
352 | int i; | 352 | int i; |
@@ -359,10 +359,10 @@ static void snd_ca0106_proc_reg_read8(snd_info_entry_t *entry, | |||
359 | } | 359 | } |
360 | } | 360 | } |
361 | 361 | ||
362 | static void snd_ca0106_proc_reg_read1(snd_info_entry_t *entry, | 362 | static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry, |
363 | snd_info_buffer_t * buffer) | 363 | struct snd_info_buffer *buffer) |
364 | { | 364 | { |
365 | ca0106_t *emu = entry->private_data; | 365 | struct snd_ca0106 *emu = entry->private_data; |
366 | unsigned long value; | 366 | unsigned long value; |
367 | int i,j; | 367 | int i,j; |
368 | 368 | ||
@@ -377,10 +377,10 @@ static void snd_ca0106_proc_reg_read1(snd_info_entry_t *entry, | |||
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | static void snd_ca0106_proc_reg_read2(snd_info_entry_t *entry, | 380 | static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry, |
381 | snd_info_buffer_t * buffer) | 381 | struct snd_info_buffer *buffer) |
382 | { | 382 | { |
383 | ca0106_t *emu = entry->private_data; | 383 | struct snd_ca0106 *emu = entry->private_data; |
384 | unsigned long value; | 384 | unsigned long value; |
385 | int i,j; | 385 | int i,j; |
386 | 386 | ||
@@ -395,10 +395,10 @@ static void snd_ca0106_proc_reg_read2(snd_info_entry_t *entry, | |||
395 | } | 395 | } |
396 | } | 396 | } |
397 | 397 | ||
398 | static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry, | 398 | static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry, |
399 | snd_info_buffer_t * buffer) | 399 | struct snd_info_buffer *buffer) |
400 | { | 400 | { |
401 | ca0106_t *emu = entry->private_data; | 401 | struct snd_ca0106 *emu = entry->private_data; |
402 | char line[64]; | 402 | char line[64]; |
403 | unsigned int reg, channel_id , val; | 403 | unsigned int reg, channel_id , val; |
404 | while (!snd_info_get_line(buffer, line, sizeof(line))) { | 404 | while (!snd_info_get_line(buffer, line, sizeof(line))) { |
@@ -409,10 +409,10 @@ static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry, | |||
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry, | 412 | static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry, |
413 | snd_info_buffer_t * buffer) | 413 | struct snd_info_buffer *buffer) |
414 | { | 414 | { |
415 | ca0106_t *emu = entry->private_data; | 415 | struct snd_ca0106 *emu = entry->private_data; |
416 | char line[64]; | 416 | char line[64]; |
417 | unsigned int reg, val; | 417 | unsigned int reg, val; |
418 | while (!snd_info_get_line(buffer, line, sizeof(line))) { | 418 | while (!snd_info_get_line(buffer, line, sizeof(line))) { |
@@ -424,9 +424,9 @@ static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry, | |||
424 | } | 424 | } |
425 | } | 425 | } |
426 | 426 | ||
427 | int __devinit snd_ca0106_proc_init(ca0106_t * emu) | 427 | int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu) |
428 | { | 428 | { |
429 | snd_info_entry_t *entry; | 429 | struct snd_info_entry *entry; |
430 | 430 | ||
431 | if(! snd_card_proc_new(emu->card, "iec958", &entry)) | 431 | if(! snd_card_proc_new(emu->card, "iec958", &entry)) |
432 | snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_iec958); | 432 | snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_iec958); |
diff --git a/sound/pci/ca0106/ca_midi.c b/sound/pci/ca0106/ca_midi.c index 2e08b27b8349..2e6eab1f1189 100644 --- a/sound/pci/ca0106/ca_midi.c +++ b/sound/pci/ca0106/ca_midi.c | |||
@@ -40,18 +40,20 @@ | |||
40 | #define ca_midi_input_avail(midi) (!(ca_midi_read_stat(midi) & midi->input_avail)) | 40 | #define ca_midi_input_avail(midi) (!(ca_midi_read_stat(midi) & midi->input_avail)) |
41 | #define ca_midi_output_ready(midi) (!(ca_midi_read_stat(midi) & midi->output_ready)) | 41 | #define ca_midi_output_ready(midi) (!(ca_midi_read_stat(midi) & midi->output_ready)) |
42 | 42 | ||
43 | static void ca_midi_clear_rx(ca_midi_t *midi) | 43 | static void ca_midi_clear_rx(struct snd_ca_midi *midi) |
44 | { | 44 | { |
45 | int timeout = 100000; | 45 | int timeout = 100000; |
46 | for (; timeout > 0 && ca_midi_input_avail(midi); timeout--) | 46 | for (; timeout > 0 && ca_midi_input_avail(midi); timeout--) |
47 | ca_midi_read_data(midi); | 47 | ca_midi_read_data(midi); |
48 | #ifdef CONFIG_SND_DEBUG | 48 | #ifdef CONFIG_SND_DEBUG |
49 | if (timeout <= 0) | 49 | if (timeout <= 0) |
50 | snd_printk(KERN_ERR "ca_midi_clear_rx: timeout (status = 0x%x)\n", ca_midi_read_stat(midi)); | 50 | snd_printk(KERN_ERR "ca_midi_clear_rx: timeout (status = 0x%x)\n", |
51 | ca_midi_read_stat(midi)); | ||
51 | #endif | 52 | #endif |
52 | } | 53 | } |
53 | 54 | ||
54 | static void ca_midi_interrupt(ca_midi_t *midi, unsigned int status) { | 55 | static void ca_midi_interrupt(struct snd_ca_midi *midi, unsigned int status) |
56 | { | ||
55 | unsigned char byte; | 57 | unsigned char byte; |
56 | 58 | ||
57 | if (midi->rmidi == NULL) { | 59 | if (midi->rmidi == NULL) { |
@@ -86,7 +88,7 @@ static void ca_midi_interrupt(ca_midi_t *midi, unsigned int status) { | |||
86 | 88 | ||
87 | } | 89 | } |
88 | 90 | ||
89 | static void ca_midi_cmd(ca_midi_t *midi, unsigned char cmd, int ack) | 91 | static void ca_midi_cmd(struct snd_ca_midi *midi, unsigned char cmd, int ack) |
90 | { | 92 | { |
91 | unsigned long flags; | 93 | unsigned long flags; |
92 | int timeout, ok; | 94 | int timeout, ok; |
@@ -119,9 +121,9 @@ static void ca_midi_cmd(ca_midi_t *midi, unsigned char cmd, int ack) | |||
119 | ca_midi_read_data(midi)); | 121 | ca_midi_read_data(midi)); |
120 | } | 122 | } |
121 | 123 | ||
122 | static int ca_midi_input_open(snd_rawmidi_substream_t * substream) | 124 | static int ca_midi_input_open(struct snd_rawmidi_substream *substream) |
123 | { | 125 | { |
124 | ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; | 126 | struct snd_ca_midi *midi = substream->rmidi->private_data; |
125 | unsigned long flags; | 127 | unsigned long flags; |
126 | 128 | ||
127 | snd_assert(midi->dev_id, return -ENXIO); | 129 | snd_assert(midi->dev_id, return -ENXIO); |
@@ -138,9 +140,9 @@ static int ca_midi_input_open(snd_rawmidi_substream_t * substream) | |||
138 | return 0; | 140 | return 0; |
139 | } | 141 | } |
140 | 142 | ||
141 | static int ca_midi_output_open(snd_rawmidi_substream_t * substream) | 143 | static int ca_midi_output_open(struct snd_rawmidi_substream *substream) |
142 | { | 144 | { |
143 | ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; | 145 | struct snd_ca_midi *midi = substream->rmidi->private_data; |
144 | unsigned long flags; | 146 | unsigned long flags; |
145 | 147 | ||
146 | snd_assert(midi->dev_id, return -ENXIO); | 148 | snd_assert(midi->dev_id, return -ENXIO); |
@@ -157,9 +159,9 @@ static int ca_midi_output_open(snd_rawmidi_substream_t * substream) | |||
157 | return 0; | 159 | return 0; |
158 | } | 160 | } |
159 | 161 | ||
160 | static int ca_midi_input_close(snd_rawmidi_substream_t * substream) | 162 | static int ca_midi_input_close(struct snd_rawmidi_substream *substream) |
161 | { | 163 | { |
162 | ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; | 164 | struct snd_ca_midi *midi = substream->rmidi->private_data; |
163 | unsigned long flags; | 165 | unsigned long flags; |
164 | 166 | ||
165 | snd_assert(midi->dev_id, return -ENXIO); | 167 | snd_assert(midi->dev_id, return -ENXIO); |
@@ -176,9 +178,9 @@ static int ca_midi_input_close(snd_rawmidi_substream_t * substream) | |||
176 | return 0; | 178 | return 0; |
177 | } | 179 | } |
178 | 180 | ||
179 | static int ca_midi_output_close(snd_rawmidi_substream_t * substream) | 181 | static int ca_midi_output_close(struct snd_rawmidi_substream *substream) |
180 | { | 182 | { |
181 | ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; | 183 | struct snd_ca_midi *midi = substream->rmidi->private_data; |
182 | unsigned long flags; | 184 | unsigned long flags; |
183 | snd_assert(midi->dev_id, return -ENXIO); | 185 | snd_assert(midi->dev_id, return -ENXIO); |
184 | 186 | ||
@@ -197,9 +199,9 @@ static int ca_midi_output_close(snd_rawmidi_substream_t * substream) | |||
197 | return 0; | 199 | return 0; |
198 | } | 200 | } |
199 | 201 | ||
200 | static void ca_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) | 202 | static void ca_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) |
201 | { | 203 | { |
202 | ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; | 204 | struct snd_ca_midi *midi = substream->rmidi->private_data; |
203 | snd_assert(midi->dev_id, return); | 205 | snd_assert(midi->dev_id, return); |
204 | 206 | ||
205 | if (up) { | 207 | if (up) { |
@@ -209,9 +211,9 @@ static void ca_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) | |||
209 | } | 211 | } |
210 | } | 212 | } |
211 | 213 | ||
212 | static void ca_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) | 214 | static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
213 | { | 215 | { |
214 | ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; | 216 | struct snd_ca_midi *midi = substream->rmidi->private_data; |
215 | unsigned long flags; | 217 | unsigned long flags; |
216 | 218 | ||
217 | snd_assert(midi->dev_id, return); | 219 | snd_assert(midi->dev_id, return); |
@@ -246,21 +248,22 @@ static void ca_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) | |||
246 | } | 248 | } |
247 | } | 249 | } |
248 | 250 | ||
249 | static snd_rawmidi_ops_t ca_midi_output = | 251 | static struct snd_rawmidi_ops ca_midi_output = |
250 | { | 252 | { |
251 | .open = ca_midi_output_open, | 253 | .open = ca_midi_output_open, |
252 | .close = ca_midi_output_close, | 254 | .close = ca_midi_output_close, |
253 | .trigger = ca_midi_output_trigger, | 255 | .trigger = ca_midi_output_trigger, |
254 | }; | 256 | }; |
255 | 257 | ||
256 | static snd_rawmidi_ops_t ca_midi_input = | 258 | static struct snd_rawmidi_ops ca_midi_input = |
257 | { | 259 | { |
258 | .open = ca_midi_input_open, | 260 | .open = ca_midi_input_open, |
259 | .close = ca_midi_input_close, | 261 | .close = ca_midi_input_close, |
260 | .trigger = ca_midi_input_trigger, | 262 | .trigger = ca_midi_input_trigger, |
261 | }; | 263 | }; |
262 | 264 | ||
263 | static void ca_midi_free(ca_midi_t *midi) { | 265 | static void ca_midi_free(struct snd_ca_midi *midi) |
266 | { | ||
264 | midi->interrupt = NULL; | 267 | midi->interrupt = NULL; |
265 | midi->interrupt_enable = NULL; | 268 | midi->interrupt_enable = NULL; |
266 | midi->interrupt_disable = NULL; | 269 | midi->interrupt_disable = NULL; |
@@ -271,14 +274,14 @@ static void ca_midi_free(ca_midi_t *midi) { | |||
271 | midi->rmidi = NULL; | 274 | midi->rmidi = NULL; |
272 | } | 275 | } |
273 | 276 | ||
274 | static void ca_rmidi_free(snd_rawmidi_t *rmidi) | 277 | static void ca_rmidi_free(struct snd_rawmidi *rmidi) |
275 | { | 278 | { |
276 | ca_midi_free((ca_midi_t *)rmidi->private_data); | 279 | ca_midi_free(rmidi->private_data); |
277 | } | 280 | } |
278 | 281 | ||
279 | int __devinit ca_midi_init(void *dev_id, ca_midi_t *midi, int device, char *name) | 282 | int __devinit ca_midi_init(void *dev_id, struct snd_ca_midi *midi, int device, char *name) |
280 | { | 283 | { |
281 | snd_rawmidi_t *rmidi; | 284 | struct snd_rawmidi *rmidi; |
282 | int err; | 285 | int err; |
283 | 286 | ||
284 | if ((err = snd_rawmidi_new(midi->get_dev_id_card(midi->dev_id), name, device, 1, 1, &rmidi)) < 0) | 287 | if ((err = snd_rawmidi_new(midi->get_dev_id_card(midi->dev_id), name, device, 1, 1, &rmidi)) < 0) |
diff --git a/sound/pci/ca0106/ca_midi.h b/sound/pci/ca0106/ca_midi.h index b452cec2bf57..b72c0933bd22 100644 --- a/sound/pci/ca0106/ca_midi.h +++ b/sound/pci/ca0106/ca_midi.h | |||
@@ -29,12 +29,11 @@ | |||
29 | #define CA_MIDI_MODE_INPUT MPU401_MODE_INPUT | 29 | #define CA_MIDI_MODE_INPUT MPU401_MODE_INPUT |
30 | #define CA_MIDI_MODE_OUTPUT MPU401_MODE_OUTPUT | 30 | #define CA_MIDI_MODE_OUTPUT MPU401_MODE_OUTPUT |
31 | 31 | ||
32 | typedef struct ca_midi ca_midi_t; | 32 | struct snd_ca_midi { |
33 | struct ca_midi { | ||
34 | 33 | ||
35 | snd_rawmidi_t *rmidi; | 34 | struct snd_rawmidi *rmidi; |
36 | snd_rawmidi_substream_t *substream_input; | 35 | struct snd_rawmidi_substream *substream_input; |
37 | snd_rawmidi_substream_t *substream_output; | 36 | struct snd_rawmidi_substream *substream_output; |
38 | 37 | ||
39 | void *dev_id; | 38 | void *dev_id; |
40 | 39 | ||
@@ -52,18 +51,16 @@ struct ca_midi { | |||
52 | int input_avail, output_ready; | 51 | int input_avail, output_ready; |
53 | int ack, reset, enter_uart; | 52 | int ack, reset, enter_uart; |
54 | 53 | ||
55 | void (*interrupt)(ca_midi_t *midi, unsigned int status); | 54 | void (*interrupt)(struct snd_ca_midi *midi, unsigned int status); |
56 | void (*interrupt_enable)(ca_midi_t *midi, int intr); | 55 | void (*interrupt_enable)(struct snd_ca_midi *midi, int intr); |
57 | void (*interrupt_disable)(ca_midi_t *midi, int intr); | 56 | void (*interrupt_disable)(struct snd_ca_midi *midi, int intr); |
58 | 57 | ||
59 | unsigned char (*read)(ca_midi_t *midi, int idx); | 58 | unsigned char (*read)(struct snd_ca_midi *midi, int idx); |
60 | void (*write)(ca_midi_t *midi, int data, int idx); | 59 | void (*write)(struct snd_ca_midi *midi, int data, int idx); |
61 | 60 | ||
62 | /* get info from dev_id */ | 61 | /* get info from dev_id */ |
63 | snd_card_t *(*get_dev_id_card)(void *dev_id); | 62 | struct snd_card *(*get_dev_id_card)(void *dev_id); |
64 | int (*get_dev_id_port)(void *dev_id); | 63 | int (*get_dev_id_port)(void *dev_id); |
65 | }; | 64 | }; |
66 | 65 | ||
67 | int __devinit ca_midi_init(void *card, ca_midi_t *midi, int device, char *name); | 66 | int ca_midi_init(void *card, struct snd_ca_midi *midi, int device, char *name); |
68 | |||
69 | |||