diff options
Diffstat (limited to 'sound/isa/opti9xx/opti92x-ad1848.c')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 224 |
1 files changed, 110 insertions, 114 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 1be32999dfe1..fddf7b9549ba 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -120,8 +120,6 @@ MODULE_PARM_DESC(dma2, "2nd dma # for opti9xx driver."); | |||
120 | 120 | ||
121 | #define OPTi9XX_MC_REG(n) n | 121 | #define OPTi9XX_MC_REG(n) n |
122 | 122 | ||
123 | typedef struct _snd_opti9xx opti9xx_t; | ||
124 | |||
125 | #ifdef OPTi93X | 123 | #ifdef OPTi93X |
126 | 124 | ||
127 | #define OPTi93X_INDEX 0x00 | 125 | #define OPTi93X_INDEX 0x00 |
@@ -193,16 +191,14 @@ typedef struct _snd_opti9xx opti9xx_t; | |||
193 | #define OPTi93X_IRQ_CAPTURE 0x08 | 191 | #define OPTi93X_IRQ_CAPTURE 0x08 |
194 | 192 | ||
195 | 193 | ||
196 | typedef struct _snd_opti93x opti93x_t; | 194 | struct snd_opti93x { |
197 | |||
198 | struct _snd_opti93x { | ||
199 | unsigned long port; | 195 | unsigned long port; |
200 | struct resource *res_port; | 196 | struct resource *res_port; |
201 | int irq; | 197 | int irq; |
202 | int dma1; | 198 | int dma1; |
203 | int dma2; | 199 | int dma2; |
204 | 200 | ||
205 | opti9xx_t *chip; | 201 | struct snd_opti9xx *chip; |
206 | unsigned short hardware; | 202 | unsigned short hardware; |
207 | unsigned char image[32]; | 203 | unsigned char image[32]; |
208 | 204 | ||
@@ -212,10 +208,10 @@ struct _snd_opti93x { | |||
212 | 208 | ||
213 | spinlock_t lock; | 209 | spinlock_t lock; |
214 | 210 | ||
215 | snd_card_t *card; | 211 | struct snd_card *card; |
216 | snd_pcm_t *pcm; | 212 | struct snd_pcm *pcm; |
217 | snd_pcm_substream_t *playback_substream; | 213 | struct snd_pcm_substream *playback_substream; |
218 | snd_pcm_substream_t *capture_substream; | 214 | struct snd_pcm_substream *capture_substream; |
219 | unsigned int p_dma_size; | 215 | unsigned int p_dma_size; |
220 | unsigned int c_dma_size; | 216 | unsigned int c_dma_size; |
221 | }; | 217 | }; |
@@ -227,7 +223,7 @@ struct _snd_opti93x { | |||
227 | 223 | ||
228 | #endif /* OPTi93X */ | 224 | #endif /* OPTi93X */ |
229 | 225 | ||
230 | struct _snd_opti9xx { | 226 | struct snd_opti9xx { |
231 | unsigned short hardware; | 227 | unsigned short hardware; |
232 | unsigned char password; | 228 | unsigned char password; |
233 | char name[7]; | 229 | char name[7]; |
@@ -261,7 +257,7 @@ struct _snd_opti9xx { | |||
261 | }; | 257 | }; |
262 | 258 | ||
263 | static int snd_opti9xx_first_hit = 1; | 259 | static int snd_opti9xx_first_hit = 1; |
264 | static snd_card_t *snd_opti9xx_legacy = SNDRV_DEFAULT_PTR1; | 260 | static struct snd_card *snd_opti9xx_legacy = SNDRV_DEFAULT_PTR1; |
265 | 261 | ||
266 | #ifdef CONFIG_PNP | 262 | #ifdef CONFIG_PNP |
267 | 263 | ||
@@ -308,7 +304,7 @@ static long snd_legacy_find_free_ioport(long *port_table, long size) | |||
308 | return -1; | 304 | return -1; |
309 | } | 305 | } |
310 | 306 | ||
311 | static int __devinit snd_opti9xx_init(opti9xx_t *chip, unsigned short hardware) | 307 | static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, unsigned short hardware) |
312 | { | 308 | { |
313 | static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; | 309 | static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; |
314 | 310 | ||
@@ -363,7 +359,7 @@ static int __devinit snd_opti9xx_init(opti9xx_t *chip, unsigned short hardware) | |||
363 | return 0; | 359 | return 0; |
364 | } | 360 | } |
365 | 361 | ||
366 | static unsigned char snd_opti9xx_read(opti9xx_t *chip, | 362 | static unsigned char snd_opti9xx_read(struct snd_opti9xx *chip, |
367 | unsigned char reg) | 363 | unsigned char reg) |
368 | { | 364 | { |
369 | unsigned long flags; | 365 | unsigned long flags; |
@@ -406,7 +402,7 @@ static unsigned char snd_opti9xx_read(opti9xx_t *chip, | |||
406 | return retval; | 402 | return retval; |
407 | } | 403 | } |
408 | 404 | ||
409 | static void snd_opti9xx_write(opti9xx_t *chip, unsigned char reg, | 405 | static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg, |
410 | unsigned char value) | 406 | unsigned char value) |
411 | { | 407 | { |
412 | unsigned long flags; | 408 | unsigned long flags; |
@@ -453,7 +449,7 @@ static void snd_opti9xx_write(opti9xx_t *chip, unsigned char reg, | |||
453 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) | 449 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) |
454 | 450 | ||
455 | 451 | ||
456 | static int __devinit snd_opti9xx_configure(opti9xx_t *chip) | 452 | static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip) |
457 | { | 453 | { |
458 | unsigned char wss_base_bits; | 454 | unsigned char wss_base_bits; |
459 | unsigned char irq_bits; | 455 | unsigned char irq_bits; |
@@ -684,7 +680,7 @@ static unsigned char snd_opti93x_default_image[32] = | |||
684 | }; | 680 | }; |
685 | 681 | ||
686 | 682 | ||
687 | static int snd_opti93x_busy_wait(opti93x_t *chip) | 683 | static int snd_opti93x_busy_wait(struct snd_opti93x *chip) |
688 | { | 684 | { |
689 | int timeout; | 685 | int timeout; |
690 | 686 | ||
@@ -696,14 +692,14 @@ static int snd_opti93x_busy_wait(opti93x_t *chip) | |||
696 | return -EBUSY; | 692 | return -EBUSY; |
697 | } | 693 | } |
698 | 694 | ||
699 | static unsigned char snd_opti93x_in(opti93x_t *chip, unsigned char reg) | 695 | static unsigned char snd_opti93x_in(struct snd_opti93x *chip, unsigned char reg) |
700 | { | 696 | { |
701 | snd_opti93x_busy_wait(chip); | 697 | snd_opti93x_busy_wait(chip); |
702 | outb(chip->mce_bit | (reg & 0x1f), OPTi93X_PORT(chip, INDEX)); | 698 | outb(chip->mce_bit | (reg & 0x1f), OPTi93X_PORT(chip, INDEX)); |
703 | return inb(OPTi93X_PORT(chip, DATA)); | 699 | return inb(OPTi93X_PORT(chip, DATA)); |
704 | } | 700 | } |
705 | 701 | ||
706 | static void snd_opti93x_out(opti93x_t *chip, unsigned char reg, | 702 | static void snd_opti93x_out(struct snd_opti93x *chip, unsigned char reg, |
707 | unsigned char value) | 703 | unsigned char value) |
708 | { | 704 | { |
709 | snd_opti93x_busy_wait(chip); | 705 | snd_opti93x_busy_wait(chip); |
@@ -711,13 +707,13 @@ static void snd_opti93x_out(opti93x_t *chip, unsigned char reg, | |||
711 | outb(value, OPTi93X_PORT(chip, DATA)); | 707 | outb(value, OPTi93X_PORT(chip, DATA)); |
712 | } | 708 | } |
713 | 709 | ||
714 | static void snd_opti93x_out_image(opti93x_t *chip, unsigned char reg, | 710 | static void snd_opti93x_out_image(struct snd_opti93x *chip, unsigned char reg, |
715 | unsigned char value) | 711 | unsigned char value) |
716 | { | 712 | { |
717 | snd_opti93x_out(chip, reg, chip->image[reg] = value); | 713 | snd_opti93x_out(chip, reg, chip->image[reg] = value); |
718 | } | 714 | } |
719 | 715 | ||
720 | static void snd_opti93x_out_mask(opti93x_t *chip, unsigned char reg, | 716 | static void snd_opti93x_out_mask(struct snd_opti93x *chip, unsigned char reg, |
721 | unsigned char mask, unsigned char value) | 717 | unsigned char mask, unsigned char value) |
722 | { | 718 | { |
723 | snd_opti93x_out_image(chip, reg, | 719 | snd_opti93x_out_image(chip, reg, |
@@ -725,7 +721,7 @@ static void snd_opti93x_out_mask(opti93x_t *chip, unsigned char reg, | |||
725 | } | 721 | } |
726 | 722 | ||
727 | 723 | ||
728 | static void snd_opti93x_mce_up(opti93x_t *chip) | 724 | static void snd_opti93x_mce_up(struct snd_opti93x *chip) |
729 | { | 725 | { |
730 | snd_opti93x_busy_wait(chip); | 726 | snd_opti93x_busy_wait(chip); |
731 | 727 | ||
@@ -734,7 +730,7 @@ static void snd_opti93x_mce_up(opti93x_t *chip) | |||
734 | outb(chip->mce_bit, OPTi93X_PORT(chip, INDEX)); | 730 | outb(chip->mce_bit, OPTi93X_PORT(chip, INDEX)); |
735 | } | 731 | } |
736 | 732 | ||
737 | static void snd_opti93x_mce_down(opti93x_t *chip) | 733 | static void snd_opti93x_mce_down(struct snd_opti93x *chip) |
738 | { | 734 | { |
739 | snd_opti93x_busy_wait(chip); | 735 | snd_opti93x_busy_wait(chip); |
740 | 736 | ||
@@ -746,7 +742,7 @@ static void snd_opti93x_mce_down(opti93x_t *chip) | |||
746 | #define snd_opti93x_mute_reg(chip, reg, mute) \ | 742 | #define snd_opti93x_mute_reg(chip, reg, mute) \ |
747 | snd_opti93x_out(chip, reg, mute ? 0x80 : chip->image[reg]); | 743 | snd_opti93x_out(chip, reg, mute ? 0x80 : chip->image[reg]); |
748 | 744 | ||
749 | static void snd_opti93x_mute(opti93x_t *chip, int mute) | 745 | static void snd_opti93x_mute(struct snd_opti93x *chip, int mute) |
750 | { | 746 | { |
751 | mute = mute ? 1 : 0; | 747 | mute = mute ? 1 : 0; |
752 | if (chip->mute == mute) | 748 | if (chip->mute == mute) |
@@ -798,7 +794,7 @@ static unsigned int rates[] = { 5512, 6615, 8000, 9600, 11025, 16000, | |||
798 | 44100, 48000 }; | 794 | 44100, 48000 }; |
799 | #define RATES ARRAY_SIZE(rates) | 795 | #define RATES ARRAY_SIZE(rates) |
800 | 796 | ||
801 | static snd_pcm_hw_constraint_list_t hw_constraints_rates = { | 797 | static struct snd_pcm_hw_constraint_list hw_constraints_rates = { |
802 | .count = RATES, | 798 | .count = RATES, |
803 | .list = rates, | 799 | .list = rates, |
804 | .mask = 0, | 800 | .mask = 0, |
@@ -820,7 +816,7 @@ static unsigned char snd_opti93x_get_freq(unsigned int rate) | |||
820 | return bits[RATES-1]; | 816 | return bits[RATES-1]; |
821 | } | 817 | } |
822 | 818 | ||
823 | static unsigned char snd_opti93x_get_format(opti93x_t *chip, | 819 | static unsigned char snd_opti93x_get_format(struct snd_opti93x *chip, |
824 | unsigned int format, int channels) | 820 | unsigned int format, int channels) |
825 | { | 821 | { |
826 | unsigned char retval = OPTi93X_LINEAR_8; | 822 | unsigned char retval = OPTi93X_LINEAR_8; |
@@ -845,7 +841,7 @@ static unsigned char snd_opti93x_get_format(opti93x_t *chip, | |||
845 | } | 841 | } |
846 | 842 | ||
847 | 843 | ||
848 | static void snd_opti93x_playback_format(opti93x_t *chip, unsigned char fmt) | 844 | static void snd_opti93x_playback_format(struct snd_opti93x *chip, unsigned char fmt) |
849 | { | 845 | { |
850 | unsigned char mask; | 846 | unsigned char mask; |
851 | 847 | ||
@@ -859,7 +855,7 @@ static void snd_opti93x_playback_format(opti93x_t *chip, unsigned char fmt) | |||
859 | snd_opti93x_mute(chip, 0); | 855 | snd_opti93x_mute(chip, 0); |
860 | } | 856 | } |
861 | 857 | ||
862 | static void snd_opti93x_capture_format(opti93x_t *chip, unsigned char fmt) | 858 | static void snd_opti93x_capture_format(struct snd_opti93x *chip, unsigned char fmt) |
863 | { | 859 | { |
864 | snd_opti93x_mute(chip, 1); | 860 | snd_opti93x_mute(chip, 1); |
865 | 861 | ||
@@ -875,7 +871,7 @@ static void snd_opti93x_capture_format(opti93x_t *chip, unsigned char fmt) | |||
875 | } | 871 | } |
876 | 872 | ||
877 | 873 | ||
878 | static int snd_opti93x_open(opti93x_t *chip, unsigned int mode) | 874 | static int snd_opti93x_open(struct snd_opti93x *chip, unsigned int mode) |
879 | { | 875 | { |
880 | unsigned long flags; | 876 | unsigned long flags; |
881 | 877 | ||
@@ -899,7 +895,7 @@ static int snd_opti93x_open(opti93x_t *chip, unsigned int mode) | |||
899 | return 0; | 895 | return 0; |
900 | } | 896 | } |
901 | 897 | ||
902 | static void snd_opti93x_close(opti93x_t *chip, unsigned int mode) | 898 | static void snd_opti93x_close(struct snd_opti93x *chip, unsigned int mode) |
903 | { | 899 | { |
904 | unsigned long flags; | 900 | unsigned long flags; |
905 | 901 | ||
@@ -926,10 +922,10 @@ static void snd_opti93x_close(opti93x_t *chip, unsigned int mode) | |||
926 | spin_unlock_irqrestore(&chip->lock, flags); | 922 | spin_unlock_irqrestore(&chip->lock, flags); |
927 | } | 923 | } |
928 | 924 | ||
929 | static int snd_opti93x_trigger(snd_pcm_substream_t *substream, | 925 | static int snd_opti93x_trigger(struct snd_pcm_substream *substream, |
930 | unsigned char what, int cmd) | 926 | unsigned char what, int cmd) |
931 | { | 927 | { |
932 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 928 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
933 | 929 | ||
934 | switch (cmd) { | 930 | switch (cmd) { |
935 | case SNDRV_PCM_TRIGGER_START: | 931 | case SNDRV_PCM_TRIGGER_START: |
@@ -937,7 +933,7 @@ static int snd_opti93x_trigger(snd_pcm_substream_t *substream, | |||
937 | { | 933 | { |
938 | unsigned int what = 0; | 934 | unsigned int what = 0; |
939 | struct list_head *pos; | 935 | struct list_head *pos; |
940 | snd_pcm_substream_t *s; | 936 | struct snd_pcm_substream *s; |
941 | snd_pcm_group_for_each(pos, substream) { | 937 | snd_pcm_group_for_each(pos, substream) { |
942 | s = snd_pcm_group_substream_entry(pos); | 938 | s = snd_pcm_group_substream_entry(pos); |
943 | if (s == chip->playback_substream) { | 939 | if (s == chip->playback_substream) { |
@@ -964,36 +960,36 @@ static int snd_opti93x_trigger(snd_pcm_substream_t *substream, | |||
964 | return 0; | 960 | return 0; |
965 | } | 961 | } |
966 | 962 | ||
967 | static int snd_opti93x_playback_trigger(snd_pcm_substream_t *substream, int cmd) | 963 | static int snd_opti93x_playback_trigger(struct snd_pcm_substream *substream, int cmd) |
968 | { | 964 | { |
969 | return snd_opti93x_trigger(substream, | 965 | return snd_opti93x_trigger(substream, |
970 | OPTi93X_PLAYBACK_ENABLE, cmd); | 966 | OPTi93X_PLAYBACK_ENABLE, cmd); |
971 | } | 967 | } |
972 | 968 | ||
973 | static int snd_opti93x_capture_trigger(snd_pcm_substream_t * substream, int cmd) | 969 | static int snd_opti93x_capture_trigger(struct snd_pcm_substream *substream, int cmd) |
974 | { | 970 | { |
975 | return snd_opti93x_trigger(substream, | 971 | return snd_opti93x_trigger(substream, |
976 | OPTi93X_CAPTURE_ENABLE, cmd); | 972 | OPTi93X_CAPTURE_ENABLE, cmd); |
977 | } | 973 | } |
978 | 974 | ||
979 | static int snd_opti93x_hw_params(snd_pcm_substream_t * substream, | 975 | static int snd_opti93x_hw_params(struct snd_pcm_substream *substream, |
980 | snd_pcm_hw_params_t * hw_params) | 976 | struct snd_pcm_hw_params *hw_params) |
981 | { | 977 | { |
982 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | 978 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
983 | } | 979 | } |
984 | 980 | ||
985 | 981 | ||
986 | static int snd_opti93x_hw_free(snd_pcm_substream_t * substream) | 982 | static int snd_opti93x_hw_free(struct snd_pcm_substream *substream) |
987 | { | 983 | { |
988 | snd_pcm_lib_free_pages(substream); | 984 | snd_pcm_lib_free_pages(substream); |
989 | return 0; | 985 | return 0; |
990 | } | 986 | } |
991 | 987 | ||
992 | 988 | ||
993 | static int snd_opti93x_playback_prepare(snd_pcm_substream_t * substream) | 989 | static int snd_opti93x_playback_prepare(struct snd_pcm_substream *substream) |
994 | { | 990 | { |
995 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 991 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
996 | snd_pcm_runtime_t *runtime = substream->runtime; | 992 | struct snd_pcm_runtime *runtime = substream->runtime; |
997 | unsigned long flags; | 993 | unsigned long flags; |
998 | unsigned char format; | 994 | unsigned char format; |
999 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 995 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
@@ -1023,10 +1019,10 @@ static int snd_opti93x_playback_prepare(snd_pcm_substream_t * substream) | |||
1023 | return 0; | 1019 | return 0; |
1024 | } | 1020 | } |
1025 | 1021 | ||
1026 | static int snd_opti93x_capture_prepare(snd_pcm_substream_t *substream) | 1022 | static int snd_opti93x_capture_prepare(struct snd_pcm_substream *substream) |
1027 | { | 1023 | { |
1028 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1024 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1029 | snd_pcm_runtime_t *runtime = substream->runtime; | 1025 | struct snd_pcm_runtime *runtime = substream->runtime; |
1030 | unsigned long flags; | 1026 | unsigned long flags; |
1031 | unsigned char format; | 1027 | unsigned char format; |
1032 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 1028 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
@@ -1055,9 +1051,9 @@ static int snd_opti93x_capture_prepare(snd_pcm_substream_t *substream) | |||
1055 | return 0; | 1051 | return 0; |
1056 | } | 1052 | } |
1057 | 1053 | ||
1058 | static snd_pcm_uframes_t snd_opti93x_playback_pointer(snd_pcm_substream_t *substream) | 1054 | static snd_pcm_uframes_t snd_opti93x_playback_pointer(struct snd_pcm_substream *substream) |
1059 | { | 1055 | { |
1060 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1056 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1061 | size_t ptr; | 1057 | size_t ptr; |
1062 | 1058 | ||
1063 | if (!(chip->image[OPTi93X_IFACE_CONF] & OPTi93X_PLAYBACK_ENABLE)) | 1059 | if (!(chip->image[OPTi93X_IFACE_CONF] & OPTi93X_PLAYBACK_ENABLE)) |
@@ -1067,9 +1063,9 @@ static snd_pcm_uframes_t snd_opti93x_playback_pointer(snd_pcm_substream_t *subst | |||
1067 | return bytes_to_frames(substream->runtime, ptr); | 1063 | return bytes_to_frames(substream->runtime, ptr); |
1068 | } | 1064 | } |
1069 | 1065 | ||
1070 | static snd_pcm_uframes_t snd_opti93x_capture_pointer(snd_pcm_substream_t *substream) | 1066 | static snd_pcm_uframes_t snd_opti93x_capture_pointer(struct snd_pcm_substream *substream) |
1071 | { | 1067 | { |
1072 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1068 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1073 | size_t ptr; | 1069 | size_t ptr; |
1074 | 1070 | ||
1075 | if (!(chip->image[OPTi93X_IFACE_CONF] & OPTi93X_CAPTURE_ENABLE)) | 1071 | if (!(chip->image[OPTi93X_IFACE_CONF] & OPTi93X_CAPTURE_ENABLE)) |
@@ -1080,7 +1076,7 @@ static snd_pcm_uframes_t snd_opti93x_capture_pointer(snd_pcm_substream_t *substr | |||
1080 | } | 1076 | } |
1081 | 1077 | ||
1082 | 1078 | ||
1083 | static void snd_opti93x_overrange(opti93x_t *chip) | 1079 | static void snd_opti93x_overrange(struct snd_opti93x *chip) |
1084 | { | 1080 | { |
1085 | unsigned long flags; | 1081 | unsigned long flags; |
1086 | 1082 | ||
@@ -1094,7 +1090,7 @@ static void snd_opti93x_overrange(opti93x_t *chip) | |||
1094 | 1090 | ||
1095 | static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 1091 | static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
1096 | { | 1092 | { |
1097 | opti93x_t *codec = dev_id; | 1093 | struct snd_opti93x *codec = dev_id; |
1098 | unsigned char status; | 1094 | unsigned char status; |
1099 | 1095 | ||
1100 | status = snd_opti9xx_read(codec->chip, OPTi9XX_MC_REG(11)); | 1096 | status = snd_opti9xx_read(codec->chip, OPTi9XX_MC_REG(11)); |
@@ -1109,7 +1105,7 @@ static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs * | |||
1109 | } | 1105 | } |
1110 | 1106 | ||
1111 | 1107 | ||
1112 | static snd_pcm_hardware_t snd_opti93x_playback = { | 1108 | static struct snd_pcm_hardware snd_opti93x_playback = { |
1113 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1109 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1114 | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), | 1110 | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), |
1115 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | | 1111 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | |
@@ -1127,7 +1123,7 @@ static snd_pcm_hardware_t snd_opti93x_playback = { | |||
1127 | .fifo_size = 0, | 1123 | .fifo_size = 0, |
1128 | }; | 1124 | }; |
1129 | 1125 | ||
1130 | static snd_pcm_hardware_t snd_opti93x_capture = { | 1126 | static struct snd_pcm_hardware snd_opti93x_capture = { |
1131 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1127 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1132 | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), | 1128 | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), |
1133 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | | 1129 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | |
@@ -1145,11 +1141,11 @@ static snd_pcm_hardware_t snd_opti93x_capture = { | |||
1145 | .fifo_size = 0, | 1141 | .fifo_size = 0, |
1146 | }; | 1142 | }; |
1147 | 1143 | ||
1148 | static int snd_opti93x_playback_open(snd_pcm_substream_t *substream) | 1144 | static int snd_opti93x_playback_open(struct snd_pcm_substream *substream) |
1149 | { | 1145 | { |
1150 | int error; | 1146 | int error; |
1151 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1147 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1152 | snd_pcm_runtime_t *runtime = substream->runtime; | 1148 | struct snd_pcm_runtime *runtime = substream->runtime; |
1153 | 1149 | ||
1154 | if ((error = snd_opti93x_open(chip, OPTi93X_MODE_PLAY)) < 0) | 1150 | if ((error = snd_opti93x_open(chip, OPTi93X_MODE_PLAY)) < 0) |
1155 | return error; | 1151 | return error; |
@@ -1161,11 +1157,11 @@ static int snd_opti93x_playback_open(snd_pcm_substream_t *substream) | |||
1161 | return error; | 1157 | return error; |
1162 | } | 1158 | } |
1163 | 1159 | ||
1164 | static int snd_opti93x_capture_open(snd_pcm_substream_t *substream) | 1160 | static int snd_opti93x_capture_open(struct snd_pcm_substream *substream) |
1165 | { | 1161 | { |
1166 | int error; | 1162 | int error; |
1167 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1163 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1168 | snd_pcm_runtime_t *runtime = substream->runtime; | 1164 | struct snd_pcm_runtime *runtime = substream->runtime; |
1169 | 1165 | ||
1170 | if ((error = snd_opti93x_open(chip, OPTi93X_MODE_CAPTURE)) < 0) | 1166 | if ((error = snd_opti93x_open(chip, OPTi93X_MODE_CAPTURE)) < 0) |
1171 | return error; | 1167 | return error; |
@@ -1177,18 +1173,18 @@ static int snd_opti93x_capture_open(snd_pcm_substream_t *substream) | |||
1177 | return error; | 1173 | return error; |
1178 | } | 1174 | } |
1179 | 1175 | ||
1180 | static int snd_opti93x_playback_close(snd_pcm_substream_t *substream) | 1176 | static int snd_opti93x_playback_close(struct snd_pcm_substream *substream) |
1181 | { | 1177 | { |
1182 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1178 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1183 | 1179 | ||
1184 | chip->playback_substream = NULL; | 1180 | chip->playback_substream = NULL; |
1185 | snd_opti93x_close(chip, OPTi93X_MODE_PLAY); | 1181 | snd_opti93x_close(chip, OPTi93X_MODE_PLAY); |
1186 | return 0; | 1182 | return 0; |
1187 | } | 1183 | } |
1188 | 1184 | ||
1189 | static int snd_opti93x_capture_close(snd_pcm_substream_t *substream) | 1185 | static int snd_opti93x_capture_close(struct snd_pcm_substream *substream) |
1190 | { | 1186 | { |
1191 | opti93x_t *chip = snd_pcm_substream_chip(substream); | 1187 | struct snd_opti93x *chip = snd_pcm_substream_chip(substream); |
1192 | 1188 | ||
1193 | chip->capture_substream = NULL; | 1189 | chip->capture_substream = NULL; |
1194 | snd_opti93x_close(chip, OPTi93X_MODE_CAPTURE); | 1190 | snd_opti93x_close(chip, OPTi93X_MODE_CAPTURE); |
@@ -1196,7 +1192,7 @@ static int snd_opti93x_capture_close(snd_pcm_substream_t *substream) | |||
1196 | } | 1192 | } |
1197 | 1193 | ||
1198 | 1194 | ||
1199 | static void snd_opti93x_init(opti93x_t *chip) | 1195 | static void snd_opti93x_init(struct snd_opti93x *chip) |
1200 | { | 1196 | { |
1201 | unsigned long flags; | 1197 | unsigned long flags; |
1202 | int i; | 1198 | int i; |
@@ -1211,7 +1207,7 @@ static void snd_opti93x_init(opti93x_t *chip) | |||
1211 | spin_unlock_irqrestore(&chip->lock, flags); | 1207 | spin_unlock_irqrestore(&chip->lock, flags); |
1212 | } | 1208 | } |
1213 | 1209 | ||
1214 | static int snd_opti93x_probe(opti93x_t *chip) | 1210 | static int snd_opti93x_probe(struct snd_opti93x *chip) |
1215 | { | 1211 | { |
1216 | unsigned long flags; | 1212 | unsigned long flags; |
1217 | unsigned char val; | 1213 | unsigned char val; |
@@ -1223,7 +1219,7 @@ static int snd_opti93x_probe(opti93x_t *chip) | |||
1223 | return (val == 0x0a) ? 0 : -ENODEV; | 1219 | return (val == 0x0a) ? 0 : -ENODEV; |
1224 | } | 1220 | } |
1225 | 1221 | ||
1226 | static int snd_opti93x_free(opti93x_t *chip) | 1222 | static int snd_opti93x_free(struct snd_opti93x *chip) |
1227 | { | 1223 | { |
1228 | release_and_free_resource(chip->res_port); | 1224 | release_and_free_resource(chip->res_port); |
1229 | if (chip->dma1 >= 0) { | 1225 | if (chip->dma1 >= 0) { |
@@ -1241,13 +1237,13 @@ static int snd_opti93x_free(opti93x_t *chip) | |||
1241 | return 0; | 1237 | return 0; |
1242 | } | 1238 | } |
1243 | 1239 | ||
1244 | static int snd_opti93x_dev_free(snd_device_t *device) | 1240 | static int snd_opti93x_dev_free(struct snd_device *device) |
1245 | { | 1241 | { |
1246 | opti93x_t *chip = device->device_data; | 1242 | struct snd_opti93x *chip = device->device_data; |
1247 | return snd_opti93x_free(chip); | 1243 | return snd_opti93x_free(chip); |
1248 | } | 1244 | } |
1249 | 1245 | ||
1250 | static const char *snd_opti93x_chip_id(opti93x_t *codec) | 1246 | static const char *snd_opti93x_chip_id(struct snd_opti93x *codec) |
1251 | { | 1247 | { |
1252 | switch (codec->hardware) { | 1248 | switch (codec->hardware) { |
1253 | case OPTi9XX_HW_82C930: return "82C930"; | 1249 | case OPTi9XX_HW_82C930: return "82C930"; |
@@ -1257,15 +1253,15 @@ static const char *snd_opti93x_chip_id(opti93x_t *codec) | |||
1257 | } | 1253 | } |
1258 | } | 1254 | } |
1259 | 1255 | ||
1260 | static int snd_opti93x_create(snd_card_t *card, opti9xx_t *chip, | 1256 | static int snd_opti93x_create(struct snd_card *card, struct snd_opti9xx *chip, |
1261 | int dma1, int dma2, | 1257 | int dma1, int dma2, |
1262 | opti93x_t **rcodec) | 1258 | struct snd_opti93x **rcodec) |
1263 | { | 1259 | { |
1264 | static snd_device_ops_t ops = { | 1260 | static struct snd_device_ops ops = { |
1265 | .dev_free = snd_opti93x_dev_free, | 1261 | .dev_free = snd_opti93x_dev_free, |
1266 | }; | 1262 | }; |
1267 | int error; | 1263 | int error; |
1268 | opti93x_t *codec; | 1264 | struct snd_opti93x *codec; |
1269 | 1265 | ||
1270 | *rcodec = NULL; | 1266 | *rcodec = NULL; |
1271 | codec = kzalloc(sizeof(*codec), GFP_KERNEL); | 1267 | codec = kzalloc(sizeof(*codec), GFP_KERNEL); |
@@ -1324,7 +1320,7 @@ static int snd_opti93x_create(snd_card_t *card, opti9xx_t *chip, | |||
1324 | return 0; | 1320 | return 0; |
1325 | } | 1321 | } |
1326 | 1322 | ||
1327 | static snd_pcm_ops_t snd_opti93x_playback_ops = { | 1323 | static struct snd_pcm_ops snd_opti93x_playback_ops = { |
1328 | .open = snd_opti93x_playback_open, | 1324 | .open = snd_opti93x_playback_open, |
1329 | .close = snd_opti93x_playback_close, | 1325 | .close = snd_opti93x_playback_close, |
1330 | .ioctl = snd_pcm_lib_ioctl, | 1326 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1335,7 +1331,7 @@ static snd_pcm_ops_t snd_opti93x_playback_ops = { | |||
1335 | .pointer = snd_opti93x_playback_pointer, | 1331 | .pointer = snd_opti93x_playback_pointer, |
1336 | }; | 1332 | }; |
1337 | 1333 | ||
1338 | static snd_pcm_ops_t snd_opti93x_capture_ops = { | 1334 | static struct snd_pcm_ops snd_opti93x_capture_ops = { |
1339 | .open = snd_opti93x_capture_open, | 1335 | .open = snd_opti93x_capture_open, |
1340 | .close = snd_opti93x_capture_close, | 1336 | .close = snd_opti93x_capture_close, |
1341 | .ioctl = snd_pcm_lib_ioctl, | 1337 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1346,10 +1342,10 @@ static snd_pcm_ops_t snd_opti93x_capture_ops = { | |||
1346 | .pointer = snd_opti93x_capture_pointer, | 1342 | .pointer = snd_opti93x_capture_pointer, |
1347 | }; | 1343 | }; |
1348 | 1344 | ||
1349 | static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm) | 1345 | static int snd_opti93x_pcm(struct snd_opti93x *codec, int device, struct snd_pcm **rpcm) |
1350 | { | 1346 | { |
1351 | int error; | 1347 | int error; |
1352 | snd_pcm_t *pcm; | 1348 | struct snd_pcm *pcm; |
1353 | 1349 | ||
1354 | if ((error = snd_pcm_new(codec->card, "OPTi 82C93X", device, 1, 1, &pcm))) | 1350 | if ((error = snd_pcm_new(codec->card, "OPTi 82C93X", device, 1, 1, &pcm))) |
1355 | return error; | 1351 | return error; |
@@ -1376,7 +1372,7 @@ static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm) | |||
1376 | * MIXER part | 1372 | * MIXER part |
1377 | */ | 1373 | */ |
1378 | 1374 | ||
1379 | static int snd_opti93x_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1375 | static int snd_opti93x_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1380 | { | 1376 | { |
1381 | static char *texts[4] = { | 1377 | static char *texts[4] = { |
1382 | "Line1", "Aux", "Mic", "Mix" | 1378 | "Line1", "Aux", "Mic", "Mix" |
@@ -1391,9 +1387,9 @@ static int snd_opti93x_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
1391 | return 0; | 1387 | return 0; |
1392 | } | 1388 | } |
1393 | 1389 | ||
1394 | static int snd_opti93x_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1390 | static int snd_opti93x_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1395 | { | 1391 | { |
1396 | opti93x_t *chip = snd_kcontrol_chip(kcontrol); | 1392 | struct snd_opti93x *chip = snd_kcontrol_chip(kcontrol); |
1397 | unsigned long flags; | 1393 | unsigned long flags; |
1398 | 1394 | ||
1399 | spin_lock_irqsave(&chip->lock, flags); | 1395 | spin_lock_irqsave(&chip->lock, flags); |
@@ -1403,9 +1399,9 @@ static int snd_opti93x_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
1403 | return 0; | 1399 | return 0; |
1404 | } | 1400 | } |
1405 | 1401 | ||
1406 | static int snd_opti93x_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1402 | static int snd_opti93x_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1407 | { | 1403 | { |
1408 | opti93x_t *chip = snd_kcontrol_chip(kcontrol); | 1404 | struct snd_opti93x *chip = snd_kcontrol_chip(kcontrol); |
1409 | unsigned long flags; | 1405 | unsigned long flags; |
1410 | unsigned short left, right; | 1406 | unsigned short left, right; |
1411 | int change; | 1407 | int change; |
@@ -1434,7 +1430,7 @@ static int snd_opti93x_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
1434 | .get = snd_opti93x_get_single, .put = snd_opti93x_put_single, \ | 1430 | .get = snd_opti93x_get_single, .put = snd_opti93x_put_single, \ |
1435 | .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } | 1431 | .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } |
1436 | 1432 | ||
1437 | static int snd_opti93x_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1433 | static int snd_opti93x_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1438 | { | 1434 | { |
1439 | int mask = (kcontrol->private_value >> 16) & 0xff; | 1435 | int mask = (kcontrol->private_value >> 16) & 0xff; |
1440 | 1436 | ||
@@ -1445,9 +1441,9 @@ static int snd_opti93x_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1445 | return 0; | 1441 | return 0; |
1446 | } | 1442 | } |
1447 | 1443 | ||
1448 | static int snd_opti93x_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1444 | static int snd_opti93x_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1449 | { | 1445 | { |
1450 | opti93x_t *chip = snd_kcontrol_chip(kcontrol); | 1446 | struct snd_opti93x *chip = snd_kcontrol_chip(kcontrol); |
1451 | unsigned long flags; | 1447 | unsigned long flags; |
1452 | int reg = kcontrol->private_value & 0xff; | 1448 | int reg = kcontrol->private_value & 0xff; |
1453 | int shift = (kcontrol->private_value >> 8) & 0xff; | 1449 | int shift = (kcontrol->private_value >> 8) & 0xff; |
@@ -1462,9 +1458,9 @@ static int snd_opti93x_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
1462 | return 0; | 1458 | return 0; |
1463 | } | 1459 | } |
1464 | 1460 | ||
1465 | static int snd_opti93x_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1461 | static int snd_opti93x_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1466 | { | 1462 | { |
1467 | opti93x_t *chip = snd_kcontrol_chip(kcontrol); | 1463 | struct snd_opti93x *chip = snd_kcontrol_chip(kcontrol); |
1468 | unsigned long flags; | 1464 | unsigned long flags; |
1469 | int reg = kcontrol->private_value & 0xff; | 1465 | int reg = kcontrol->private_value & 0xff; |
1470 | int shift = (kcontrol->private_value >> 8) & 0xff; | 1466 | int shift = (kcontrol->private_value >> 8) & 0xff; |
@@ -1499,7 +1495,7 @@ static int snd_opti93x_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
1499 | do { xctl.private_value &= ~0x0000ffff; \ | 1495 | do { xctl.private_value &= ~0x0000ffff; \ |
1500 | xctl.private_value |= left_reg | (right_reg << 8); } while (0) | 1496 | xctl.private_value |= left_reg | (right_reg << 8); } while (0) |
1501 | 1497 | ||
1502 | static int snd_opti93x_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1498 | static int snd_opti93x_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1503 | { | 1499 | { |
1504 | int mask = (kcontrol->private_value >> 24) & 0xff; | 1500 | int mask = (kcontrol->private_value >> 24) & 0xff; |
1505 | 1501 | ||
@@ -1510,9 +1506,9 @@ static int snd_opti93x_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1510 | return 0; | 1506 | return 0; |
1511 | } | 1507 | } |
1512 | 1508 | ||
1513 | static int snd_opti93x_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1509 | static int snd_opti93x_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1514 | { | 1510 | { |
1515 | opti93x_t *chip = snd_kcontrol_chip(kcontrol); | 1511 | struct snd_opti93x *chip = snd_kcontrol_chip(kcontrol); |
1516 | unsigned long flags; | 1512 | unsigned long flags; |
1517 | int left_reg = kcontrol->private_value & 0xff; | 1513 | int left_reg = kcontrol->private_value & 0xff; |
1518 | int right_reg = (kcontrol->private_value >> 8) & 0xff; | 1514 | int right_reg = (kcontrol->private_value >> 8) & 0xff; |
@@ -1532,9 +1528,9 @@ static int snd_opti93x_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
1532 | return 0; | 1528 | return 0; |
1533 | } | 1529 | } |
1534 | 1530 | ||
1535 | static int snd_opti93x_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1531 | static int snd_opti93x_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1536 | { | 1532 | { |
1537 | opti93x_t *chip = snd_kcontrol_chip(kcontrol); | 1533 | struct snd_opti93x *chip = snd_kcontrol_chip(kcontrol); |
1538 | unsigned long flags; | 1534 | unsigned long flags; |
1539 | int left_reg = kcontrol->private_value & 0xff; | 1535 | int left_reg = kcontrol->private_value & 0xff; |
1540 | int right_reg = (kcontrol->private_value >> 8) & 0xff; | 1536 | int right_reg = (kcontrol->private_value >> 8) & 0xff; |
@@ -1563,7 +1559,7 @@ static int snd_opti93x_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
1563 | return change; | 1559 | return change; |
1564 | } | 1560 | } |
1565 | 1561 | ||
1566 | static snd_kcontrol_new_t snd_opti93x_controls[] = { | 1562 | static struct snd_kcontrol_new snd_opti93x_controls[] = { |
1567 | OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), | 1563 | OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), |
1568 | OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1), | 1564 | OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1), |
1569 | OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1), | 1565 | OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1), |
@@ -1589,10 +1585,10 @@ OPTi93X_DOUBLE("Capture Volume", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 0 | |||
1589 | } | 1585 | } |
1590 | }; | 1586 | }; |
1591 | 1587 | ||
1592 | static int snd_opti93x_mixer(opti93x_t *chip) | 1588 | static int snd_opti93x_mixer(struct snd_opti93x *chip) |
1593 | { | 1589 | { |
1594 | snd_card_t *card; | 1590 | struct snd_card *card; |
1595 | snd_kcontrol_new_t knew; | 1591 | struct snd_kcontrol_new knew; |
1596 | int err; | 1592 | int err; |
1597 | unsigned int idx; | 1593 | unsigned int idx; |
1598 | 1594 | ||
@@ -1624,7 +1620,7 @@ static int snd_opti93x_mixer(opti93x_t *chip) | |||
1624 | 1620 | ||
1625 | #endif /* OPTi93X */ | 1621 | #endif /* OPTi93X */ |
1626 | 1622 | ||
1627 | static int __devinit snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip) | 1623 | static int __devinit snd_card_opti9xx_detect(struct snd_card *card, struct snd_opti9xx *chip) |
1628 | { | 1624 | { |
1629 | int i, err; | 1625 | int i, err; |
1630 | 1626 | ||
@@ -1678,7 +1674,7 @@ static int __devinit snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip) | |||
1678 | } | 1674 | } |
1679 | 1675 | ||
1680 | #ifdef CONFIG_PNP | 1676 | #ifdef CONFIG_PNP |
1681 | static int __devinit snd_card_opti9xx_pnp(opti9xx_t *chip, struct pnp_card_link *card, | 1677 | static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, struct pnp_card_link *card, |
1682 | const struct pnp_card_device_id *pid) | 1678 | const struct pnp_card_device_id *pid) |
1683 | { | 1679 | { |
1684 | struct pnp_dev *pdev; | 1680 | struct pnp_dev *pdev; |
@@ -1772,7 +1768,7 @@ static int __devinit snd_card_opti9xx_pnp(opti9xx_t *chip, struct pnp_card_link | |||
1772 | 1768 | ||
1773 | #if 0 | 1769 | #if 0 |
1774 | static int __devinit snd_card_opti9xx_resources(struct snd_card_opti9xx *chip, | 1770 | static int __devinit snd_card_opti9xx_resources(struct snd_card_opti9xx *chip, |
1775 | snd_card_t *card) | 1771 | struct snd_card *card) |
1776 | { | 1772 | { |
1777 | int error, i, pnp = 0; | 1773 | int error, i, pnp = 0; |
1778 | 1774 | ||
@@ -1867,9 +1863,9 @@ static int __devinit snd_card_opti9xx_resources(struct snd_card_opti9xx *chip, | |||
1867 | } | 1863 | } |
1868 | #endif | 1864 | #endif |
1869 | 1865 | ||
1870 | static void snd_card_opti9xx_free(snd_card_t *card) | 1866 | static void snd_card_opti9xx_free(struct snd_card *card) |
1871 | { | 1867 | { |
1872 | opti9xx_t *chip = (opti9xx_t *)card->private_data; | 1868 | struct snd_opti9xx *chip = (struct snd_opti9xx *)card->private_data; |
1873 | 1869 | ||
1874 | if (chip) | 1870 | if (chip) |
1875 | release_and_free_resource(chip->res_mc_base); | 1871 | release_and_free_resource(chip->res_mc_base); |
@@ -1891,19 +1887,19 @@ static int snd_card_opti9xx_probe(struct pnp_card_link *pcard, | |||
1891 | static int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}}; | 1887 | static int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}}; |
1892 | #endif /* CS4231 || OPTi93X */ | 1888 | #endif /* CS4231 || OPTi93X */ |
1893 | int error; | 1889 | int error; |
1894 | opti9xx_t *chip; | 1890 | struct snd_opti9xx *chip; |
1895 | #if defined(OPTi93X) | 1891 | #if defined(OPTi93X) |
1896 | opti93x_t *codec; | 1892 | struct snd_opti93x *codec; |
1897 | #elif defined(CS4231) | 1893 | #elif defined(CS4231) |
1898 | cs4231_t *codec; | 1894 | struct snd_cs4231 *codec; |
1899 | snd_timer_t *timer; | 1895 | struct snd_timer *timer; |
1900 | #else | 1896 | #else |
1901 | ad1848_t *codec; | 1897 | struct snd_ad1848 *codec; |
1902 | #endif | 1898 | #endif |
1903 | snd_card_t *card; | 1899 | struct snd_card *card; |
1904 | snd_pcm_t *pcm; | 1900 | struct snd_pcm *pcm; |
1905 | snd_rawmidi_t *rmidi; | 1901 | struct snd_rawmidi *rmidi; |
1906 | snd_hwdep_t *synth; | 1902 | struct snd_hwdep *synth; |
1907 | #ifdef CONFIG_PNP | 1903 | #ifdef CONFIG_PNP |
1908 | int hw; | 1904 | int hw; |
1909 | #endif /* CONFIG_PNP */ | 1905 | #endif /* CONFIG_PNP */ |
@@ -1911,10 +1907,10 @@ static int snd_card_opti9xx_probe(struct pnp_card_link *pcard, | |||
1911 | if (pcard && !snd_opti9xx_first_hit) | 1907 | if (pcard && !snd_opti9xx_first_hit) |
1912 | return -EBUSY; | 1908 | return -EBUSY; |
1913 | if (!(card = snd_card_new(index, id, THIS_MODULE, | 1909 | if (!(card = snd_card_new(index, id, THIS_MODULE, |
1914 | sizeof(opti9xx_t)))) | 1910 | sizeof(struct snd_opti9xx)))) |
1915 | return -ENOMEM; | 1911 | return -ENOMEM; |
1916 | card->private_free = snd_card_opti9xx_free; | 1912 | card->private_free = snd_card_opti9xx_free; |
1917 | chip = (opti9xx_t *)card->private_data; | 1913 | chip = (struct snd_opti9xx *)card->private_data; |
1918 | 1914 | ||
1919 | #ifdef CONFIG_PNP | 1915 | #ifdef CONFIG_PNP |
1920 | if (isapnp && pcard && (hw = snd_card_opti9xx_pnp(chip, pcard, pid)) > 0) { | 1916 | if (isapnp && pcard && (hw = snd_card_opti9xx_pnp(chip, pcard, pid)) > 0) { |
@@ -2098,12 +2094,12 @@ static int snd_card_opti9xx_probe(struct pnp_card_link *pcard, | |||
2098 | snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port); | 2094 | snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port); |
2099 | 2095 | ||
2100 | if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) { | 2096 | if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) { |
2101 | opl3_t *opl3 = NULL; | 2097 | struct snd_opl3 *opl3 = NULL; |
2102 | #ifndef OPTi93X | 2098 | #ifndef OPTi93X |
2103 | if (chip->hardware == OPTi9XX_HW_82C928 || | 2099 | if (chip->hardware == OPTi9XX_HW_82C928 || |
2104 | chip->hardware == OPTi9XX_HW_82C929 || | 2100 | chip->hardware == OPTi9XX_HW_82C929 || |
2105 | chip->hardware == OPTi9XX_HW_82C924) { | 2101 | chip->hardware == OPTi9XX_HW_82C924) { |
2106 | opl4_t *opl4; | 2102 | struct snd_opl4 *opl4; |
2107 | /* assume we have an OPL4 */ | 2103 | /* assume we have an OPL4 */ |
2108 | snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(2), | 2104 | snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(2), |
2109 | 0x20, 0x20); | 2105 | 0x20, 0x20); |
@@ -2156,7 +2152,7 @@ static int snd_card_opti9xx_probe(struct pnp_card_link *pcard, | |||
2156 | #ifdef CONFIG_PNP | 2152 | #ifdef CONFIG_PNP |
2157 | static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard) | 2153 | static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard) |
2158 | { | 2154 | { |
2159 | snd_card_t *card = (snd_card_t *) pnp_get_card_drvdata(pcard); | 2155 | struct snd_card *card = (struct snd_card *) pnp_get_card_drvdata(pcard); |
2160 | 2156 | ||
2161 | snd_card_disconnect(card); | 2157 | snd_card_disconnect(card); |
2162 | snd_card_free_in_thread(card); | 2158 | snd_card_free_in_thread(card); |