diff options
Diffstat (limited to 'sound/pci/es1968.c')
-rw-r--r-- | sound/pci/es1968.c | 288 |
1 files changed, 142 insertions, 146 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 50079dc90743..021862d28f2b 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
@@ -470,10 +470,6 @@ static u16 acpi_state_mask[] = { | |||
470 | }; | 470 | }; |
471 | 471 | ||
472 | 472 | ||
473 | typedef struct snd_es1968 es1968_t; | ||
474 | typedef struct snd_esschan esschan_t; | ||
475 | typedef struct snd_esm_memory esm_memory_t; | ||
476 | |||
477 | /* APU use in the driver */ | 473 | /* APU use in the driver */ |
478 | enum snd_enum_apu_type { | 474 | enum snd_enum_apu_type { |
479 | ESM_APU_PCM_PLAY, | 475 | ESM_APU_PCM_PLAY, |
@@ -488,23 +484,23 @@ enum { | |||
488 | }; | 484 | }; |
489 | 485 | ||
490 | /* DMA Hack! */ | 486 | /* DMA Hack! */ |
491 | struct snd_esm_memory { | 487 | struct esm_memory { |
492 | struct snd_dma_buffer buf; | 488 | struct snd_dma_buffer buf; |
493 | int empty; /* status */ | 489 | int empty; /* status */ |
494 | struct list_head list; | 490 | struct list_head list; |
495 | }; | 491 | }; |
496 | 492 | ||
497 | /* Playback Channel */ | 493 | /* Playback Channel */ |
498 | struct snd_esschan { | 494 | struct esschan { |
499 | int running; | 495 | int running; |
500 | 496 | ||
501 | u8 apu[4]; | 497 | u8 apu[4]; |
502 | u8 apu_mode[4]; | 498 | u8 apu_mode[4]; |
503 | 499 | ||
504 | /* playback/capture pcm buffer */ | 500 | /* playback/capture pcm buffer */ |
505 | esm_memory_t *memory; | 501 | struct esm_memory *memory; |
506 | /* capture mixer buffer */ | 502 | /* capture mixer buffer */ |
507 | esm_memory_t *mixbuf; | 503 | struct esm_memory *mixbuf; |
508 | 504 | ||
509 | unsigned int hwptr; /* current hw pointer in bytes */ | 505 | unsigned int hwptr; /* current hw pointer in bytes */ |
510 | unsigned int count; /* sample counter in bytes */ | 506 | unsigned int count; /* sample counter in bytes */ |
@@ -519,7 +515,7 @@ struct snd_esschan { | |||
519 | 515 | ||
520 | int bob_freq; /* required timer frequency */ | 516 | int bob_freq; /* required timer frequency */ |
521 | 517 | ||
522 | snd_pcm_substream_t *substream; | 518 | struct snd_pcm_substream *substream; |
523 | 519 | ||
524 | /* linked list */ | 520 | /* linked list */ |
525 | struct list_head list; | 521 | struct list_head list; |
@@ -529,7 +525,7 @@ struct snd_esschan { | |||
529 | #endif | 525 | #endif |
530 | }; | 526 | }; |
531 | 527 | ||
532 | struct snd_es1968 { | 528 | struct es1968 { |
533 | /* Module Config */ | 529 | /* Module Config */ |
534 | int total_bufsize; /* in bytes */ | 530 | int total_bufsize; /* in bytes */ |
535 | 531 | ||
@@ -550,19 +546,19 @@ struct snd_es1968 { | |||
550 | unsigned long io_port; | 546 | unsigned long io_port; |
551 | int type; | 547 | int type; |
552 | struct pci_dev *pci; | 548 | struct pci_dev *pci; |
553 | snd_card_t *card; | 549 | struct snd_card *card; |
554 | snd_pcm_t *pcm; | 550 | struct snd_pcm *pcm; |
555 | int do_pm; /* power-management enabled */ | 551 | int do_pm; /* power-management enabled */ |
556 | 552 | ||
557 | /* DMA memory block */ | 553 | /* DMA memory block */ |
558 | struct list_head buf_list; | 554 | struct list_head buf_list; |
559 | 555 | ||
560 | /* ALSA Stuff */ | 556 | /* ALSA Stuff */ |
561 | ac97_t *ac97; | 557 | struct snd_ac97 *ac97; |
562 | snd_kcontrol_t *master_switch; /* for h/w volume control */ | 558 | struct snd_kcontrol *master_switch; /* for h/w volume control */ |
563 | snd_kcontrol_t *master_volume; | 559 | struct snd_kcontrol *master_volume; |
564 | 560 | ||
565 | snd_rawmidi_t *rmidi; | 561 | struct snd_rawmidi *rmidi; |
566 | 562 | ||
567 | spinlock_t reg_lock; | 563 | spinlock_t reg_lock; |
568 | spinlock_t ac97_lock; | 564 | spinlock_t ac97_lock; |
@@ -610,14 +606,14 @@ MODULE_DEVICE_TABLE(pci, snd_es1968_ids); | |||
610 | *********************/ | 606 | *********************/ |
611 | 607 | ||
612 | /* no spinlock */ | 608 | /* no spinlock */ |
613 | static void __maestro_write(es1968_t *chip, u16 reg, u16 data) | 609 | static void __maestro_write(struct es1968 *chip, u16 reg, u16 data) |
614 | { | 610 | { |
615 | outw(reg, chip->io_port + ESM_INDEX); | 611 | outw(reg, chip->io_port + ESM_INDEX); |
616 | outw(data, chip->io_port + ESM_DATA); | 612 | outw(data, chip->io_port + ESM_DATA); |
617 | chip->maestro_map[reg] = data; | 613 | chip->maestro_map[reg] = data; |
618 | } | 614 | } |
619 | 615 | ||
620 | static inline void maestro_write(es1968_t *chip, u16 reg, u16 data) | 616 | static inline void maestro_write(struct es1968 *chip, u16 reg, u16 data) |
621 | { | 617 | { |
622 | unsigned long flags; | 618 | unsigned long flags; |
623 | spin_lock_irqsave(&chip->reg_lock, flags); | 619 | spin_lock_irqsave(&chip->reg_lock, flags); |
@@ -626,7 +622,7 @@ static inline void maestro_write(es1968_t *chip, u16 reg, u16 data) | |||
626 | } | 622 | } |
627 | 623 | ||
628 | /* no spinlock */ | 624 | /* no spinlock */ |
629 | static u16 __maestro_read(es1968_t *chip, u16 reg) | 625 | static u16 __maestro_read(struct es1968 *chip, u16 reg) |
630 | { | 626 | { |
631 | if (READABLE_MAP & (1 << reg)) { | 627 | if (READABLE_MAP & (1 << reg)) { |
632 | outw(reg, chip->io_port + ESM_INDEX); | 628 | outw(reg, chip->io_port + ESM_INDEX); |
@@ -635,7 +631,7 @@ static u16 __maestro_read(es1968_t *chip, u16 reg) | |||
635 | return chip->maestro_map[reg]; | 631 | return chip->maestro_map[reg]; |
636 | } | 632 | } |
637 | 633 | ||
638 | static inline u16 maestro_read(es1968_t *chip, u16 reg) | 634 | static inline u16 maestro_read(struct es1968 *chip, u16 reg) |
639 | { | 635 | { |
640 | unsigned long flags; | 636 | unsigned long flags; |
641 | u16 result; | 637 | u16 result; |
@@ -646,7 +642,7 @@ static inline u16 maestro_read(es1968_t *chip, u16 reg) | |||
646 | } | 642 | } |
647 | 643 | ||
648 | /* Wait for the codec bus to be free */ | 644 | /* Wait for the codec bus to be free */ |
649 | static int snd_es1968_ac97_wait(es1968_t *chip) | 645 | static int snd_es1968_ac97_wait(struct es1968 *chip) |
650 | { | 646 | { |
651 | int timeout = 100000; | 647 | int timeout = 100000; |
652 | 648 | ||
@@ -659,9 +655,9 @@ static int snd_es1968_ac97_wait(es1968_t *chip) | |||
659 | return 1; /* timeout */ | 655 | return 1; /* timeout */ |
660 | } | 656 | } |
661 | 657 | ||
662 | static void snd_es1968_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val) | 658 | static void snd_es1968_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) |
663 | { | 659 | { |
664 | es1968_t *chip = ac97->private_data; | 660 | struct es1968 *chip = ac97->private_data; |
665 | unsigned long flags; | 661 | unsigned long flags; |
666 | 662 | ||
667 | snd_es1968_ac97_wait(chip); | 663 | snd_es1968_ac97_wait(chip); |
@@ -675,10 +671,10 @@ static void snd_es1968_ac97_write(ac97_t *ac97, unsigned short reg, unsigned sho | |||
675 | spin_unlock_irqrestore(&chip->ac97_lock, flags); | 671 | spin_unlock_irqrestore(&chip->ac97_lock, flags); |
676 | } | 672 | } |
677 | 673 | ||
678 | static unsigned short snd_es1968_ac97_read(ac97_t *ac97, unsigned short reg) | 674 | static unsigned short snd_es1968_ac97_read(struct snd_ac97 *ac97, unsigned short reg) |
679 | { | 675 | { |
680 | u16 data = 0; | 676 | u16 data = 0; |
681 | es1968_t *chip = ac97->private_data; | 677 | struct es1968 *chip = ac97->private_data; |
682 | unsigned long flags; | 678 | unsigned long flags; |
683 | 679 | ||
684 | snd_es1968_ac97_wait(chip); | 680 | snd_es1968_ac97_wait(chip); |
@@ -697,7 +693,7 @@ static unsigned short snd_es1968_ac97_read(ac97_t *ac97, unsigned short reg) | |||
697 | } | 693 | } |
698 | 694 | ||
699 | /* no spinlock */ | 695 | /* no spinlock */ |
700 | static void apu_index_set(es1968_t *chip, u16 index) | 696 | static void apu_index_set(struct es1968 *chip, u16 index) |
701 | { | 697 | { |
702 | int i; | 698 | int i; |
703 | __maestro_write(chip, IDR1_CRAM_POINTER, index); | 699 | __maestro_write(chip, IDR1_CRAM_POINTER, index); |
@@ -708,7 +704,7 @@ static void apu_index_set(es1968_t *chip, u16 index) | |||
708 | } | 704 | } |
709 | 705 | ||
710 | /* no spinlock */ | 706 | /* no spinlock */ |
711 | static void apu_data_set(es1968_t *chip, u16 data) | 707 | static void apu_data_set(struct es1968 *chip, u16 data) |
712 | { | 708 | { |
713 | int i; | 709 | int i; |
714 | for (i = 0; i < 1000; i++) { | 710 | for (i = 0; i < 1000; i++) { |
@@ -720,7 +716,7 @@ static void apu_data_set(es1968_t *chip, u16 data) | |||
720 | } | 716 | } |
721 | 717 | ||
722 | /* no spinlock */ | 718 | /* no spinlock */ |
723 | static void __apu_set_register(es1968_t *chip, u16 channel, u8 reg, u16 data) | 719 | static void __apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data) |
724 | { | 720 | { |
725 | snd_assert(channel < NR_APUS, return); | 721 | snd_assert(channel < NR_APUS, return); |
726 | #ifdef CONFIG_PM | 722 | #ifdef CONFIG_PM |
@@ -731,7 +727,7 @@ static void __apu_set_register(es1968_t *chip, u16 channel, u8 reg, u16 data) | |||
731 | apu_data_set(chip, data); | 727 | apu_data_set(chip, data); |
732 | } | 728 | } |
733 | 729 | ||
734 | static inline void apu_set_register(es1968_t *chip, u16 channel, u8 reg, u16 data) | 730 | static inline void apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data) |
735 | { | 731 | { |
736 | unsigned long flags; | 732 | unsigned long flags; |
737 | spin_lock_irqsave(&chip->reg_lock, flags); | 733 | spin_lock_irqsave(&chip->reg_lock, flags); |
@@ -739,7 +735,7 @@ static inline void apu_set_register(es1968_t *chip, u16 channel, u8 reg, u16 dat | |||
739 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 735 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
740 | } | 736 | } |
741 | 737 | ||
742 | static u16 __apu_get_register(es1968_t *chip, u16 channel, u8 reg) | 738 | static u16 __apu_get_register(struct es1968 *chip, u16 channel, u8 reg) |
743 | { | 739 | { |
744 | snd_assert(channel < NR_APUS, return 0); | 740 | snd_assert(channel < NR_APUS, return 0); |
745 | reg |= (channel << 4); | 741 | reg |= (channel << 4); |
@@ -747,7 +743,7 @@ static u16 __apu_get_register(es1968_t *chip, u16 channel, u8 reg) | |||
747 | return __maestro_read(chip, IDR0_DATA_PORT); | 743 | return __maestro_read(chip, IDR0_DATA_PORT); |
748 | } | 744 | } |
749 | 745 | ||
750 | static inline u16 apu_get_register(es1968_t *chip, u16 channel, u8 reg) | 746 | static inline u16 apu_get_register(struct es1968 *chip, u16 channel, u8 reg) |
751 | { | 747 | { |
752 | unsigned long flags; | 748 | unsigned long flags; |
753 | u16 v; | 749 | u16 v; |
@@ -759,7 +755,7 @@ static inline u16 apu_get_register(es1968_t *chip, u16 channel, u8 reg) | |||
759 | 755 | ||
760 | #if 0 /* ASSP is not supported */ | 756 | #if 0 /* ASSP is not supported */ |
761 | 757 | ||
762 | static void assp_set_register(es1968_t *chip, u32 reg, u32 value) | 758 | static void assp_set_register(struct es1968 *chip, u32 reg, u32 value) |
763 | { | 759 | { |
764 | unsigned long flags; | 760 | unsigned long flags; |
765 | 761 | ||
@@ -769,7 +765,7 @@ static void assp_set_register(es1968_t *chip, u32 reg, u32 value) | |||
769 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 765 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
770 | } | 766 | } |
771 | 767 | ||
772 | static u32 assp_get_register(es1968_t *chip, u32 reg) | 768 | static u32 assp_get_register(struct es1968 *chip, u32 reg) |
773 | { | 769 | { |
774 | unsigned long flags; | 770 | unsigned long flags; |
775 | u32 value; | 771 | u32 value; |
@@ -784,7 +780,7 @@ static u32 assp_get_register(es1968_t *chip, u32 reg) | |||
784 | 780 | ||
785 | #endif | 781 | #endif |
786 | 782 | ||
787 | static void wave_set_register(es1968_t *chip, u16 reg, u16 value) | 783 | static void wave_set_register(struct es1968 *chip, u16 reg, u16 value) |
788 | { | 784 | { |
789 | unsigned long flags; | 785 | unsigned long flags; |
790 | 786 | ||
@@ -794,7 +790,7 @@ static void wave_set_register(es1968_t *chip, u16 reg, u16 value) | |||
794 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 790 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
795 | } | 791 | } |
796 | 792 | ||
797 | static u16 wave_get_register(es1968_t *chip, u16 reg) | 793 | static u16 wave_get_register(struct es1968 *chip, u16 reg) |
798 | { | 794 | { |
799 | unsigned long flags; | 795 | unsigned long flags; |
800 | u16 value; | 796 | u16 value; |
@@ -811,7 +807,7 @@ static u16 wave_get_register(es1968_t *chip, u16 reg) | |||
811 | * Bob the Timer! * | 807 | * Bob the Timer! * |
812 | *******************/ | 808 | *******************/ |
813 | 809 | ||
814 | static void snd_es1968_bob_stop(es1968_t *chip) | 810 | static void snd_es1968_bob_stop(struct es1968 *chip) |
815 | { | 811 | { |
816 | u16 reg; | 812 | u16 reg; |
817 | 813 | ||
@@ -823,7 +819,7 @@ static void snd_es1968_bob_stop(es1968_t *chip) | |||
823 | __maestro_write(chip, 0x17, reg); | 819 | __maestro_write(chip, 0x17, reg); |
824 | } | 820 | } |
825 | 821 | ||
826 | static void snd_es1968_bob_start(es1968_t *chip) | 822 | static void snd_es1968_bob_start(struct es1968 *chip) |
827 | { | 823 | { |
828 | int prescale; | 824 | int prescale; |
829 | int divide; | 825 | int divide; |
@@ -863,7 +859,7 @@ static void snd_es1968_bob_start(es1968_t *chip) | |||
863 | } | 859 | } |
864 | 860 | ||
865 | /* call with substream spinlock */ | 861 | /* call with substream spinlock */ |
866 | static void snd_es1968_bob_inc(es1968_t *chip, int freq) | 862 | static void snd_es1968_bob_inc(struct es1968 *chip, int freq) |
867 | { | 863 | { |
868 | chip->bobclient++; | 864 | chip->bobclient++; |
869 | if (chip->bobclient == 1) { | 865 | if (chip->bobclient == 1) { |
@@ -877,7 +873,7 @@ static void snd_es1968_bob_inc(es1968_t *chip, int freq) | |||
877 | } | 873 | } |
878 | 874 | ||
879 | /* call with substream spinlock */ | 875 | /* call with substream spinlock */ |
880 | static void snd_es1968_bob_dec(es1968_t *chip) | 876 | static void snd_es1968_bob_dec(struct es1968 *chip) |
881 | { | 877 | { |
882 | chip->bobclient--; | 878 | chip->bobclient--; |
883 | if (chip->bobclient <= 0) | 879 | if (chip->bobclient <= 0) |
@@ -887,7 +883,7 @@ static void snd_es1968_bob_dec(es1968_t *chip) | |||
887 | struct list_head *p; | 883 | struct list_head *p; |
888 | int max_freq = ESM_BOB_FREQ; | 884 | int max_freq = ESM_BOB_FREQ; |
889 | list_for_each(p, &chip->substream_list) { | 885 | list_for_each(p, &chip->substream_list) { |
890 | esschan_t *es = list_entry(p, esschan_t, list); | 886 | struct esschan *es = list_entry(p, struct esschan, list); |
891 | if (max_freq < es->bob_freq) | 887 | if (max_freq < es->bob_freq) |
892 | max_freq = es->bob_freq; | 888 | max_freq = es->bob_freq; |
893 | } | 889 | } |
@@ -900,8 +896,8 @@ static void snd_es1968_bob_dec(es1968_t *chip) | |||
900 | } | 896 | } |
901 | 897 | ||
902 | static int | 898 | static int |
903 | snd_es1968_calc_bob_rate(es1968_t *chip, esschan_t *es, | 899 | snd_es1968_calc_bob_rate(struct es1968 *chip, struct esschan *es, |
904 | snd_pcm_runtime_t *runtime) | 900 | struct snd_pcm_runtime *runtime) |
905 | { | 901 | { |
906 | /* we acquire 4 interrupts per period for precise control.. */ | 902 | /* we acquire 4 interrupts per period for precise control.. */ |
907 | int freq = runtime->rate * 4; | 903 | int freq = runtime->rate * 4; |
@@ -922,7 +918,7 @@ snd_es1968_calc_bob_rate(es1968_t *chip, esschan_t *es, | |||
922 | * PCM Part * | 918 | * PCM Part * |
923 | *************/ | 919 | *************/ |
924 | 920 | ||
925 | static u32 snd_es1968_compute_rate(es1968_t *chip, u32 freq) | 921 | static u32 snd_es1968_compute_rate(struct es1968 *chip, u32 freq) |
926 | { | 922 | { |
927 | u32 rate = (freq << 16) / chip->clock; | 923 | u32 rate = (freq << 16) / chip->clock; |
928 | #if 0 /* XXX: do we need this? */ | 924 | #if 0 /* XXX: do we need this? */ |
@@ -934,7 +930,7 @@ static u32 snd_es1968_compute_rate(es1968_t *chip, u32 freq) | |||
934 | 930 | ||
935 | /* get current pointer */ | 931 | /* get current pointer */ |
936 | static inline unsigned int | 932 | static inline unsigned int |
937 | snd_es1968_get_dma_ptr(es1968_t *chip, esschan_t *es) | 933 | snd_es1968_get_dma_ptr(struct es1968 *chip, struct esschan *es) |
938 | { | 934 | { |
939 | unsigned int offset; | 935 | unsigned int offset; |
940 | 936 | ||
@@ -945,7 +941,7 @@ snd_es1968_get_dma_ptr(es1968_t *chip, esschan_t *es) | |||
945 | return (offset & 0xFFFE); /* hardware is in words */ | 941 | return (offset & 0xFFFE); /* hardware is in words */ |
946 | } | 942 | } |
947 | 943 | ||
948 | static void snd_es1968_apu_set_freq(es1968_t *chip, int apu, int freq) | 944 | static void snd_es1968_apu_set_freq(struct es1968 *chip, int apu, int freq) |
949 | { | 945 | { |
950 | apu_set_register(chip, apu, 2, | 946 | apu_set_register(chip, apu, 2, |
951 | (apu_get_register(chip, apu, 2) & 0x00FF) | | 947 | (apu_get_register(chip, apu, 2) & 0x00FF) | |
@@ -954,7 +950,7 @@ static void snd_es1968_apu_set_freq(es1968_t *chip, int apu, int freq) | |||
954 | } | 950 | } |
955 | 951 | ||
956 | /* spin lock held */ | 952 | /* spin lock held */ |
957 | static inline void snd_es1968_trigger_apu(es1968_t *esm, int apu, int mode) | 953 | static inline void snd_es1968_trigger_apu(struct es1968 *esm, int apu, int mode) |
958 | { | 954 | { |
959 | /* set the APU mode */ | 955 | /* set the APU mode */ |
960 | __apu_set_register(esm, apu, 0, | 956 | __apu_set_register(esm, apu, 0, |
@@ -962,7 +958,7 @@ static inline void snd_es1968_trigger_apu(es1968_t *esm, int apu, int mode) | |||
962 | (mode << 4)); | 958 | (mode << 4)); |
963 | } | 959 | } |
964 | 960 | ||
965 | static void snd_es1968_pcm_start(es1968_t *chip, esschan_t *es) | 961 | static void snd_es1968_pcm_start(struct es1968 *chip, struct esschan *es) |
966 | { | 962 | { |
967 | spin_lock(&chip->reg_lock); | 963 | spin_lock(&chip->reg_lock); |
968 | __apu_set_register(chip, es->apu[0], 5, es->base[0]); | 964 | __apu_set_register(chip, es->apu[0], 5, es->base[0]); |
@@ -982,7 +978,7 @@ static void snd_es1968_pcm_start(es1968_t *chip, esschan_t *es) | |||
982 | spin_unlock(&chip->reg_lock); | 978 | spin_unlock(&chip->reg_lock); |
983 | } | 979 | } |
984 | 980 | ||
985 | static void snd_es1968_pcm_stop(es1968_t *chip, esschan_t *es) | 981 | static void snd_es1968_pcm_stop(struct es1968 *chip, struct esschan *es) |
986 | { | 982 | { |
987 | spin_lock(&chip->reg_lock); | 983 | spin_lock(&chip->reg_lock); |
988 | snd_es1968_trigger_apu(chip, es->apu[0], 0); | 984 | snd_es1968_trigger_apu(chip, es->apu[0], 0); |
@@ -995,7 +991,7 @@ static void snd_es1968_pcm_stop(es1968_t *chip, esschan_t *es) | |||
995 | } | 991 | } |
996 | 992 | ||
997 | /* set the wavecache control reg */ | 993 | /* set the wavecache control reg */ |
998 | static void snd_es1968_program_wavecache(es1968_t *chip, esschan_t *es, | 994 | static void snd_es1968_program_wavecache(struct es1968 *chip, struct esschan *es, |
999 | int channel, u32 addr, int capture) | 995 | int channel, u32 addr, int capture) |
1000 | { | 996 | { |
1001 | u32 tmpval = (addr - 0x10) & 0xFFF8; | 997 | u32 tmpval = (addr - 0x10) & 0xFFF8; |
@@ -1016,8 +1012,8 @@ static void snd_es1968_program_wavecache(es1968_t *chip, esschan_t *es, | |||
1016 | } | 1012 | } |
1017 | 1013 | ||
1018 | 1014 | ||
1019 | static void snd_es1968_playback_setup(es1968_t *chip, esschan_t *es, | 1015 | static void snd_es1968_playback_setup(struct es1968 *chip, struct esschan *es, |
1020 | snd_pcm_runtime_t *runtime) | 1016 | struct snd_pcm_runtime *runtime) |
1021 | { | 1017 | { |
1022 | u32 pa; | 1018 | u32 pa; |
1023 | int high_apu = 0; | 1019 | int high_apu = 0; |
@@ -1119,7 +1115,7 @@ static void snd_es1968_playback_setup(es1968_t *chip, esschan_t *es, | |||
1119 | } | 1115 | } |
1120 | 1116 | ||
1121 | 1117 | ||
1122 | static void init_capture_apu(es1968_t *chip, esschan_t *es, int channel, | 1118 | static void init_capture_apu(struct es1968 *chip, struct esschan *es, int channel, |
1123 | unsigned int pa, unsigned int bsize, | 1119 | unsigned int pa, unsigned int bsize, |
1124 | int mode, int route) | 1120 | int mode, int route) |
1125 | { | 1121 | { |
@@ -1164,8 +1160,8 @@ static void init_capture_apu(es1968_t *chip, esschan_t *es, int channel, | |||
1164 | apu_set_register(chip, apu, 0, 0x400F); | 1160 | apu_set_register(chip, apu, 0, 0x400F); |
1165 | } | 1161 | } |
1166 | 1162 | ||
1167 | static void snd_es1968_capture_setup(es1968_t *chip, esschan_t *es, | 1163 | static void snd_es1968_capture_setup(struct es1968 *chip, struct esschan *es, |
1168 | snd_pcm_runtime_t *runtime) | 1164 | struct snd_pcm_runtime *runtime) |
1169 | { | 1165 | { |
1170 | int size; | 1166 | int size; |
1171 | u32 freq; | 1167 | u32 freq; |
@@ -1233,11 +1229,11 @@ static void snd_es1968_capture_setup(es1968_t *chip, esschan_t *es, | |||
1233 | * ALSA Interface * | 1229 | * ALSA Interface * |
1234 | *******************/ | 1230 | *******************/ |
1235 | 1231 | ||
1236 | static int snd_es1968_pcm_prepare(snd_pcm_substream_t *substream) | 1232 | static int snd_es1968_pcm_prepare(struct snd_pcm_substream *substream) |
1237 | { | 1233 | { |
1238 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1234 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1239 | snd_pcm_runtime_t *runtime = substream->runtime; | 1235 | struct snd_pcm_runtime *runtime = substream->runtime; |
1240 | esschan_t *es = runtime->private_data; | 1236 | struct esschan *es = runtime->private_data; |
1241 | 1237 | ||
1242 | es->dma_size = snd_pcm_lib_buffer_bytes(substream); | 1238 | es->dma_size = snd_pcm_lib_buffer_bytes(substream); |
1243 | es->frag_size = snd_pcm_lib_period_bytes(substream); | 1239 | es->frag_size = snd_pcm_lib_period_bytes(substream); |
@@ -1265,10 +1261,10 @@ static int snd_es1968_pcm_prepare(snd_pcm_substream_t *substream) | |||
1265 | return 0; | 1261 | return 0; |
1266 | } | 1262 | } |
1267 | 1263 | ||
1268 | static int snd_es1968_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | 1264 | static int snd_es1968_pcm_trigger(struct snd_pcm_substream *substream, int cmd) |
1269 | { | 1265 | { |
1270 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1266 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1271 | esschan_t *es = substream->runtime->private_data; | 1267 | struct esschan *es = substream->runtime->private_data; |
1272 | 1268 | ||
1273 | spin_lock(&chip->substream_lock); | 1269 | spin_lock(&chip->substream_lock); |
1274 | switch (cmd) { | 1270 | switch (cmd) { |
@@ -1295,10 +1291,10 @@ static int snd_es1968_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | |||
1295 | return 0; | 1291 | return 0; |
1296 | } | 1292 | } |
1297 | 1293 | ||
1298 | static snd_pcm_uframes_t snd_es1968_pcm_pointer(snd_pcm_substream_t *substream) | 1294 | static snd_pcm_uframes_t snd_es1968_pcm_pointer(struct snd_pcm_substream *substream) |
1299 | { | 1295 | { |
1300 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1296 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1301 | esschan_t *es = substream->runtime->private_data; | 1297 | struct esschan *es = substream->runtime->private_data; |
1302 | unsigned int ptr; | 1298 | unsigned int ptr; |
1303 | 1299 | ||
1304 | ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; | 1300 | ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; |
@@ -1306,7 +1302,7 @@ static snd_pcm_uframes_t snd_es1968_pcm_pointer(snd_pcm_substream_t *substream) | |||
1306 | return bytes_to_frames(substream->runtime, ptr % es->dma_size); | 1302 | return bytes_to_frames(substream->runtime, ptr % es->dma_size); |
1307 | } | 1303 | } |
1308 | 1304 | ||
1309 | static snd_pcm_hardware_t snd_es1968_playback = { | 1305 | static struct snd_pcm_hardware snd_es1968_playback = { |
1310 | .info = (SNDRV_PCM_INFO_MMAP | | 1306 | .info = (SNDRV_PCM_INFO_MMAP | |
1311 | SNDRV_PCM_INFO_MMAP_VALID | | 1307 | SNDRV_PCM_INFO_MMAP_VALID | |
1312 | SNDRV_PCM_INFO_INTERLEAVED | | 1308 | SNDRV_PCM_INFO_INTERLEAVED | |
@@ -1327,7 +1323,7 @@ static snd_pcm_hardware_t snd_es1968_playback = { | |||
1327 | .fifo_size = 0, | 1323 | .fifo_size = 0, |
1328 | }; | 1324 | }; |
1329 | 1325 | ||
1330 | static snd_pcm_hardware_t snd_es1968_capture = { | 1326 | static struct snd_pcm_hardware snd_es1968_capture = { |
1331 | .info = (SNDRV_PCM_INFO_NONINTERLEAVED | | 1327 | .info = (SNDRV_PCM_INFO_NONINTERLEAVED | |
1332 | SNDRV_PCM_INFO_MMAP | | 1328 | SNDRV_PCM_INFO_MMAP | |
1333 | SNDRV_PCM_INFO_MMAP_VALID | | 1329 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -1355,14 +1351,14 @@ static snd_pcm_hardware_t snd_es1968_capture = { | |||
1355 | /* Because the Maestro can only take addresses relative to the PCM base address | 1351 | /* Because the Maestro can only take addresses relative to the PCM base address |
1356 | register :( */ | 1352 | register :( */ |
1357 | 1353 | ||
1358 | static int calc_available_memory_size(es1968_t *chip) | 1354 | static int calc_available_memory_size(struct es1968 *chip) |
1359 | { | 1355 | { |
1360 | struct list_head *p; | 1356 | struct list_head *p; |
1361 | int max_size = 0; | 1357 | int max_size = 0; |
1362 | 1358 | ||
1363 | down(&chip->memory_mutex); | 1359 | down(&chip->memory_mutex); |
1364 | list_for_each(p, &chip->buf_list) { | 1360 | list_for_each(p, &chip->buf_list) { |
1365 | esm_memory_t *buf = list_entry(p, esm_memory_t, list); | 1361 | struct esm_memory *buf = list_entry(p, struct esm_memory, list); |
1366 | if (buf->empty && buf->buf.bytes > max_size) | 1362 | if (buf->empty && buf->buf.bytes > max_size) |
1367 | max_size = buf->buf.bytes; | 1363 | max_size = buf->buf.bytes; |
1368 | } | 1364 | } |
@@ -1373,15 +1369,15 @@ static int calc_available_memory_size(es1968_t *chip) | |||
1373 | } | 1369 | } |
1374 | 1370 | ||
1375 | /* allocate a new memory chunk with the specified size */ | 1371 | /* allocate a new memory chunk with the specified size */ |
1376 | static esm_memory_t *snd_es1968_new_memory(es1968_t *chip, int size) | 1372 | static struct esm_memory *snd_es1968_new_memory(struct es1968 *chip, int size) |
1377 | { | 1373 | { |
1378 | esm_memory_t *buf; | 1374 | struct esm_memory *buf; |
1379 | struct list_head *p; | 1375 | struct list_head *p; |
1380 | 1376 | ||
1381 | size = ((size + ESM_MEM_ALIGN - 1) / ESM_MEM_ALIGN) * ESM_MEM_ALIGN; | 1377 | size = ((size + ESM_MEM_ALIGN - 1) / ESM_MEM_ALIGN) * ESM_MEM_ALIGN; |
1382 | down(&chip->memory_mutex); | 1378 | down(&chip->memory_mutex); |
1383 | list_for_each(p, &chip->buf_list) { | 1379 | list_for_each(p, &chip->buf_list) { |
1384 | buf = list_entry(p, esm_memory_t, list); | 1380 | buf = list_entry(p, struct esm_memory, list); |
1385 | if (buf->empty && buf->buf.bytes >= size) | 1381 | if (buf->empty && buf->buf.bytes >= size) |
1386 | goto __found; | 1382 | goto __found; |
1387 | } | 1383 | } |
@@ -1390,7 +1386,7 @@ static esm_memory_t *snd_es1968_new_memory(es1968_t *chip, int size) | |||
1390 | 1386 | ||
1391 | __found: | 1387 | __found: |
1392 | if (buf->buf.bytes > size) { | 1388 | if (buf->buf.bytes > size) { |
1393 | esm_memory_t *chunk = kmalloc(sizeof(*chunk), GFP_KERNEL); | 1389 | struct esm_memory *chunk = kmalloc(sizeof(*chunk), GFP_KERNEL); |
1394 | if (chunk == NULL) { | 1390 | if (chunk == NULL) { |
1395 | up(&chip->memory_mutex); | 1391 | up(&chip->memory_mutex); |
1396 | return NULL; | 1392 | return NULL; |
@@ -1409,14 +1405,14 @@ __found: | |||
1409 | } | 1405 | } |
1410 | 1406 | ||
1411 | /* free a memory chunk */ | 1407 | /* free a memory chunk */ |
1412 | static void snd_es1968_free_memory(es1968_t *chip, esm_memory_t *buf) | 1408 | static void snd_es1968_free_memory(struct es1968 *chip, struct esm_memory *buf) |
1413 | { | 1409 | { |
1414 | esm_memory_t *chunk; | 1410 | struct esm_memory *chunk; |
1415 | 1411 | ||
1416 | down(&chip->memory_mutex); | 1412 | down(&chip->memory_mutex); |
1417 | buf->empty = 1; | 1413 | buf->empty = 1; |
1418 | if (buf->list.prev != &chip->buf_list) { | 1414 | if (buf->list.prev != &chip->buf_list) { |
1419 | chunk = list_entry(buf->list.prev, esm_memory_t, list); | 1415 | chunk = list_entry(buf->list.prev, struct esm_memory, list); |
1420 | if (chunk->empty) { | 1416 | if (chunk->empty) { |
1421 | chunk->buf.bytes += buf->buf.bytes; | 1417 | chunk->buf.bytes += buf->buf.bytes; |
1422 | list_del(&buf->list); | 1418 | list_del(&buf->list); |
@@ -1425,7 +1421,7 @@ static void snd_es1968_free_memory(es1968_t *chip, esm_memory_t *buf) | |||
1425 | } | 1421 | } |
1426 | } | 1422 | } |
1427 | if (buf->list.next != &chip->buf_list) { | 1423 | if (buf->list.next != &chip->buf_list) { |
1428 | chunk = list_entry(buf->list.next, esm_memory_t, list); | 1424 | chunk = list_entry(buf->list.next, struct esm_memory, list); |
1429 | if (chunk->empty) { | 1425 | if (chunk->empty) { |
1430 | buf->buf.bytes += chunk->buf.bytes; | 1426 | buf->buf.bytes += chunk->buf.bytes; |
1431 | list_del(&chunk->list); | 1427 | list_del(&chunk->list); |
@@ -1435,7 +1431,7 @@ static void snd_es1968_free_memory(es1968_t *chip, esm_memory_t *buf) | |||
1435 | up(&chip->memory_mutex); | 1431 | up(&chip->memory_mutex); |
1436 | } | 1432 | } |
1437 | 1433 | ||
1438 | static void snd_es1968_free_dmabuf(es1968_t *chip) | 1434 | static void snd_es1968_free_dmabuf(struct es1968 *chip) |
1439 | { | 1435 | { |
1440 | struct list_head *p; | 1436 | struct list_head *p; |
1441 | 1437 | ||
@@ -1443,17 +1439,17 @@ static void snd_es1968_free_dmabuf(es1968_t *chip) | |||
1443 | return; | 1439 | return; |
1444 | snd_dma_reserve_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci)); | 1440 | snd_dma_reserve_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci)); |
1445 | while ((p = chip->buf_list.next) != &chip->buf_list) { | 1441 | while ((p = chip->buf_list.next) != &chip->buf_list) { |
1446 | esm_memory_t *chunk = list_entry(p, esm_memory_t, list); | 1442 | struct esm_memory *chunk = list_entry(p, struct esm_memory, list); |
1447 | list_del(p); | 1443 | list_del(p); |
1448 | kfree(chunk); | 1444 | kfree(chunk); |
1449 | } | 1445 | } |
1450 | } | 1446 | } |
1451 | 1447 | ||
1452 | static int __devinit | 1448 | static int __devinit |
1453 | snd_es1968_init_dmabuf(es1968_t *chip) | 1449 | snd_es1968_init_dmabuf(struct es1968 *chip) |
1454 | { | 1450 | { |
1455 | int err; | 1451 | int err; |
1456 | esm_memory_t *chunk; | 1452 | struct esm_memory *chunk; |
1457 | 1453 | ||
1458 | chip->dma.dev.type = SNDRV_DMA_TYPE_DEV; | 1454 | chip->dma.dev.type = SNDRV_DMA_TYPE_DEV; |
1459 | chip->dma.dev.dev = snd_dma_pci_data(chip->pci); | 1455 | chip->dma.dev.dev = snd_dma_pci_data(chip->pci); |
@@ -1493,12 +1489,12 @@ snd_es1968_init_dmabuf(es1968_t *chip) | |||
1493 | 1489 | ||
1494 | /* setup the dma_areas */ | 1490 | /* setup the dma_areas */ |
1495 | /* buffer is extracted from the pre-allocated memory chunk */ | 1491 | /* buffer is extracted from the pre-allocated memory chunk */ |
1496 | static int snd_es1968_hw_params(snd_pcm_substream_t *substream, | 1492 | static int snd_es1968_hw_params(struct snd_pcm_substream *substream, |
1497 | snd_pcm_hw_params_t *hw_params) | 1493 | struct snd_pcm_hw_params *hw_params) |
1498 | { | 1494 | { |
1499 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1495 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1500 | snd_pcm_runtime_t *runtime = substream->runtime; | 1496 | struct snd_pcm_runtime *runtime = substream->runtime; |
1501 | esschan_t *chan = runtime->private_data; | 1497 | struct esschan *chan = runtime->private_data; |
1502 | int size = params_buffer_bytes(hw_params); | 1498 | int size = params_buffer_bytes(hw_params); |
1503 | 1499 | ||
1504 | if (chan->memory) { | 1500 | if (chan->memory) { |
@@ -1518,11 +1514,11 @@ static int snd_es1968_hw_params(snd_pcm_substream_t *substream, | |||
1518 | } | 1514 | } |
1519 | 1515 | ||
1520 | /* remove dma areas if allocated */ | 1516 | /* remove dma areas if allocated */ |
1521 | static int snd_es1968_hw_free(snd_pcm_substream_t * substream) | 1517 | static int snd_es1968_hw_free(struct snd_pcm_substream *substream) |
1522 | { | 1518 | { |
1523 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1519 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1524 | snd_pcm_runtime_t *runtime = substream->runtime; | 1520 | struct snd_pcm_runtime *runtime = substream->runtime; |
1525 | esschan_t *chan; | 1521 | struct esschan *chan; |
1526 | 1522 | ||
1527 | if (runtime->private_data == NULL) | 1523 | if (runtime->private_data == NULL) |
1528 | return 0; | 1524 | return 0; |
@@ -1538,7 +1534,7 @@ static int snd_es1968_hw_free(snd_pcm_substream_t * substream) | |||
1538 | /* | 1534 | /* |
1539 | * allocate APU pair | 1535 | * allocate APU pair |
1540 | */ | 1536 | */ |
1541 | static int snd_es1968_alloc_apu_pair(es1968_t *chip, int type) | 1537 | static int snd_es1968_alloc_apu_pair(struct es1968 *chip, int type) |
1542 | { | 1538 | { |
1543 | int apu; | 1539 | int apu; |
1544 | 1540 | ||
@@ -1555,7 +1551,7 @@ static int snd_es1968_alloc_apu_pair(es1968_t *chip, int type) | |||
1555 | /* | 1551 | /* |
1556 | * release APU pair | 1552 | * release APU pair |
1557 | */ | 1553 | */ |
1558 | static void snd_es1968_free_apu_pair(es1968_t *chip, int apu) | 1554 | static void snd_es1968_free_apu_pair(struct es1968 *chip, int apu) |
1559 | { | 1555 | { |
1560 | chip->apu[apu] = chip->apu[apu + 1] = ESM_APU_FREE; | 1556 | chip->apu[apu] = chip->apu[apu + 1] = ESM_APU_FREE; |
1561 | } | 1557 | } |
@@ -1565,11 +1561,11 @@ static void snd_es1968_free_apu_pair(es1968_t *chip, int apu) | |||
1565 | * PCM open/close * | 1561 | * PCM open/close * |
1566 | ******************/ | 1562 | ******************/ |
1567 | 1563 | ||
1568 | static int snd_es1968_playback_open(snd_pcm_substream_t *substream) | 1564 | static int snd_es1968_playback_open(struct snd_pcm_substream *substream) |
1569 | { | 1565 | { |
1570 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1566 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1571 | snd_pcm_runtime_t *runtime = substream->runtime; | 1567 | struct snd_pcm_runtime *runtime = substream->runtime; |
1572 | esschan_t *es; | 1568 | struct esschan *es; |
1573 | int apu1; | 1569 | int apu1; |
1574 | 1570 | ||
1575 | /* search 2 APUs */ | 1571 | /* search 2 APUs */ |
@@ -1606,11 +1602,11 @@ static int snd_es1968_playback_open(snd_pcm_substream_t *substream) | |||
1606 | return 0; | 1602 | return 0; |
1607 | } | 1603 | } |
1608 | 1604 | ||
1609 | static int snd_es1968_capture_open(snd_pcm_substream_t *substream) | 1605 | static int snd_es1968_capture_open(struct snd_pcm_substream *substream) |
1610 | { | 1606 | { |
1611 | snd_pcm_runtime_t *runtime = substream->runtime; | 1607 | struct snd_pcm_runtime *runtime = substream->runtime; |
1612 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1608 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1613 | esschan_t *es; | 1609 | struct esschan *es; |
1614 | int apu1, apu2; | 1610 | int apu1, apu2; |
1615 | 1611 | ||
1616 | apu1 = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_CAPTURE); | 1612 | apu1 = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_CAPTURE); |
@@ -1665,10 +1661,10 @@ static int snd_es1968_capture_open(snd_pcm_substream_t *substream) | |||
1665 | return 0; | 1661 | return 0; |
1666 | } | 1662 | } |
1667 | 1663 | ||
1668 | static int snd_es1968_playback_close(snd_pcm_substream_t * substream) | 1664 | static int snd_es1968_playback_close(struct snd_pcm_substream *substream) |
1669 | { | 1665 | { |
1670 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1666 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1671 | esschan_t *es; | 1667 | struct esschan *es; |
1672 | 1668 | ||
1673 | if (substream->runtime->private_data == NULL) | 1669 | if (substream->runtime->private_data == NULL) |
1674 | return 0; | 1670 | return 0; |
@@ -1682,10 +1678,10 @@ static int snd_es1968_playback_close(snd_pcm_substream_t * substream) | |||
1682 | return 0; | 1678 | return 0; |
1683 | } | 1679 | } |
1684 | 1680 | ||
1685 | static int snd_es1968_capture_close(snd_pcm_substream_t * substream) | 1681 | static int snd_es1968_capture_close(struct snd_pcm_substream *substream) |
1686 | { | 1682 | { |
1687 | es1968_t *chip = snd_pcm_substream_chip(substream); | 1683 | struct es1968 *chip = snd_pcm_substream_chip(substream); |
1688 | esschan_t *es; | 1684 | struct esschan *es; |
1689 | 1685 | ||
1690 | if (substream->runtime->private_data == NULL) | 1686 | if (substream->runtime->private_data == NULL) |
1691 | return 0; | 1687 | return 0; |
@@ -1701,7 +1697,7 @@ static int snd_es1968_capture_close(snd_pcm_substream_t * substream) | |||
1701 | return 0; | 1697 | return 0; |
1702 | } | 1698 | } |
1703 | 1699 | ||
1704 | static snd_pcm_ops_t snd_es1968_playback_ops = { | 1700 | static struct snd_pcm_ops snd_es1968_playback_ops = { |
1705 | .open = snd_es1968_playback_open, | 1701 | .open = snd_es1968_playback_open, |
1706 | .close = snd_es1968_playback_close, | 1702 | .close = snd_es1968_playback_close, |
1707 | .ioctl = snd_pcm_lib_ioctl, | 1703 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1712,7 +1708,7 @@ static snd_pcm_ops_t snd_es1968_playback_ops = { | |||
1712 | .pointer = snd_es1968_pcm_pointer, | 1708 | .pointer = snd_es1968_pcm_pointer, |
1713 | }; | 1709 | }; |
1714 | 1710 | ||
1715 | static snd_pcm_ops_t snd_es1968_capture_ops = { | 1711 | static struct snd_pcm_ops snd_es1968_capture_ops = { |
1716 | .open = snd_es1968_capture_open, | 1712 | .open = snd_es1968_capture_open, |
1717 | .close = snd_es1968_capture_close, | 1713 | .close = snd_es1968_capture_close, |
1718 | .ioctl = snd_pcm_lib_ioctl, | 1714 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1729,11 +1725,11 @@ static snd_pcm_ops_t snd_es1968_capture_ops = { | |||
1729 | */ | 1725 | */ |
1730 | #define CLOCK_MEASURE_BUFSIZE 16768 /* enough large for a single shot */ | 1726 | #define CLOCK_MEASURE_BUFSIZE 16768 /* enough large for a single shot */ |
1731 | 1727 | ||
1732 | static void __devinit es1968_measure_clock(es1968_t *chip) | 1728 | static void __devinit es1968_measure_clock(struct es1968 *chip) |
1733 | { | 1729 | { |
1734 | int i, apu; | 1730 | int i, apu; |
1735 | unsigned int pa, offset, t; | 1731 | unsigned int pa, offset, t; |
1736 | esm_memory_t *memory; | 1732 | struct esm_memory *memory; |
1737 | struct timeval start_time, stop_time; | 1733 | struct timeval start_time, stop_time; |
1738 | 1734 | ||
1739 | if (chip->clock == 0) | 1735 | if (chip->clock == 0) |
@@ -1824,17 +1820,17 @@ static void __devinit es1968_measure_clock(es1968_t *chip) | |||
1824 | /* | 1820 | /* |
1825 | */ | 1821 | */ |
1826 | 1822 | ||
1827 | static void snd_es1968_pcm_free(snd_pcm_t *pcm) | 1823 | static void snd_es1968_pcm_free(struct snd_pcm *pcm) |
1828 | { | 1824 | { |
1829 | es1968_t *esm = pcm->private_data; | 1825 | struct es1968 *esm = pcm->private_data; |
1830 | snd_es1968_free_dmabuf(esm); | 1826 | snd_es1968_free_dmabuf(esm); |
1831 | esm->pcm = NULL; | 1827 | esm->pcm = NULL; |
1832 | } | 1828 | } |
1833 | 1829 | ||
1834 | static int __devinit | 1830 | static int __devinit |
1835 | snd_es1968_pcm(es1968_t *chip, int device) | 1831 | snd_es1968_pcm(struct es1968 *chip, int device) |
1836 | { | 1832 | { |
1837 | snd_pcm_t *pcm; | 1833 | struct snd_pcm *pcm; |
1838 | int err; | 1834 | int err; |
1839 | 1835 | ||
1840 | /* get DMA buffer */ | 1836 | /* get DMA buffer */ |
@@ -1870,11 +1866,11 @@ snd_es1968_pcm(es1968_t *chip, int device) | |||
1870 | /* | 1866 | /* |
1871 | * update pointer | 1867 | * update pointer |
1872 | */ | 1868 | */ |
1873 | static void snd_es1968_update_pcm(es1968_t *chip, esschan_t *es) | 1869 | static void snd_es1968_update_pcm(struct es1968 *chip, struct esschan *es) |
1874 | { | 1870 | { |
1875 | unsigned int hwptr; | 1871 | unsigned int hwptr; |
1876 | unsigned int diff; | 1872 | unsigned int diff; |
1877 | snd_pcm_substream_t *subs = es->substream; | 1873 | struct snd_pcm_substream *subs = es->substream; |
1878 | 1874 | ||
1879 | if (subs == NULL || !es->running) | 1875 | if (subs == NULL || !es->running) |
1880 | return; | 1876 | return; |
@@ -1899,7 +1895,7 @@ static void snd_es1968_update_pcm(es1968_t *chip, esschan_t *es) | |||
1899 | */ | 1895 | */ |
1900 | static void es1968_update_hw_volume(unsigned long private_data) | 1896 | static void es1968_update_hw_volume(unsigned long private_data) |
1901 | { | 1897 | { |
1902 | es1968_t *chip = (es1968_t *) private_data; | 1898 | struct es1968 *chip = (struct es1968 *) private_data; |
1903 | int x, val; | 1899 | int x, val; |
1904 | unsigned long flags; | 1900 | unsigned long flags; |
1905 | 1901 | ||
@@ -1959,7 +1955,7 @@ static void es1968_update_hw_volume(unsigned long private_data) | |||
1959 | */ | 1955 | */ |
1960 | static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 1956 | static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
1961 | { | 1957 | { |
1962 | es1968_t *chip = dev_id; | 1958 | struct es1968 *chip = dev_id; |
1963 | u32 event; | 1959 | u32 event; |
1964 | 1960 | ||
1965 | if (!(event = inb(chip->io_port + 0x1A))) | 1961 | if (!(event = inb(chip->io_port + 0x1A))) |
@@ -1981,7 +1977,7 @@ static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *r | |||
1981 | struct list_head *p; | 1977 | struct list_head *p; |
1982 | spin_lock(&chip->substream_lock); | 1978 | spin_lock(&chip->substream_lock); |
1983 | list_for_each(p, &chip->substream_list) { | 1979 | list_for_each(p, &chip->substream_list) { |
1984 | esschan_t *es = list_entry(p, esschan_t, list); | 1980 | struct esschan *es = list_entry(p, struct esschan, list); |
1985 | if (es->running) | 1981 | if (es->running) |
1986 | snd_es1968_update_pcm(chip, es); | 1982 | snd_es1968_update_pcm(chip, es); |
1987 | } | 1983 | } |
@@ -2002,13 +1998,13 @@ static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *r | |||
2002 | */ | 1998 | */ |
2003 | 1999 | ||
2004 | static int __devinit | 2000 | static int __devinit |
2005 | snd_es1968_mixer(es1968_t *chip) | 2001 | snd_es1968_mixer(struct es1968 *chip) |
2006 | { | 2002 | { |
2007 | ac97_bus_t *pbus; | 2003 | struct snd_ac97_bus *pbus; |
2008 | ac97_template_t ac97; | 2004 | struct snd_ac97_template ac97; |
2009 | snd_ctl_elem_id_t id; | 2005 | struct snd_ctl_elem_id id; |
2010 | int err; | 2006 | int err; |
2011 | static ac97_bus_ops_t ops = { | 2007 | static struct snd_ac97_bus_ops ops = { |
2012 | .write = snd_es1968_ac97_write, | 2008 | .write = snd_es1968_ac97_write, |
2013 | .read = snd_es1968_ac97_read, | 2009 | .read = snd_es1968_ac97_read, |
2014 | }; | 2010 | }; |
@@ -2039,7 +2035,7 @@ snd_es1968_mixer(es1968_t *chip) | |||
2039 | * reset ac97 codec | 2035 | * reset ac97 codec |
2040 | */ | 2036 | */ |
2041 | 2037 | ||
2042 | static void snd_es1968_ac97_reset(es1968_t *chip) | 2038 | static void snd_es1968_ac97_reset(struct es1968 *chip) |
2043 | { | 2039 | { |
2044 | unsigned long ioaddr = chip->io_port; | 2040 | unsigned long ioaddr = chip->io_port; |
2045 | 2041 | ||
@@ -2144,7 +2140,7 @@ static void snd_es1968_ac97_reset(es1968_t *chip) | |||
2144 | outb(0x3f, ioaddr+0xd0); | 2140 | outb(0x3f, ioaddr+0xd0); |
2145 | } | 2141 | } |
2146 | 2142 | ||
2147 | static void snd_es1968_reset(es1968_t *chip) | 2143 | static void snd_es1968_reset(struct es1968 *chip) |
2148 | { | 2144 | { |
2149 | /* Reset */ | 2145 | /* Reset */ |
2150 | outw(ESM_RESET_MAESTRO | ESM_RESET_DIRECTSOUND, | 2146 | outw(ESM_RESET_MAESTRO | ESM_RESET_DIRECTSOUND, |
@@ -2157,7 +2153,7 @@ static void snd_es1968_reset(es1968_t *chip) | |||
2157 | /* | 2153 | /* |
2158 | * power management | 2154 | * power management |
2159 | */ | 2155 | */ |
2160 | static void snd_es1968_set_acpi(es1968_t *chip, int state) | 2156 | static void snd_es1968_set_acpi(struct es1968 *chip, int state) |
2161 | { | 2157 | { |
2162 | u16 active_mask = acpi_state_mask[state]; | 2158 | u16 active_mask = acpi_state_mask[state]; |
2163 | 2159 | ||
@@ -2172,7 +2168,7 @@ static void snd_es1968_set_acpi(es1968_t *chip, int state) | |||
2172 | /* | 2168 | /* |
2173 | * initialize maestro chip | 2169 | * initialize maestro chip |
2174 | */ | 2170 | */ |
2175 | static void snd_es1968_chip_init(es1968_t *chip) | 2171 | static void snd_es1968_chip_init(struct es1968 *chip) |
2176 | { | 2172 | { |
2177 | struct pci_dev *pci = chip->pci; | 2173 | struct pci_dev *pci = chip->pci; |
2178 | int i; | 2174 | int i; |
@@ -2369,7 +2365,7 @@ static void snd_es1968_chip_init(es1968_t *chip) | |||
2369 | } | 2365 | } |
2370 | 2366 | ||
2371 | /* Enable IRQ's */ | 2367 | /* Enable IRQ's */ |
2372 | static void snd_es1968_start_irq(es1968_t *chip) | 2368 | static void snd_es1968_start_irq(struct es1968 *chip) |
2373 | { | 2369 | { |
2374 | unsigned short w; | 2370 | unsigned short w; |
2375 | w = ESM_HIRQ_DSIE | ESM_HIRQ_HW_VOLUME; | 2371 | w = ESM_HIRQ_DSIE | ESM_HIRQ_HW_VOLUME; |
@@ -2382,9 +2378,9 @@ static void snd_es1968_start_irq(es1968_t *chip) | |||
2382 | /* | 2378 | /* |
2383 | * PM support | 2379 | * PM support |
2384 | */ | 2380 | */ |
2385 | static int es1968_suspend(snd_card_t *card, pm_message_t state) | 2381 | static int es1968_suspend(struct snd_card *card, pm_message_t state) |
2386 | { | 2382 | { |
2387 | es1968_t *chip = card->pm_private_data; | 2383 | struct es1968 *chip = card->pm_private_data; |
2388 | 2384 | ||
2389 | if (! chip->do_pm) | 2385 | if (! chip->do_pm) |
2390 | return 0; | 2386 | return 0; |
@@ -2398,9 +2394,9 @@ static int es1968_suspend(snd_card_t *card, pm_message_t state) | |||
2398 | return 0; | 2394 | return 0; |
2399 | } | 2395 | } |
2400 | 2396 | ||
2401 | static int es1968_resume(snd_card_t *card) | 2397 | static int es1968_resume(struct snd_card *card) |
2402 | { | 2398 | { |
2403 | es1968_t *chip = card->pm_private_data; | 2399 | struct es1968 *chip = card->pm_private_data; |
2404 | struct list_head *p; | 2400 | struct list_head *p; |
2405 | 2401 | ||
2406 | if (! chip->do_pm) | 2402 | if (! chip->do_pm) |
@@ -2423,7 +2419,7 @@ static int es1968_resume(snd_card_t *card) | |||
2423 | snd_ac97_resume(chip->ac97); | 2419 | snd_ac97_resume(chip->ac97); |
2424 | 2420 | ||
2425 | list_for_each(p, &chip->substream_list) { | 2421 | list_for_each(p, &chip->substream_list) { |
2426 | esschan_t *es = list_entry(p, esschan_t, list); | 2422 | struct esschan *es = list_entry(p, struct esschan, list); |
2427 | switch (es->mode) { | 2423 | switch (es->mode) { |
2428 | case ESM_MODE_PLAY: | 2424 | case ESM_MODE_PLAY: |
2429 | snd_es1968_playback_setup(chip, es, es->substream->runtime); | 2425 | snd_es1968_playback_setup(chip, es, es->substream->runtime); |
@@ -2445,7 +2441,7 @@ static int es1968_resume(snd_card_t *card) | |||
2445 | 2441 | ||
2446 | #ifdef SUPPORT_JOYSTICK | 2442 | #ifdef SUPPORT_JOYSTICK |
2447 | #define JOYSTICK_ADDR 0x200 | 2443 | #define JOYSTICK_ADDR 0x200 |
2448 | static int __devinit snd_es1968_create_gameport(es1968_t *chip, int dev) | 2444 | static int __devinit snd_es1968_create_gameport(struct es1968 *chip, int dev) |
2449 | { | 2445 | { |
2450 | struct gameport *gp; | 2446 | struct gameport *gp; |
2451 | struct resource *r; | 2447 | struct resource *r; |
@@ -2479,7 +2475,7 @@ static int __devinit snd_es1968_create_gameport(es1968_t *chip, int dev) | |||
2479 | return 0; | 2475 | return 0; |
2480 | } | 2476 | } |
2481 | 2477 | ||
2482 | static void snd_es1968_free_gameport(es1968_t *chip) | 2478 | static void snd_es1968_free_gameport(struct es1968 *chip) |
2483 | { | 2479 | { |
2484 | if (chip->gameport) { | 2480 | if (chip->gameport) { |
2485 | struct resource *r = gameport_get_port_data(chip->gameport); | 2481 | struct resource *r = gameport_get_port_data(chip->gameport); |
@@ -2491,11 +2487,11 @@ static void snd_es1968_free_gameport(es1968_t *chip) | |||
2491 | } | 2487 | } |
2492 | } | 2488 | } |
2493 | #else | 2489 | #else |
2494 | static inline int snd_es1968_create_gameport(es1968_t *chip, int dev) { return -ENOSYS; } | 2490 | static inline int snd_es1968_create_gameport(struct es1968 *chip, int dev) { return -ENOSYS; } |
2495 | static inline void snd_es1968_free_gameport(es1968_t *chip) { } | 2491 | static inline void snd_es1968_free_gameport(struct es1968 *chip) { } |
2496 | #endif | 2492 | #endif |
2497 | 2493 | ||
2498 | static int snd_es1968_free(es1968_t *chip) | 2494 | static int snd_es1968_free(struct es1968 *chip) |
2499 | { | 2495 | { |
2500 | if (chip->io_port) { | 2496 | if (chip->io_port) { |
2501 | synchronize_irq(chip->irq); | 2497 | synchronize_irq(chip->irq); |
@@ -2515,9 +2511,9 @@ static int snd_es1968_free(es1968_t *chip) | |||
2515 | return 0; | 2511 | return 0; |
2516 | } | 2512 | } |
2517 | 2513 | ||
2518 | static int snd_es1968_dev_free(snd_device_t *device) | 2514 | static int snd_es1968_dev_free(struct snd_device *device) |
2519 | { | 2515 | { |
2520 | es1968_t *chip = device->device_data; | 2516 | struct es1968 *chip = device->device_data; |
2521 | return snd_es1968_free(chip); | 2517 | return snd_es1968_free(chip); |
2522 | } | 2518 | } |
2523 | 2519 | ||
@@ -2539,19 +2535,19 @@ static struct ess_device_list mpu_blacklist[] __devinitdata = { | |||
2539 | { TYPE_MAESTRO2, 0x125d }, | 2535 | { TYPE_MAESTRO2, 0x125d }, |
2540 | }; | 2536 | }; |
2541 | 2537 | ||
2542 | static int __devinit snd_es1968_create(snd_card_t * card, | 2538 | static int __devinit snd_es1968_create(struct snd_card *card, |
2543 | struct pci_dev *pci, | 2539 | struct pci_dev *pci, |
2544 | int total_bufsize, | 2540 | int total_bufsize, |
2545 | int play_streams, | 2541 | int play_streams, |
2546 | int capt_streams, | 2542 | int capt_streams, |
2547 | int chip_type, | 2543 | int chip_type, |
2548 | int do_pm, | 2544 | int do_pm, |
2549 | es1968_t **chip_ret) | 2545 | struct es1968 **chip_ret) |
2550 | { | 2546 | { |
2551 | static snd_device_ops_t ops = { | 2547 | static struct snd_device_ops ops = { |
2552 | .dev_free = snd_es1968_dev_free, | 2548 | .dev_free = snd_es1968_dev_free, |
2553 | }; | 2549 | }; |
2554 | es1968_t *chip; | 2550 | struct es1968 *chip; |
2555 | int i, err; | 2551 | int i, err; |
2556 | 2552 | ||
2557 | *chip_ret = NULL; | 2553 | *chip_ret = NULL; |
@@ -2657,8 +2653,8 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci, | |||
2657 | const struct pci_device_id *pci_id) | 2653 | const struct pci_device_id *pci_id) |
2658 | { | 2654 | { |
2659 | static int dev; | 2655 | static int dev; |
2660 | snd_card_t *card; | 2656 | struct snd_card *card; |
2661 | es1968_t *chip; | 2657 | struct es1968 *chip; |
2662 | unsigned int i; | 2658 | unsigned int i; |
2663 | int err; | 2659 | int err; |
2664 | 2660 | ||