diff options
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/ad1848/ad1848.c | 8 | ||||
-rw-r--r-- | sound/isa/ad1848/ad1848_lib.c | 176 |
2 files changed, 92 insertions, 92 deletions
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 3ebcc482b07..ffc373b37a9 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c | |||
@@ -60,14 +60,14 @@ MODULE_PARM_DESC(dma1, "DMA1 # for AD1848 driver."); | |||
60 | module_param_array(thinkpad, bool, NULL, 0444); | 60 | module_param_array(thinkpad, bool, NULL, 0444); |
61 | MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series."); | 61 | MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series."); |
62 | 62 | ||
63 | static snd_card_t *snd_ad1848_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | 63 | static struct snd_card *snd_ad1848_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; |
64 | 64 | ||
65 | 65 | ||
66 | static int __init snd_card_ad1848_probe(int dev) | 66 | static int __init snd_card_ad1848_probe(int dev) |
67 | { | 67 | { |
68 | snd_card_t *card; | 68 | struct snd_card *card; |
69 | ad1848_t *chip; | 69 | struct snd_ad1848 *chip; |
70 | snd_pcm_t *pcm; | 70 | struct snd_pcm *pcm; |
71 | int err; | 71 | int err; |
72 | 72 | ||
73 | if (port[dev] == SNDRV_AUTO_PORT) { | 73 | if (port[dev] == SNDRV_AUTO_PORT) { |
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c index 84a3c559655..55ba32d4a22 100644 --- a/sound/isa/ad1848/ad1848_lib.c +++ b/sound/isa/ad1848/ad1848_lib.c | |||
@@ -69,7 +69,7 @@ static unsigned int rates[14] = { | |||
69 | 27042, 32000, 33075, 37800, 44100, 48000 | 69 | 27042, 32000, 33075, 37800, 44100, 48000 |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static snd_pcm_hw_constraint_list_t hw_constraints_rates = { | 72 | static struct snd_pcm_hw_constraint_list hw_constraints_rates = { |
73 | .count = 14, | 73 | .count = 14, |
74 | .list = rates, | 74 | .list = rates, |
75 | .mask = 0, | 75 | .mask = 0, |
@@ -99,7 +99,7 @@ static unsigned char snd_ad1848_original_image[16] = | |||
99 | * Basic I/O functions | 99 | * Basic I/O functions |
100 | */ | 100 | */ |
101 | 101 | ||
102 | void snd_ad1848_out(ad1848_t *chip, | 102 | void snd_ad1848_out(struct snd_ad1848 *chip, |
103 | unsigned char reg, | 103 | unsigned char reg, |
104 | unsigned char value) | 104 | unsigned char value) |
105 | { | 105 | { |
@@ -119,7 +119,7 @@ void snd_ad1848_out(ad1848_t *chip, | |||
119 | #endif | 119 | #endif |
120 | } | 120 | } |
121 | 121 | ||
122 | static void snd_ad1848_dout(ad1848_t *chip, | 122 | static void snd_ad1848_dout(struct snd_ad1848 *chip, |
123 | unsigned char reg, unsigned char value) | 123 | unsigned char reg, unsigned char value) |
124 | { | 124 | { |
125 | int timeout; | 125 | int timeout; |
@@ -131,7 +131,7 @@ static void snd_ad1848_dout(ad1848_t *chip, | |||
131 | mb(); | 131 | mb(); |
132 | } | 132 | } |
133 | 133 | ||
134 | static unsigned char snd_ad1848_in(ad1848_t *chip, unsigned char reg) | 134 | static unsigned char snd_ad1848_in(struct snd_ad1848 *chip, unsigned char reg) |
135 | { | 135 | { |
136 | int timeout; | 136 | int timeout; |
137 | 137 | ||
@@ -148,7 +148,7 @@ static unsigned char snd_ad1848_in(ad1848_t *chip, unsigned char reg) | |||
148 | 148 | ||
149 | #if 0 | 149 | #if 0 |
150 | 150 | ||
151 | static void snd_ad1848_debug(ad1848_t *chip) | 151 | static void snd_ad1848_debug(struct snd_ad1848 *chip) |
152 | { | 152 | { |
153 | printk("AD1848 REGS: INDEX = 0x%02x ", inb(AD1848P(chip, REGSEL))); | 153 | printk("AD1848 REGS: INDEX = 0x%02x ", inb(AD1848P(chip, REGSEL))); |
154 | printk(" STATUS = 0x%02x\n", inb(AD1848P(chip, STATUS))); | 154 | printk(" STATUS = 0x%02x\n", inb(AD1848P(chip, STATUS))); |
@@ -176,7 +176,7 @@ static void snd_ad1848_debug(ad1848_t *chip) | |||
176 | * AD1848 detection / MCE routines | 176 | * AD1848 detection / MCE routines |
177 | */ | 177 | */ |
178 | 178 | ||
179 | static void snd_ad1848_mce_up(ad1848_t *chip) | 179 | static void snd_ad1848_mce_up(struct snd_ad1848 *chip) |
180 | { | 180 | { |
181 | unsigned long flags; | 181 | unsigned long flags; |
182 | int timeout; | 182 | int timeout; |
@@ -197,7 +197,7 @@ static void snd_ad1848_mce_up(ad1848_t *chip) | |||
197 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 197 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
198 | } | 198 | } |
199 | 199 | ||
200 | static void snd_ad1848_mce_down(ad1848_t *chip) | 200 | static void snd_ad1848_mce_down(struct snd_ad1848 *chip) |
201 | { | 201 | { |
202 | unsigned long flags; | 202 | unsigned long flags; |
203 | int timeout; | 203 | int timeout; |
@@ -279,7 +279,7 @@ static unsigned int snd_ad1848_get_count(unsigned char format, | |||
279 | return size; | 279 | return size; |
280 | } | 280 | } |
281 | 281 | ||
282 | static int snd_ad1848_trigger(ad1848_t *chip, unsigned char what, | 282 | static int snd_ad1848_trigger(struct snd_ad1848 *chip, unsigned char what, |
283 | int channel, int cmd) | 283 | int channel, int cmd) |
284 | { | 284 | { |
285 | int result = 0; | 285 | int result = 0; |
@@ -324,7 +324,7 @@ static unsigned char snd_ad1848_get_rate(unsigned int rate) | |||
324 | return freq_bits[13]; | 324 | return freq_bits[13]; |
325 | } | 325 | } |
326 | 326 | ||
327 | static int snd_ad1848_ioctl(snd_pcm_substream_t * substream, | 327 | static int snd_ad1848_ioctl(struct snd_pcm_substream *substream, |
328 | unsigned int cmd, void *arg) | 328 | unsigned int cmd, void *arg) |
329 | { | 329 | { |
330 | return snd_pcm_lib_ioctl(substream, cmd, arg); | 330 | return snd_pcm_lib_ioctl(substream, cmd, arg); |
@@ -348,7 +348,7 @@ static unsigned char snd_ad1848_get_format(int format, int channels) | |||
348 | return rformat; | 348 | return rformat; |
349 | } | 349 | } |
350 | 350 | ||
351 | static void snd_ad1848_calibrate_mute(ad1848_t *chip, int mute) | 351 | static void snd_ad1848_calibrate_mute(struct snd_ad1848 *chip, int mute) |
352 | { | 352 | { |
353 | unsigned long flags; | 353 | unsigned long flags; |
354 | 354 | ||
@@ -372,7 +372,7 @@ static void snd_ad1848_calibrate_mute(ad1848_t *chip, int mute) | |||
372 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 372 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
373 | } | 373 | } |
374 | 374 | ||
375 | static void snd_ad1848_set_data_format(ad1848_t *chip, snd_pcm_hw_params_t *hw_params) | 375 | static void snd_ad1848_set_data_format(struct snd_ad1848 *chip, struct snd_pcm_hw_params *hw_params) |
376 | { | 376 | { |
377 | if (hw_params == NULL) { | 377 | if (hw_params == NULL) { |
378 | chip->image[AD1848_DATA_FORMAT] = 0x20; | 378 | chip->image[AD1848_DATA_FORMAT] = 0x20; |
@@ -384,7 +384,7 @@ static void snd_ad1848_set_data_format(ad1848_t *chip, snd_pcm_hw_params_t *hw_p | |||
384 | // snd_printk(">>> pmode = 0x%x, dfr = 0x%x\n", pstr->mode, chip->image[AD1848_DATA_FORMAT]); | 384 | // snd_printk(">>> pmode = 0x%x, dfr = 0x%x\n", pstr->mode, chip->image[AD1848_DATA_FORMAT]); |
385 | } | 385 | } |
386 | 386 | ||
387 | static int snd_ad1848_open(ad1848_t *chip, unsigned int mode) | 387 | static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode) |
388 | { | 388 | { |
389 | unsigned long flags; | 389 | unsigned long flags; |
390 | 390 | ||
@@ -438,7 +438,7 @@ static int snd_ad1848_open(ad1848_t *chip, unsigned int mode) | |||
438 | return 0; | 438 | return 0; |
439 | } | 439 | } |
440 | 440 | ||
441 | static void snd_ad1848_close(ad1848_t *chip) | 441 | static void snd_ad1848_close(struct snd_ad1848 *chip) |
442 | { | 442 | { |
443 | unsigned long flags; | 443 | unsigned long flags; |
444 | 444 | ||
@@ -479,24 +479,24 @@ static void snd_ad1848_close(ad1848_t *chip) | |||
479 | * ok.. exported functions.. | 479 | * ok.. exported functions.. |
480 | */ | 480 | */ |
481 | 481 | ||
482 | static int snd_ad1848_playback_trigger(snd_pcm_substream_t * substream, | 482 | static int snd_ad1848_playback_trigger(struct snd_pcm_substream *substream, |
483 | int cmd) | 483 | int cmd) |
484 | { | 484 | { |
485 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 485 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
486 | return snd_ad1848_trigger(chip, AD1848_PLAYBACK_ENABLE, SNDRV_PCM_STREAM_PLAYBACK, cmd); | 486 | return snd_ad1848_trigger(chip, AD1848_PLAYBACK_ENABLE, SNDRV_PCM_STREAM_PLAYBACK, cmd); |
487 | } | 487 | } |
488 | 488 | ||
489 | static int snd_ad1848_capture_trigger(snd_pcm_substream_t * substream, | 489 | static int snd_ad1848_capture_trigger(struct snd_pcm_substream *substream, |
490 | int cmd) | 490 | int cmd) |
491 | { | 491 | { |
492 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 492 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
493 | return snd_ad1848_trigger(chip, AD1848_CAPTURE_ENABLE, SNDRV_PCM_STREAM_CAPTURE, cmd); | 493 | return snd_ad1848_trigger(chip, AD1848_CAPTURE_ENABLE, SNDRV_PCM_STREAM_CAPTURE, cmd); |
494 | } | 494 | } |
495 | 495 | ||
496 | static int snd_ad1848_playback_hw_params(snd_pcm_substream_t * substream, | 496 | static int snd_ad1848_playback_hw_params(struct snd_pcm_substream *substream, |
497 | snd_pcm_hw_params_t * hw_params) | 497 | struct snd_pcm_hw_params *hw_params) |
498 | { | 498 | { |
499 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 499 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
500 | unsigned long flags; | 500 | unsigned long flags; |
501 | int err; | 501 | int err; |
502 | 502 | ||
@@ -513,15 +513,15 @@ static int snd_ad1848_playback_hw_params(snd_pcm_substream_t * substream, | |||
513 | return 0; | 513 | return 0; |
514 | } | 514 | } |
515 | 515 | ||
516 | static int snd_ad1848_playback_hw_free(snd_pcm_substream_t * substream) | 516 | static int snd_ad1848_playback_hw_free(struct snd_pcm_substream *substream) |
517 | { | 517 | { |
518 | return snd_pcm_lib_free_pages(substream); | 518 | return snd_pcm_lib_free_pages(substream); |
519 | } | 519 | } |
520 | 520 | ||
521 | static int snd_ad1848_playback_prepare(snd_pcm_substream_t * substream) | 521 | static int snd_ad1848_playback_prepare(struct snd_pcm_substream *substream) |
522 | { | 522 | { |
523 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 523 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
524 | snd_pcm_runtime_t *runtime = substream->runtime; | 524 | struct snd_pcm_runtime *runtime = substream->runtime; |
525 | unsigned long flags; | 525 | unsigned long flags; |
526 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); | 526 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); |
527 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 527 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
@@ -537,10 +537,10 @@ static int snd_ad1848_playback_prepare(snd_pcm_substream_t * substream) | |||
537 | return 0; | 537 | return 0; |
538 | } | 538 | } |
539 | 539 | ||
540 | static int snd_ad1848_capture_hw_params(snd_pcm_substream_t * substream, | 540 | static int snd_ad1848_capture_hw_params(struct snd_pcm_substream *substream, |
541 | snd_pcm_hw_params_t * hw_params) | 541 | struct snd_pcm_hw_params *hw_params) |
542 | { | 542 | { |
543 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 543 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
544 | unsigned long flags; | 544 | unsigned long flags; |
545 | int err; | 545 | int err; |
546 | 546 | ||
@@ -557,15 +557,15 @@ static int snd_ad1848_capture_hw_params(snd_pcm_substream_t * substream, | |||
557 | return 0; | 557 | return 0; |
558 | } | 558 | } |
559 | 559 | ||
560 | static int snd_ad1848_capture_hw_free(snd_pcm_substream_t * substream) | 560 | static int snd_ad1848_capture_hw_free(struct snd_pcm_substream *substream) |
561 | { | 561 | { |
562 | return snd_pcm_lib_free_pages(substream); | 562 | return snd_pcm_lib_free_pages(substream); |
563 | } | 563 | } |
564 | 564 | ||
565 | static int snd_ad1848_capture_prepare(snd_pcm_substream_t * substream) | 565 | static int snd_ad1848_capture_prepare(struct snd_pcm_substream *substream) |
566 | { | 566 | { |
567 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 567 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
568 | snd_pcm_runtime_t *runtime = substream->runtime; | 568 | struct snd_pcm_runtime *runtime = substream->runtime; |
569 | unsigned long flags; | 569 | unsigned long flags; |
570 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); | 570 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); |
571 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 571 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
@@ -583,7 +583,7 @@ static int snd_ad1848_capture_prepare(snd_pcm_substream_t * substream) | |||
583 | 583 | ||
584 | static irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 584 | static irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
585 | { | 585 | { |
586 | ad1848_t *chip = dev_id; | 586 | struct snd_ad1848 *chip = dev_id; |
587 | 587 | ||
588 | if ((chip->mode & AD1848_MODE_PLAY) && chip->playback_substream && | 588 | if ((chip->mode & AD1848_MODE_PLAY) && chip->playback_substream && |
589 | (chip->mode & AD1848_MODE_RUNNING)) | 589 | (chip->mode & AD1848_MODE_RUNNING)) |
@@ -595,9 +595,9 @@ static irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *r | |||
595 | return IRQ_HANDLED; | 595 | return IRQ_HANDLED; |
596 | } | 596 | } |
597 | 597 | ||
598 | static snd_pcm_uframes_t snd_ad1848_playback_pointer(snd_pcm_substream_t * substream) | 598 | static snd_pcm_uframes_t snd_ad1848_playback_pointer(struct snd_pcm_substream *substream) |
599 | { | 599 | { |
600 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 600 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
601 | size_t ptr; | 601 | size_t ptr; |
602 | 602 | ||
603 | if (!(chip->image[AD1848_IFACE_CTRL] & AD1848_PLAYBACK_ENABLE)) | 603 | if (!(chip->image[AD1848_IFACE_CTRL] & AD1848_PLAYBACK_ENABLE)) |
@@ -606,9 +606,9 @@ static snd_pcm_uframes_t snd_ad1848_playback_pointer(snd_pcm_substream_t * subst | |||
606 | return bytes_to_frames(substream->runtime, ptr); | 606 | return bytes_to_frames(substream->runtime, ptr); |
607 | } | 607 | } |
608 | 608 | ||
609 | static snd_pcm_uframes_t snd_ad1848_capture_pointer(snd_pcm_substream_t * substream) | 609 | static snd_pcm_uframes_t snd_ad1848_capture_pointer(struct snd_pcm_substream *substream) |
610 | { | 610 | { |
611 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 611 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
612 | size_t ptr; | 612 | size_t ptr; |
613 | 613 | ||
614 | if (!(chip->image[AD1848_IFACE_CTRL] & AD1848_CAPTURE_ENABLE)) | 614 | if (!(chip->image[AD1848_IFACE_CTRL] & AD1848_CAPTURE_ENABLE)) |
@@ -621,7 +621,7 @@ static snd_pcm_uframes_t snd_ad1848_capture_pointer(snd_pcm_substream_t * substr | |||
621 | 621 | ||
622 | */ | 622 | */ |
623 | 623 | ||
624 | static void snd_ad1848_thinkpad_twiddle(ad1848_t *chip, int on) { | 624 | static void snd_ad1848_thinkpad_twiddle(struct snd_ad1848 *chip, int on) { |
625 | 625 | ||
626 | int tmp; | 626 | int tmp; |
627 | 627 | ||
@@ -642,9 +642,9 @@ static void snd_ad1848_thinkpad_twiddle(ad1848_t *chip, int on) { | |||
642 | } | 642 | } |
643 | 643 | ||
644 | #ifdef CONFIG_PM | 644 | #ifdef CONFIG_PM |
645 | static int snd_ad1848_suspend(snd_card_t *card, pm_message_t state) | 645 | static int snd_ad1848_suspend(struct snd_card *card, pm_message_t state) |
646 | { | 646 | { |
647 | ad1848_t *chip = card->pm_private_data; | 647 | struct snd_ad1848 *chip = card->pm_private_data; |
648 | 648 | ||
649 | snd_pcm_suspend_all(chip->pcm); | 649 | snd_pcm_suspend_all(chip->pcm); |
650 | /* FIXME: save registers? */ | 650 | /* FIXME: save registers? */ |
@@ -655,9 +655,9 @@ static int snd_ad1848_suspend(snd_card_t *card, pm_message_t state) | |||
655 | return 0; | 655 | return 0; |
656 | } | 656 | } |
657 | 657 | ||
658 | static int snd_ad1848_resume(snd_card_t *card) | 658 | static int snd_ad1848_resume(struct snd_card *card) |
659 | { | 659 | { |
660 | ad1848_t *chip = card->pm_private_data; | 660 | struct snd_ad1848 *chip = card->pm_private_data; |
661 | 661 | ||
662 | if (chip->thinkpad_flag) | 662 | if (chip->thinkpad_flag) |
663 | snd_ad1848_thinkpad_twiddle(chip, 1); | 663 | snd_ad1848_thinkpad_twiddle(chip, 1); |
@@ -668,7 +668,7 @@ static int snd_ad1848_resume(snd_card_t *card) | |||
668 | } | 668 | } |
669 | #endif /* CONFIG_PM */ | 669 | #endif /* CONFIG_PM */ |
670 | 670 | ||
671 | static int snd_ad1848_probe(ad1848_t * chip) | 671 | static int snd_ad1848_probe(struct snd_ad1848 * chip) |
672 | { | 672 | { |
673 | unsigned long flags; | 673 | unsigned long flags; |
674 | int i, id, rev, ad1847; | 674 | int i, id, rev, ad1847; |
@@ -748,7 +748,7 @@ static int snd_ad1848_probe(ad1848_t * chip) | |||
748 | 748 | ||
749 | */ | 749 | */ |
750 | 750 | ||
751 | static snd_pcm_hardware_t snd_ad1848_playback = | 751 | static struct snd_pcm_hardware snd_ad1848_playback = |
752 | { | 752 | { |
753 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 753 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
754 | SNDRV_PCM_INFO_MMAP_VALID), | 754 | SNDRV_PCM_INFO_MMAP_VALID), |
@@ -767,7 +767,7 @@ static snd_pcm_hardware_t snd_ad1848_playback = | |||
767 | .fifo_size = 0, | 767 | .fifo_size = 0, |
768 | }; | 768 | }; |
769 | 769 | ||
770 | static snd_pcm_hardware_t snd_ad1848_capture = | 770 | static struct snd_pcm_hardware snd_ad1848_capture = |
771 | { | 771 | { |
772 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 772 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
773 | SNDRV_PCM_INFO_MMAP_VALID), | 773 | SNDRV_PCM_INFO_MMAP_VALID), |
@@ -790,10 +790,10 @@ static snd_pcm_hardware_t snd_ad1848_capture = | |||
790 | 790 | ||
791 | */ | 791 | */ |
792 | 792 | ||
793 | static int snd_ad1848_playback_open(snd_pcm_substream_t * substream) | 793 | static int snd_ad1848_playback_open(struct snd_pcm_substream *substream) |
794 | { | 794 | { |
795 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 795 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
796 | snd_pcm_runtime_t *runtime = substream->runtime; | 796 | struct snd_pcm_runtime *runtime = substream->runtime; |
797 | int err; | 797 | int err; |
798 | 798 | ||
799 | if ((err = snd_ad1848_open(chip, AD1848_MODE_PLAY)) < 0) | 799 | if ((err = snd_ad1848_open(chip, AD1848_MODE_PLAY)) < 0) |
@@ -806,10 +806,10 @@ static int snd_ad1848_playback_open(snd_pcm_substream_t * substream) | |||
806 | return 0; | 806 | return 0; |
807 | } | 807 | } |
808 | 808 | ||
809 | static int snd_ad1848_capture_open(snd_pcm_substream_t * substream) | 809 | static int snd_ad1848_capture_open(struct snd_pcm_substream *substream) |
810 | { | 810 | { |
811 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 811 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
812 | snd_pcm_runtime_t *runtime = substream->runtime; | 812 | struct snd_pcm_runtime *runtime = substream->runtime; |
813 | int err; | 813 | int err; |
814 | 814 | ||
815 | if ((err = snd_ad1848_open(chip, AD1848_MODE_CAPTURE)) < 0) | 815 | if ((err = snd_ad1848_open(chip, AD1848_MODE_CAPTURE)) < 0) |
@@ -822,9 +822,9 @@ static int snd_ad1848_capture_open(snd_pcm_substream_t * substream) | |||
822 | return 0; | 822 | return 0; |
823 | } | 823 | } |
824 | 824 | ||
825 | static int snd_ad1848_playback_close(snd_pcm_substream_t * substream) | 825 | static int snd_ad1848_playback_close(struct snd_pcm_substream *substream) |
826 | { | 826 | { |
827 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 827 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
828 | 828 | ||
829 | chip->mode &= ~AD1848_MODE_PLAY; | 829 | chip->mode &= ~AD1848_MODE_PLAY; |
830 | chip->playback_substream = NULL; | 830 | chip->playback_substream = NULL; |
@@ -832,9 +832,9 @@ static int snd_ad1848_playback_close(snd_pcm_substream_t * substream) | |||
832 | return 0; | 832 | return 0; |
833 | } | 833 | } |
834 | 834 | ||
835 | static int snd_ad1848_capture_close(snd_pcm_substream_t * substream) | 835 | static int snd_ad1848_capture_close(struct snd_pcm_substream *substream) |
836 | { | 836 | { |
837 | ad1848_t *chip = snd_pcm_substream_chip(substream); | 837 | struct snd_ad1848 *chip = snd_pcm_substream_chip(substream); |
838 | 838 | ||
839 | chip->mode &= ~AD1848_MODE_CAPTURE; | 839 | chip->mode &= ~AD1848_MODE_CAPTURE; |
840 | chip->capture_substream = NULL; | 840 | chip->capture_substream = NULL; |
@@ -842,7 +842,7 @@ static int snd_ad1848_capture_close(snd_pcm_substream_t * substream) | |||
842 | return 0; | 842 | return 0; |
843 | } | 843 | } |
844 | 844 | ||
845 | static int snd_ad1848_free(ad1848_t *chip) | 845 | static int snd_ad1848_free(struct snd_ad1848 *chip) |
846 | { | 846 | { |
847 | release_and_free_resource(chip->res_port); | 847 | release_and_free_resource(chip->res_port); |
848 | if (chip->irq >= 0) | 848 | if (chip->irq >= 0) |
@@ -855,13 +855,13 @@ static int snd_ad1848_free(ad1848_t *chip) | |||
855 | return 0; | 855 | return 0; |
856 | } | 856 | } |
857 | 857 | ||
858 | static int snd_ad1848_dev_free(snd_device_t *device) | 858 | static int snd_ad1848_dev_free(struct snd_device *device) |
859 | { | 859 | { |
860 | ad1848_t *chip = device->device_data; | 860 | struct snd_ad1848 *chip = device->device_data; |
861 | return snd_ad1848_free(chip); | 861 | return snd_ad1848_free(chip); |
862 | } | 862 | } |
863 | 863 | ||
864 | static const char *snd_ad1848_chip_id(ad1848_t *chip) | 864 | static const char *snd_ad1848_chip_id(struct snd_ad1848 *chip) |
865 | { | 865 | { |
866 | switch (chip->hardware) { | 866 | switch (chip->hardware) { |
867 | case AD1848_HW_AD1847: return "AD1847"; | 867 | case AD1848_HW_AD1847: return "AD1847"; |
@@ -872,16 +872,16 @@ static const char *snd_ad1848_chip_id(ad1848_t *chip) | |||
872 | } | 872 | } |
873 | } | 873 | } |
874 | 874 | ||
875 | int snd_ad1848_create(snd_card_t * card, | 875 | int snd_ad1848_create(struct snd_card *card, |
876 | unsigned long port, | 876 | unsigned long port, |
877 | int irq, int dma, | 877 | int irq, int dma, |
878 | unsigned short hardware, | 878 | unsigned short hardware, |
879 | ad1848_t ** rchip) | 879 | struct snd_ad1848 ** rchip) |
880 | { | 880 | { |
881 | static snd_device_ops_t ops = { | 881 | static struct snd_device_ops ops = { |
882 | .dev_free = snd_ad1848_dev_free, | 882 | .dev_free = snd_ad1848_dev_free, |
883 | }; | 883 | }; |
884 | ad1848_t *chip; | 884 | struct snd_ad1848 *chip; |
885 | int err; | 885 | int err; |
886 | 886 | ||
887 | *rchip = NULL; | 887 | *rchip = NULL; |
@@ -937,7 +937,7 @@ int snd_ad1848_create(snd_card_t * card, | |||
937 | return 0; | 937 | return 0; |
938 | } | 938 | } |
939 | 939 | ||
940 | static snd_pcm_ops_t snd_ad1848_playback_ops = { | 940 | static struct snd_pcm_ops snd_ad1848_playback_ops = { |
941 | .open = snd_ad1848_playback_open, | 941 | .open = snd_ad1848_playback_open, |
942 | .close = snd_ad1848_playback_close, | 942 | .close = snd_ad1848_playback_close, |
943 | .ioctl = snd_ad1848_ioctl, | 943 | .ioctl = snd_ad1848_ioctl, |
@@ -948,7 +948,7 @@ static snd_pcm_ops_t snd_ad1848_playback_ops = { | |||
948 | .pointer = snd_ad1848_playback_pointer, | 948 | .pointer = snd_ad1848_playback_pointer, |
949 | }; | 949 | }; |
950 | 950 | ||
951 | static snd_pcm_ops_t snd_ad1848_capture_ops = { | 951 | static struct snd_pcm_ops snd_ad1848_capture_ops = { |
952 | .open = snd_ad1848_capture_open, | 952 | .open = snd_ad1848_capture_open, |
953 | .close = snd_ad1848_capture_close, | 953 | .close = snd_ad1848_capture_close, |
954 | .ioctl = snd_ad1848_ioctl, | 954 | .ioctl = snd_ad1848_ioctl, |
@@ -959,9 +959,9 @@ static snd_pcm_ops_t snd_ad1848_capture_ops = { | |||
959 | .pointer = snd_ad1848_capture_pointer, | 959 | .pointer = snd_ad1848_capture_pointer, |
960 | }; | 960 | }; |
961 | 961 | ||
962 | int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm) | 962 | int snd_ad1848_pcm(struct snd_ad1848 *chip, int device, struct snd_pcm **rpcm) |
963 | { | 963 | { |
964 | snd_pcm_t *pcm; | 964 | struct snd_pcm *pcm; |
965 | int err; | 965 | int err; |
966 | 966 | ||
967 | if ((err = snd_pcm_new(chip->card, "AD1848", device, 1, 1, &pcm)) < 0) | 967 | if ((err = snd_pcm_new(chip->card, "AD1848", device, 1, 1, &pcm)) < 0) |
@@ -984,7 +984,7 @@ int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm) | |||
984 | return 0; | 984 | return 0; |
985 | } | 985 | } |
986 | 986 | ||
987 | const snd_pcm_ops_t *snd_ad1848_get_pcm_ops(int direction) | 987 | const struct snd_pcm_ops *snd_ad1848_get_pcm_ops(int direction) |
988 | { | 988 | { |
989 | return direction == SNDRV_PCM_STREAM_PLAYBACK ? | 989 | return direction == SNDRV_PCM_STREAM_PLAYBACK ? |
990 | &snd_ad1848_playback_ops : &snd_ad1848_capture_ops; | 990 | &snd_ad1848_playback_ops : &snd_ad1848_capture_ops; |
@@ -994,7 +994,7 @@ const snd_pcm_ops_t *snd_ad1848_get_pcm_ops(int direction) | |||
994 | * MIXER part | 994 | * MIXER part |
995 | */ | 995 | */ |
996 | 996 | ||
997 | static int snd_ad1848_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 997 | static int snd_ad1848_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
998 | { | 998 | { |
999 | static char *texts[4] = { | 999 | static char *texts[4] = { |
1000 | "Line", "Aux", "Mic", "Mix" | 1000 | "Line", "Aux", "Mic", "Mix" |
@@ -1009,9 +1009,9 @@ static int snd_ad1848_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * u | |||
1009 | return 0; | 1009 | return 0; |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | static int snd_ad1848_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1012 | static int snd_ad1848_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1013 | { | 1013 | { |
1014 | ad1848_t *chip = snd_kcontrol_chip(kcontrol); | 1014 | struct snd_ad1848 *chip = snd_kcontrol_chip(kcontrol); |
1015 | unsigned long flags; | 1015 | unsigned long flags; |
1016 | 1016 | ||
1017 | spin_lock_irqsave(&chip->reg_lock, flags); | 1017 | spin_lock_irqsave(&chip->reg_lock, flags); |
@@ -1021,9 +1021,9 @@ static int snd_ad1848_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
1021 | return 0; | 1021 | return 0; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | static int snd_ad1848_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1024 | static int snd_ad1848_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1025 | { | 1025 | { |
1026 | ad1848_t *chip = snd_kcontrol_chip(kcontrol); | 1026 | struct snd_ad1848 *chip = snd_kcontrol_chip(kcontrol); |
1027 | unsigned long flags; | 1027 | unsigned long flags; |
1028 | unsigned short left, right; | 1028 | unsigned short left, right; |
1029 | int change; | 1029 | int change; |
@@ -1044,7 +1044,7 @@ static int snd_ad1848_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
1044 | return change; | 1044 | return change; |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | static int snd_ad1848_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1047 | static int snd_ad1848_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1048 | { | 1048 | { |
1049 | int mask = (kcontrol->private_value >> 16) & 0xff; | 1049 | int mask = (kcontrol->private_value >> 16) & 0xff; |
1050 | 1050 | ||
@@ -1055,9 +1055,9 @@ static int snd_ad1848_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1055 | return 0; | 1055 | return 0; |
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | static int snd_ad1848_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1058 | static int snd_ad1848_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1059 | { | 1059 | { |
1060 | ad1848_t *chip = snd_kcontrol_chip(kcontrol); | 1060 | struct snd_ad1848 *chip = snd_kcontrol_chip(kcontrol); |
1061 | unsigned long flags; | 1061 | unsigned long flags; |
1062 | int reg = kcontrol->private_value & 0xff; | 1062 | int reg = kcontrol->private_value & 0xff; |
1063 | int shift = (kcontrol->private_value >> 8) & 0xff; | 1063 | int shift = (kcontrol->private_value >> 8) & 0xff; |
@@ -1072,9 +1072,9 @@ static int snd_ad1848_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1072 | return 0; | 1072 | return 0; |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | static int snd_ad1848_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1075 | static int snd_ad1848_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1076 | { | 1076 | { |
1077 | ad1848_t *chip = snd_kcontrol_chip(kcontrol); | 1077 | struct snd_ad1848 *chip = snd_kcontrol_chip(kcontrol); |
1078 | unsigned long flags; | 1078 | unsigned long flags; |
1079 | int reg = kcontrol->private_value & 0xff; | 1079 | int reg = kcontrol->private_value & 0xff; |
1080 | int shift = (kcontrol->private_value >> 8) & 0xff; | 1080 | int shift = (kcontrol->private_value >> 8) & 0xff; |
@@ -1095,7 +1095,7 @@ static int snd_ad1848_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1095 | return change; | 1095 | return change; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | static int snd_ad1848_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1098 | static int snd_ad1848_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1099 | { | 1099 | { |
1100 | int mask = (kcontrol->private_value >> 24) & 0xff; | 1100 | int mask = (kcontrol->private_value >> 24) & 0xff; |
1101 | 1101 | ||
@@ -1106,9 +1106,9 @@ static int snd_ad1848_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1106 | return 0; | 1106 | return 0; |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | static int snd_ad1848_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1109 | static int snd_ad1848_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1110 | { | 1110 | { |
1111 | ad1848_t *chip = snd_kcontrol_chip(kcontrol); | 1111 | struct snd_ad1848 *chip = snd_kcontrol_chip(kcontrol); |
1112 | unsigned long flags; | 1112 | unsigned long flags; |
1113 | int left_reg = kcontrol->private_value & 0xff; | 1113 | int left_reg = kcontrol->private_value & 0xff; |
1114 | int right_reg = (kcontrol->private_value >> 8) & 0xff; | 1114 | int right_reg = (kcontrol->private_value >> 8) & 0xff; |
@@ -1128,9 +1128,9 @@ static int snd_ad1848_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1128 | return 0; | 1128 | return 0; |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | static int snd_ad1848_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1131 | static int snd_ad1848_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1132 | { | 1132 | { |
1133 | ad1848_t *chip = snd_kcontrol_chip(kcontrol); | 1133 | struct snd_ad1848 *chip = snd_kcontrol_chip(kcontrol); |
1134 | unsigned long flags; | 1134 | unsigned long flags; |
1135 | int left_reg = kcontrol->private_value & 0xff; | 1135 | int left_reg = kcontrol->private_value & 0xff; |
1136 | int right_reg = (kcontrol->private_value >> 8) & 0xff; | 1136 | int right_reg = (kcontrol->private_value >> 8) & 0xff; |
@@ -1167,9 +1167,9 @@ static int snd_ad1848_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1167 | 1167 | ||
1168 | /* | 1168 | /* |
1169 | */ | 1169 | */ |
1170 | int snd_ad1848_add_ctl(ad1848_t *chip, const char *name, int index, int type, unsigned long value) | 1170 | int snd_ad1848_add_ctl(struct snd_ad1848 *chip, const char *name, int index, int type, unsigned long value) |
1171 | { | 1171 | { |
1172 | static snd_kcontrol_new_t newctls[] = { | 1172 | static struct snd_kcontrol_new newctls[] = { |
1173 | [AD1848_MIX_SINGLE] = { | 1173 | [AD1848_MIX_SINGLE] = { |
1174 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1174 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1175 | .info = snd_ad1848_info_single, | 1175 | .info = snd_ad1848_info_single, |
@@ -1189,7 +1189,7 @@ int snd_ad1848_add_ctl(ad1848_t *chip, const char *name, int index, int type, un | |||
1189 | .put = snd_ad1848_put_mux, | 1189 | .put = snd_ad1848_put_mux, |
1190 | }, | 1190 | }, |
1191 | }; | 1191 | }; |
1192 | snd_kcontrol_t *ctl; | 1192 | struct snd_kcontrol *ctl; |
1193 | int err; | 1193 | int err; |
1194 | 1194 | ||
1195 | ctl = snd_ctl_new1(&newctls[type], chip); | 1195 | ctl = snd_ctl_new1(&newctls[type], chip); |
@@ -1222,10 +1222,10 @@ AD1848_SINGLE("Loopback Capture Switch", 0, AD1848_LOOPBACK, 0, 1, 0), | |||
1222 | AD1848_SINGLE("Loopback Capture Volume", 0, AD1848_LOOPBACK, 1, 63, 0) | 1222 | AD1848_SINGLE("Loopback Capture Volume", 0, AD1848_LOOPBACK, 1, 63, 0) |
1223 | }; | 1223 | }; |
1224 | 1224 | ||
1225 | int snd_ad1848_mixer(ad1848_t *chip) | 1225 | int snd_ad1848_mixer(struct snd_ad1848 *chip) |
1226 | { | 1226 | { |
1227 | snd_card_t *card; | 1227 | struct snd_card *card; |
1228 | snd_pcm_t *pcm; | 1228 | struct snd_pcm *pcm; |
1229 | unsigned int idx; | 1229 | unsigned int idx; |
1230 | int err; | 1230 | int err; |
1231 | 1231 | ||