aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ali5451/ali5451.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ali5451/ali5451.c')
-rw-r--r--sound/pci/ali5451/ali5451.c368
1 files changed, 183 insertions, 185 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 21be4c26ebc4..2538cda2521d 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -170,10 +170,10 @@ module_param(enable, bool, 0444);
170#define MAX_CODECS 2 170#define MAX_CODECS 2
171 171
172 172
173typedef struct snd_stru_ali ali_t; 173struct snd_ali;
174typedef struct snd_ali_stru_voice snd_ali_voice_t; 174struct snd_ali_voice;
175 175
176typedef struct snd_ali_channel_control { 176struct snd_ali_channel_control {
177 // register data 177 // register data
178 struct REGDATA { 178 struct REGDATA {
179 unsigned int start; 179 unsigned int start;
@@ -192,9 +192,9 @@ typedef struct snd_ali_channel_control {
192 unsigned int ac97write; 192 unsigned int ac97write;
193 } regs; 193 } regs;
194 194
195} snd_ali_channel_control_t; 195};
196 196
197struct snd_ali_stru_voice { 197struct snd_ali_voice {
198 unsigned int number; 198 unsigned int number;
199 unsigned int use: 1, 199 unsigned int use: 1,
200 pcm: 1, 200 pcm: 1,
@@ -203,9 +203,9 @@ struct snd_ali_stru_voice {
203 synth: 1; 203 synth: 1;
204 204
205 /* PCM data */ 205 /* PCM data */
206 ali_t *codec; 206 struct snd_ali *codec;
207 snd_pcm_substream_t *substream; 207 struct snd_pcm_substream *substream;
208 snd_ali_voice_t *extra; 208 struct snd_ali_voice *extra;
209 209
210 unsigned int running: 1; 210 unsigned int running: 1;
211 211
@@ -219,28 +219,28 @@ struct snd_ali_stru_voice {
219}; 219};
220 220
221 221
222typedef struct snd_stru_alidev { 222struct snd_alidev {
223 223
224 snd_ali_voice_t voices[ALI_CHANNELS]; 224 struct snd_ali_voice voices[ALI_CHANNELS];
225 225
226 unsigned int chcnt; /* num of opened channels */ 226 unsigned int chcnt; /* num of opened channels */
227 unsigned int chmap; /* bitmap for opened channels */ 227 unsigned int chmap; /* bitmap for opened channels */
228 unsigned int synthcount; 228 unsigned int synthcount;
229 229
230} alidev_t; 230};
231 231
232 232
233#ifdef CONFIG_PM 233#ifdef CONFIG_PM
234#define ALI_GLOBAL_REGS 56 234#define ALI_GLOBAL_REGS 56
235#define ALI_CHANNEL_REGS 8 235#define ALI_CHANNEL_REGS 8
236typedef struct snd_ali_image { 236struct snd_ali_image {
237 unsigned long regs[ALI_GLOBAL_REGS]; 237 unsigned long regs[ALI_GLOBAL_REGS];
238 unsigned long channel_regs[ALI_CHANNELS][ALI_CHANNEL_REGS]; 238 unsigned long channel_regs[ALI_CHANNELS][ALI_CHANNEL_REGS];
239} ali_image_t; 239};
240#endif 240#endif
241 241
242 242
243struct snd_stru_ali { 243struct snd_ali {
244 unsigned long irq; 244 unsigned long irq;
245 unsigned long port; 245 unsigned long port;
246 unsigned char revision; 246 unsigned char revision;
@@ -252,10 +252,10 @@ struct snd_stru_ali {
252 struct pci_dev *pci_m1533; 252 struct pci_dev *pci_m1533;
253 struct pci_dev *pci_m7101; 253 struct pci_dev *pci_m7101;
254 254
255 snd_card_t *card; 255 struct snd_card *card;
256 snd_pcm_t *pcm[MAX_CODECS]; 256 struct snd_pcm *pcm[MAX_CODECS];
257 alidev_t synth; 257 struct snd_alidev synth;
258 snd_ali_channel_control_t chregs; 258 struct snd_ali_channel_control chregs;
259 259
260 /* S/PDIF Mask */ 260 /* S/PDIF Mask */
261 unsigned int spdif_mask; 261 unsigned int spdif_mask;
@@ -265,8 +265,8 @@ struct snd_stru_ali {
265 265
266 unsigned int num_of_codecs; 266 unsigned int num_of_codecs;
267 267
268 ac97_bus_t *ac97_bus; 268 struct snd_ac97_bus *ac97_bus;
269 ac97_t *ac97[MAX_CODECS]; 269 struct snd_ac97 *ac97[MAX_CODECS];
270 unsigned short ac97_ext_id; 270 unsigned short ac97_ext_id;
271 unsigned short ac97_ext_status; 271 unsigned short ac97_ext_status;
272 272
@@ -274,7 +274,7 @@ struct snd_stru_ali {
274 spinlock_t voice_alloc; 274 spinlock_t voice_alloc;
275 275
276#ifdef CONFIG_PM 276#ifdef CONFIG_PM
277 ali_image_t *image; 277 struct snd_ali_image *image;
278#endif 278#endif
279}; 279};
280 280
@@ -284,9 +284,9 @@ static struct pci_device_id snd_ali_ids[] = {
284}; 284};
285MODULE_DEVICE_TABLE(pci, snd_ali_ids); 285MODULE_DEVICE_TABLE(pci, snd_ali_ids);
286 286
287static void snd_ali_clear_voices(ali_t *, unsigned int, unsigned int); 287static void snd_ali_clear_voices(struct snd_ali *, unsigned int, unsigned int);
288static unsigned short snd_ali_codec_peek(ali_t *, int, unsigned short); 288static unsigned short snd_ali_codec_peek(struct snd_ali *, int, unsigned short);
289static void snd_ali_codec_poke(ali_t *, int, unsigned short, unsigned short); 289static void snd_ali_codec_poke(struct snd_ali *, int, unsigned short, unsigned short);
290 290
291/* 291/*
292 * Debug Part 292 * Debug Part
@@ -294,7 +294,7 @@ static void snd_ali_codec_poke(ali_t *, int, unsigned short, unsigned short);
294 294
295#ifdef ALI_DEBUG 295#ifdef ALI_DEBUG
296 296
297static void ali_read_regs(ali_t *codec, int channel) 297static void ali_read_regs(struct snd_ali *codec, int channel)
298{ 298{
299 int i,j; 299 int i,j;
300 unsigned int dwVal; 300 unsigned int dwVal;
@@ -344,7 +344,7 @@ static void ali_read_cfg(unsigned int vendor, unsigned deviceid)
344 } 344 }
345 pci_dev_put(pci_dev); 345 pci_dev_put(pci_dev);
346 } 346 }
347static void ali_read_ac97regs(ali_t *codec, int secondary) 347static void ali_read_ac97regs(struct snd_ali *codec, int secondary)
348{ 348{
349 unsigned short i,j; 349 unsigned short i,j;
350 unsigned short wVal; 350 unsigned short wVal;
@@ -373,20 +373,20 @@ static void ali_read_ac97regs(ali_t *codec, int secondary)
373 * AC97 ACCESS 373 * AC97 ACCESS
374 */ 374 */
375 375
376static inline unsigned int snd_ali_5451_peek(ali_t *codec, 376static inline unsigned int snd_ali_5451_peek(struct snd_ali *codec,
377 unsigned int port ) 377 unsigned int port )
378{ 378{
379 return (unsigned int)inl(ALI_REG(codec, port)); 379 return (unsigned int)inl(ALI_REG(codec, port));
380} 380}
381 381
382static inline void snd_ali_5451_poke( ali_t *codec, 382static inline void snd_ali_5451_poke( struct snd_ali *codec,
383 unsigned int port, 383 unsigned int port,
384 unsigned int val ) 384 unsigned int val )
385{ 385{
386 outl((unsigned int)val, ALI_REG(codec, port)); 386 outl((unsigned int)val, ALI_REG(codec, port));
387} 387}
388 388
389static int snd_ali_codec_ready( ali_t *codec, 389static int snd_ali_codec_ready( struct snd_ali *codec,
390 unsigned int port ) 390 unsigned int port )
391{ 391{
392 unsigned long end_time; 392 unsigned long end_time;
@@ -404,7 +404,7 @@ static int snd_ali_codec_ready( ali_t *codec,
404 return -EIO; 404 return -EIO;
405} 405}
406 406
407static int snd_ali_stimer_ready(ali_t *codec) 407static int snd_ali_stimer_ready(struct snd_ali *codec)
408{ 408{
409 unsigned long end_time; 409 unsigned long end_time;
410 unsigned long dwChk1,dwChk2; 410 unsigned long dwChk1,dwChk2;
@@ -423,7 +423,7 @@ static int snd_ali_stimer_ready(ali_t *codec)
423 return -EIO; 423 return -EIO;
424} 424}
425 425
426static void snd_ali_codec_poke(ali_t *codec,int secondary, 426static void snd_ali_codec_poke(struct snd_ali *codec,int secondary,
427 unsigned short reg, 427 unsigned short reg,
428 unsigned short val) 428 unsigned short val)
429{ 429{
@@ -452,7 +452,7 @@ static void snd_ali_codec_poke(ali_t *codec,int secondary,
452 return ; 452 return ;
453} 453}
454 454
455static unsigned short snd_ali_codec_peek( ali_t *codec, 455static unsigned short snd_ali_codec_peek( struct snd_ali *codec,
456 int secondary, 456 int secondary,
457 unsigned short reg) 457 unsigned short reg)
458{ 458{
@@ -485,11 +485,11 @@ static unsigned short snd_ali_codec_peek( ali_t *codec,
485 return (snd_ali_5451_peek(codec, port) & 0xffff0000)>>16; 485 return (snd_ali_5451_peek(codec, port) & 0xffff0000)>>16;
486} 486}
487 487
488static void snd_ali_codec_write(ac97_t *ac97, 488static void snd_ali_codec_write(struct snd_ac97 *ac97,
489 unsigned short reg, 489 unsigned short reg,
490 unsigned short val ) 490 unsigned short val )
491{ 491{
492 ali_t *codec = ac97->private_data; 492 struct snd_ali *codec = ac97->private_data;
493 493
494 snd_ali_printk("codec_write: reg=%xh data=%xh.\n", reg, val); 494 snd_ali_printk("codec_write: reg=%xh data=%xh.\n", reg, val);
495 if(reg == AC97_GPIO_STATUS) { 495 if(reg == AC97_GPIO_STATUS) {
@@ -502,9 +502,9 @@ static void snd_ali_codec_write(ac97_t *ac97,
502} 502}
503 503
504 504
505static unsigned short snd_ali_codec_read(ac97_t *ac97, unsigned short reg) 505static unsigned short snd_ali_codec_read(struct snd_ac97 *ac97, unsigned short reg)
506{ 506{
507 ali_t *codec = ac97->private_data; 507 struct snd_ali *codec = ac97->private_data;
508 508
509 snd_ali_printk("codec_read reg=%xh.\n", reg); 509 snd_ali_printk("codec_read reg=%xh.\n", reg);
510 return (snd_ali_codec_peek(codec, ac97->num, reg)); 510 return (snd_ali_codec_peek(codec, ac97->num, reg));
@@ -514,7 +514,7 @@ static unsigned short snd_ali_codec_read(ac97_t *ac97, unsigned short reg)
514 * AC97 Reset 514 * AC97 Reset
515 */ 515 */
516 516
517static int snd_ali_reset_5451(ali_t *codec) 517static int snd_ali_reset_5451(struct snd_ali *codec)
518{ 518{
519 struct pci_dev *pci_dev = NULL; 519 struct pci_dev *pci_dev = NULL;
520 unsigned short wCount, wReg; 520 unsigned short wCount, wReg;
@@ -552,7 +552,7 @@ static int snd_ali_reset_5451(ali_t *codec)
552 552
553#ifdef CODEC_RESET 553#ifdef CODEC_RESET
554 554
555static int snd_ali_reset_codec(ali_t *codec) 555static int snd_ali_reset_codec(struct snd_ali *codec)
556{ 556{
557 struct pci_dev *pci_dev = NULL; 557 struct pci_dev *pci_dev = NULL;
558 unsigned char bVal = 0; 558 unsigned char bVal = 0;
@@ -593,7 +593,7 @@ static int snd_ali_reset_codec(ali_t *codec)
593 * ALI 5451 Controller 593 * ALI 5451 Controller
594 */ 594 */
595 595
596static void snd_ali_enable_special_channel(ali_t *codec, unsigned int channel) 596static void snd_ali_enable_special_channel(struct snd_ali *codec, unsigned int channel)
597{ 597{
598 unsigned long dwVal = 0; 598 unsigned long dwVal = 0;
599 599
@@ -602,7 +602,7 @@ static void snd_ali_enable_special_channel(ali_t *codec, unsigned int channel)
602 outl(dwVal, ALI_REG(codec,ALI_GLOBAL_CONTROL)); 602 outl(dwVal, ALI_REG(codec,ALI_GLOBAL_CONTROL));
603} 603}
604 604
605static void snd_ali_disable_special_channel(ali_t *codec, unsigned int channel) 605static void snd_ali_disable_special_channel(struct snd_ali *codec, unsigned int channel)
606{ 606{
607 unsigned long dwVal = 0; 607 unsigned long dwVal = 0;
608 608
@@ -611,7 +611,7 @@ static void snd_ali_disable_special_channel(ali_t *codec, unsigned int channel)
611 outl(dwVal, ALI_REG(codec,ALI_GLOBAL_CONTROL)); 611 outl(dwVal, ALI_REG(codec,ALI_GLOBAL_CONTROL));
612} 612}
613 613
614static void snd_ali_enable_address_interrupt(ali_t * codec) 614static void snd_ali_enable_address_interrupt(struct snd_ali * codec)
615{ 615{
616 unsigned int gc; 616 unsigned int gc;
617 617
@@ -621,7 +621,7 @@ static void snd_ali_enable_address_interrupt(ali_t * codec)
621 outl( gc, ALI_REG(codec, ALI_GC_CIR)); 621 outl( gc, ALI_REG(codec, ALI_GC_CIR));
622} 622}
623 623
624static void snd_ali_disable_address_interrupt(ali_t * codec) 624static void snd_ali_disable_address_interrupt(struct snd_ali * codec)
625{ 625{
626 unsigned int gc; 626 unsigned int gc;
627 627
@@ -632,10 +632,10 @@ static void snd_ali_disable_address_interrupt(ali_t * codec)
632} 632}
633 633
634#if 0 // not used 634#if 0 // not used
635static void snd_ali_enable_voice_irq(ali_t *codec, unsigned int channel) 635static void snd_ali_enable_voice_irq(struct snd_ali *codec, unsigned int channel)
636{ 636{
637 unsigned int mask; 637 unsigned int mask;
638 snd_ali_channel_control_t *pchregs = &(codec->chregs); 638 struct snd_ali_channel_control *pchregs = &(codec->chregs);
639 639
640 snd_ali_printk("enable_voice_irq channel=%d\n",channel); 640 snd_ali_printk("enable_voice_irq channel=%d\n",channel);
641 641
@@ -646,10 +646,10 @@ static void snd_ali_enable_voice_irq(ali_t *codec, unsigned int channel)
646} 646}
647#endif 647#endif
648 648
649static void snd_ali_disable_voice_irq(ali_t *codec, unsigned int channel) 649static void snd_ali_disable_voice_irq(struct snd_ali *codec, unsigned int channel)
650{ 650{
651 unsigned int mask; 651 unsigned int mask;
652 snd_ali_channel_control_t *pchregs = &(codec->chregs); 652 struct snd_ali_channel_control *pchregs = &(codec->chregs);
653 653
654 snd_ali_printk("disable_voice_irq channel=%d\n",channel); 654 snd_ali_printk("disable_voice_irq channel=%d\n",channel);
655 655
@@ -659,7 +659,7 @@ static void snd_ali_disable_voice_irq(ali_t *codec, unsigned int channel)
659 outl(pchregs->data.ainten,ALI_REG(codec,pchregs->regs.ainten)); 659 outl(pchregs->data.ainten,ALI_REG(codec,pchregs->regs.ainten));
660} 660}
661 661
662static int snd_ali_alloc_pcm_channel(ali_t *codec, int channel) 662static int snd_ali_alloc_pcm_channel(struct snd_ali *codec, int channel)
663{ 663{
664 unsigned int idx = channel & 0x1f; 664 unsigned int idx = channel & 0x1f;
665 665
@@ -677,7 +677,7 @@ static int snd_ali_alloc_pcm_channel(ali_t *codec, int channel)
677 return -1; 677 return -1;
678} 678}
679 679
680static int snd_ali_find_free_channel(ali_t * codec, int rec) 680static int snd_ali_find_free_channel(struct snd_ali * codec, int rec)
681{ 681{
682 int idx; 682 int idx;
683 int result = -1; 683 int result = -1;
@@ -719,7 +719,7 @@ static int snd_ali_find_free_channel(ali_t * codec, int rec)
719 return -1; 719 return -1;
720} 720}
721 721
722static void snd_ali_free_channel_pcm(ali_t *codec, int channel) 722static void snd_ali_free_channel_pcm(struct snd_ali *codec, int channel)
723{ 723{
724 unsigned int idx = channel & 0x0000001f; 724 unsigned int idx = channel & 0x0000001f;
725 725
@@ -738,7 +738,7 @@ static void snd_ali_free_channel_pcm(ali_t *codec, int channel)
738} 738}
739 739
740#if 0 // not used 740#if 0 // not used
741static void snd_ali_start_voice(ali_t * codec, unsigned int channel) 741static void snd_ali_start_voice(struct snd_ali * codec, unsigned int channel)
742{ 742{
743 unsigned int mask = 1 << (channel & 0x1f); 743 unsigned int mask = 1 << (channel & 0x1f);
744 744
@@ -747,7 +747,7 @@ static void snd_ali_start_voice(ali_t * codec, unsigned int channel)
747} 747}
748#endif 748#endif
749 749
750static void snd_ali_stop_voice(ali_t * codec, unsigned int channel) 750static void snd_ali_stop_voice(struct snd_ali * codec, unsigned int channel)
751{ 751{
752 unsigned int mask = 1 << (channel & 0x1f); 752 unsigned int mask = 1 << (channel & 0x1f);
753 753
@@ -759,7 +759,7 @@ static void snd_ali_stop_voice(ali_t * codec, unsigned int channel)
759 * S/PDIF Part 759 * S/PDIF Part
760 */ 760 */
761 761
762static void snd_ali_delay(ali_t *codec,int interval) 762static void snd_ali_delay(struct snd_ali *codec,int interval)
763{ 763{
764 unsigned long begintimer,currenttimer; 764 unsigned long begintimer,currenttimer;
765 765
@@ -773,7 +773,7 @@ static void snd_ali_delay(ali_t *codec,int interval)
773 } 773 }
774} 774}
775 775
776static void snd_ali_detect_spdif_rate(ali_t *codec) 776static void snd_ali_detect_spdif_rate(struct snd_ali *codec)
777{ 777{
778 u16 wval = 0; 778 u16 wval = 0;
779 u16 count = 0; 779 u16 count = 0;
@@ -827,7 +827,7 @@ static void snd_ali_detect_spdif_rate(ali_t *codec)
827 } 827 }
828} 828}
829 829
830static unsigned int snd_ali_get_spdif_in_rate(ali_t *codec) 830static unsigned int snd_ali_get_spdif_in_rate(struct snd_ali *codec)
831{ 831{
832 u32 dwRate = 0; 832 u32 dwRate = 0;
833 u8 bval = 0; 833 u8 bval = 0;
@@ -849,7 +849,7 @@ static unsigned int snd_ali_get_spdif_in_rate(ali_t *codec)
849 return dwRate; 849 return dwRate;
850} 850}
851 851
852static void snd_ali_enable_spdif_in(ali_t *codec) 852static void snd_ali_enable_spdif_in(struct snd_ali *codec)
853{ 853{
854 unsigned int dwVal; 854 unsigned int dwVal;
855 855
@@ -864,7 +864,7 @@ static void snd_ali_enable_spdif_in(ali_t *codec)
864 snd_ali_enable_special_channel(codec, ALI_SPDIF_IN_CHANNEL); 864 snd_ali_enable_special_channel(codec, ALI_SPDIF_IN_CHANNEL);
865} 865}
866 866
867static void snd_ali_disable_spdif_in(ali_t *codec) 867static void snd_ali_disable_spdif_in(struct snd_ali *codec)
868{ 868{
869 unsigned int dwVal; 869 unsigned int dwVal;
870 870
@@ -876,7 +876,7 @@ static void snd_ali_disable_spdif_in(ali_t *codec)
876} 876}
877 877
878 878
879static void snd_ali_set_spdif_out_rate(ali_t *codec, unsigned int rate) 879static void snd_ali_set_spdif_out_rate(struct snd_ali *codec, unsigned int rate)
880{ 880{
881 unsigned char bVal; 881 unsigned char bVal;
882 unsigned int dwRate = 0; 882 unsigned int dwRate = 0;
@@ -897,7 +897,7 @@ static void snd_ali_set_spdif_out_rate(ali_t *codec, unsigned int rate)
897 outw(rate | 0x10, ALI_REG(codec, ALI_SPDIF_CS + 2)); 897 outw(rate | 0x10, ALI_REG(codec, ALI_SPDIF_CS + 2));
898} 898}
899 899
900static void snd_ali_enable_spdif_out(ali_t *codec) 900static void snd_ali_enable_spdif_out(struct snd_ali *codec)
901{ 901{
902 unsigned short wVal; 902 unsigned short wVal;
903 unsigned char bVal; 903 unsigned char bVal;
@@ -933,7 +933,7 @@ static void snd_ali_enable_spdif_out(ali_t *codec)
933 } 933 }
934} 934}
935 935
936static void snd_ali_enable_spdif_chnout(ali_t *codec) 936static void snd_ali_enable_spdif_chnout(struct snd_ali *codec)
937{ 937{
938 unsigned short wVal = 0; 938 unsigned short wVal = 0;
939 939
@@ -951,7 +951,7 @@ static void snd_ali_enable_spdif_chnout(ali_t *codec)
951 snd_ali_enable_special_channel(codec,ALI_SPDIF_OUT_CHANNEL); 951 snd_ali_enable_special_channel(codec,ALI_SPDIF_OUT_CHANNEL);
952} 952}
953 953
954static void snd_ali_disable_spdif_chnout(ali_t *codec) 954static void snd_ali_disable_spdif_chnout(struct snd_ali *codec)
955{ 955{
956 unsigned short wVal = 0; 956 unsigned short wVal = 0;
957 wVal = inw(ALI_REG(codec, ALI_GLOBAL_CONTROL)); 957 wVal = inw(ALI_REG(codec, ALI_GLOBAL_CONTROL));
@@ -961,7 +961,7 @@ static void snd_ali_disable_spdif_chnout(ali_t *codec)
961 snd_ali_enable_special_channel(codec, ALI_SPDIF_OUT_CHANNEL); 961 snd_ali_enable_special_channel(codec, ALI_SPDIF_OUT_CHANNEL);
962} 962}
963 963
964static void snd_ali_disable_spdif_out(ali_t *codec) 964static void snd_ali_disable_spdif_out(struct snd_ali *codec)
965{ 965{
966 unsigned char bVal; 966 unsigned char bVal;
967 967
@@ -971,11 +971,11 @@ static void snd_ali_disable_spdif_out(ali_t *codec)
971 snd_ali_disable_spdif_chnout(codec); 971 snd_ali_disable_spdif_chnout(codec);
972} 972}
973 973
974static void snd_ali_update_ptr(ali_t *codec,int channel) 974static void snd_ali_update_ptr(struct snd_ali *codec,int channel)
975{ 975{
976 snd_ali_voice_t *pvoice = NULL; 976 struct snd_ali_voice *pvoice = NULL;
977 snd_pcm_runtime_t *runtime; 977 struct snd_pcm_runtime *runtime;
978 snd_ali_channel_control_t *pchregs = NULL; 978 struct snd_ali_channel_control *pchregs = NULL;
979 unsigned int old, mask; 979 unsigned int old, mask;
980#ifdef ALI_DEBUG 980#ifdef ALI_DEBUG
981 unsigned int temp, cspf; 981 unsigned int temp, cspf;
@@ -1026,11 +1026,11 @@ static void snd_ali_update_ptr(ali_t *codec,int channel)
1026 pchregs->data.aint = old & (~mask); 1026 pchregs->data.aint = old & (~mask);
1027} 1027}
1028 1028
1029static void snd_ali_interrupt(ali_t * codec) 1029static void snd_ali_interrupt(struct snd_ali * codec)
1030{ 1030{
1031 int channel; 1031 int channel;
1032 unsigned int audio_int; 1032 unsigned int audio_int;
1033 snd_ali_channel_control_t *pchregs = NULL; 1033 struct snd_ali_channel_control *pchregs = NULL;
1034 pchregs = &(codec->chregs); 1034 pchregs = &(codec->chregs);
1035 1035
1036 audio_int = inl(ALI_REG(codec, ALI_MISCINT)); 1036 audio_int = inl(ALI_REG(codec, ALI_MISCINT));
@@ -1050,7 +1050,7 @@ static irqreturn_t snd_ali_card_interrupt(int irq,
1050 void *dev_id, 1050 void *dev_id,
1051 struct pt_regs *regs) 1051 struct pt_regs *regs)
1052{ 1052{
1053 ali_t *codec = dev_id; 1053 struct snd_ali *codec = dev_id;
1054 1054
1055 if (codec == NULL) 1055 if (codec == NULL)
1056 return IRQ_NONE; 1056 return IRQ_NONE;
@@ -1059,9 +1059,9 @@ static irqreturn_t snd_ali_card_interrupt(int irq,
1059} 1059}
1060 1060
1061 1061
1062static snd_ali_voice_t *snd_ali_alloc_voice(ali_t * codec, int type, int rec, int channel) 1062static struct snd_ali_voice *snd_ali_alloc_voice(struct snd_ali * codec, int type, int rec, int channel)
1063{ 1063{
1064 snd_ali_voice_t *pvoice = NULL; 1064 struct snd_ali_voice *pvoice = NULL;
1065 int idx; 1065 int idx;
1066 1066
1067 snd_ali_printk("alloc_voice: type=%d rec=%d\n",type,rec); 1067 snd_ali_printk("alloc_voice: type=%d rec=%d\n",type,rec);
@@ -1088,7 +1088,7 @@ static snd_ali_voice_t *snd_ali_alloc_voice(ali_t * codec, int type, int rec, in
1088} 1088}
1089 1089
1090 1090
1091static void snd_ali_free_voice(ali_t * codec, snd_ali_voice_t *pvoice) 1091static void snd_ali_free_voice(struct snd_ali * codec, struct snd_ali_voice *pvoice)
1092{ 1092{
1093 void (*private_free)(void *); 1093 void (*private_free)(void *);
1094 void *private_data; 1094 void *private_data;
@@ -1113,7 +1113,7 @@ static void snd_ali_free_voice(ali_t * codec, snd_ali_voice_t *pvoice)
1113} 1113}
1114 1114
1115 1115
1116static void snd_ali_clear_voices(ali_t * codec, 1116static void snd_ali_clear_voices(struct snd_ali * codec,
1117 unsigned int v_min, 1117 unsigned int v_min,
1118 unsigned int v_max) 1118 unsigned int v_max)
1119{ 1119{
@@ -1125,7 +1125,7 @@ static void snd_ali_clear_voices(ali_t * codec,
1125 } 1125 }
1126} 1126}
1127 1127
1128static void snd_ali_write_voice_regs(ali_t * codec, 1128static void snd_ali_write_voice_regs(struct snd_ali * codec,
1129 unsigned int Channel, 1129 unsigned int Channel,
1130 unsigned int LBA, 1130 unsigned int LBA,
1131 unsigned int CSO, 1131 unsigned int CSO,
@@ -1192,10 +1192,10 @@ static unsigned int snd_ali_convert_rate(unsigned int rate, int rec)
1192 return delta; 1192 return delta;
1193} 1193}
1194 1194
1195static unsigned int snd_ali_control_mode(snd_pcm_substream_t *substream) 1195static unsigned int snd_ali_control_mode(struct snd_pcm_substream *substream)
1196{ 1196{
1197 unsigned int CTRL; 1197 unsigned int CTRL;
1198 snd_pcm_runtime_t *runtime = substream->runtime; 1198 struct snd_pcm_runtime *runtime = substream->runtime;
1199 1199
1200 /* set ctrl mode 1200 /* set ctrl mode
1201 CTRL default: 8-bit (unsigned) mono, loop mode enabled 1201 CTRL default: 8-bit (unsigned) mono, loop mode enabled
@@ -1214,21 +1214,21 @@ static unsigned int snd_ali_control_mode(snd_pcm_substream_t *substream)
1214 * PCM part 1214 * PCM part
1215 */ 1215 */
1216 1216
1217static int snd_ali_ioctl(snd_pcm_substream_t * substream, 1217static int snd_ali_ioctl(struct snd_pcm_substream *substream,
1218 unsigned int cmd, void *arg) 1218 unsigned int cmd, void *arg)
1219{ 1219{
1220 return snd_pcm_lib_ioctl(substream, cmd, arg); 1220 return snd_pcm_lib_ioctl(substream, cmd, arg);
1221} 1221}
1222 1222
1223static int snd_ali_trigger(snd_pcm_substream_t *substream, 1223static int snd_ali_trigger(struct snd_pcm_substream *substream,
1224 int cmd) 1224 int cmd)
1225 1225
1226{ 1226{
1227 ali_t *codec = snd_pcm_substream_chip(substream); 1227 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1228 struct list_head *pos; 1228 struct list_head *pos;
1229 snd_pcm_substream_t *s; 1229 struct snd_pcm_substream *s;
1230 unsigned int what, whati, capture_flag; 1230 unsigned int what, whati, capture_flag;
1231 snd_ali_voice_t *pvoice = NULL, *evoice = NULL; 1231 struct snd_ali_voice *pvoice = NULL, *evoice = NULL;
1232 unsigned int val; 1232 unsigned int val;
1233 int do_start; 1233 int do_start;
1234 1234
@@ -1246,8 +1246,8 @@ static int snd_ali_trigger(snd_pcm_substream_t *substream,
1246 what = whati = capture_flag = 0; 1246 what = whati = capture_flag = 0;
1247 snd_pcm_group_for_each(pos, substream) { 1247 snd_pcm_group_for_each(pos, substream) {
1248 s = snd_pcm_group_substream_entry(pos); 1248 s = snd_pcm_group_substream_entry(pos);
1249 if ((ali_t *) snd_pcm_substream_chip(s) == codec) { 1249 if ((struct snd_ali *) snd_pcm_substream_chip(s) == codec) {
1250 pvoice = (snd_ali_voice_t *) s->runtime->private_data; 1250 pvoice = s->runtime->private_data;
1251 evoice = pvoice->extra; 1251 evoice = pvoice->extra;
1252 what |= 1 << (pvoice->number & 0x1f); 1252 what |= 1 << (pvoice->number & 0x1f);
1253 if (evoice == NULL) { 1253 if (evoice == NULL) {
@@ -1290,13 +1290,13 @@ static int snd_ali_trigger(snd_pcm_substream_t *substream,
1290 return 0; 1290 return 0;
1291} 1291}
1292 1292
1293static int snd_ali_playback_hw_params(snd_pcm_substream_t * substream, 1293static int snd_ali_playback_hw_params(struct snd_pcm_substream *substream,
1294 snd_pcm_hw_params_t * hw_params) 1294 struct snd_pcm_hw_params *hw_params)
1295{ 1295{
1296 ali_t *codec = snd_pcm_substream_chip(substream); 1296 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1297 snd_pcm_runtime_t *runtime = substream->runtime; 1297 struct snd_pcm_runtime *runtime = substream->runtime;
1298 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1298 struct snd_ali_voice *pvoice = runtime->private_data;
1299 snd_ali_voice_t *evoice = pvoice->extra; 1299 struct snd_ali_voice *evoice = pvoice->extra;
1300 int err; 1300 int err;
1301 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1301 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
1302 if (err < 0) return err; 1302 if (err < 0) return err;
@@ -1321,12 +1321,12 @@ static int snd_ali_playback_hw_params(snd_pcm_substream_t * substream,
1321 return 0; 1321 return 0;
1322} 1322}
1323 1323
1324static int snd_ali_playback_hw_free(snd_pcm_substream_t * substream) 1324static int snd_ali_playback_hw_free(struct snd_pcm_substream *substream)
1325{ 1325{
1326 ali_t *codec = snd_pcm_substream_chip(substream); 1326 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1327 snd_pcm_runtime_t *runtime = substream->runtime; 1327 struct snd_pcm_runtime *runtime = substream->runtime;
1328 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1328 struct snd_ali_voice *pvoice = runtime->private_data;
1329 snd_ali_voice_t *evoice = pvoice ? pvoice->extra : NULL; 1329 struct snd_ali_voice *evoice = pvoice ? pvoice->extra : NULL;
1330 1330
1331 snd_pcm_lib_free_pages(substream); 1331 snd_pcm_lib_free_pages(substream);
1332 if (evoice != NULL) { 1332 if (evoice != NULL) {
@@ -1336,23 +1336,23 @@ static int snd_ali_playback_hw_free(snd_pcm_substream_t * substream)
1336 return 0; 1336 return 0;
1337} 1337}
1338 1338
1339static int snd_ali_hw_params(snd_pcm_substream_t * substream, 1339static int snd_ali_hw_params(struct snd_pcm_substream *substream,
1340 snd_pcm_hw_params_t * hw_params) 1340 struct snd_pcm_hw_params *hw_params)
1341{ 1341{
1342 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1342 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
1343} 1343}
1344 1344
1345static int snd_ali_hw_free(snd_pcm_substream_t * substream) 1345static int snd_ali_hw_free(struct snd_pcm_substream *substream)
1346{ 1346{
1347 return snd_pcm_lib_free_pages(substream); 1347 return snd_pcm_lib_free_pages(substream);
1348} 1348}
1349 1349
1350static int snd_ali_playback_prepare(snd_pcm_substream_t * substream) 1350static int snd_ali_playback_prepare(struct snd_pcm_substream *substream)
1351{ 1351{
1352 ali_t *codec = snd_pcm_substream_chip(substream); 1352 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1353 snd_pcm_runtime_t *runtime = substream->runtime; 1353 struct snd_pcm_runtime *runtime = substream->runtime;
1354 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1354 struct snd_ali_voice *pvoice = runtime->private_data;
1355 snd_ali_voice_t *evoice = pvoice->extra; 1355 struct snd_ali_voice *evoice = pvoice->extra;
1356 1356
1357 unsigned int LBA; 1357 unsigned int LBA;
1358 unsigned int Delta; 1358 unsigned int Delta;
@@ -1435,11 +1435,11 @@ static int snd_ali_playback_prepare(snd_pcm_substream_t * substream)
1435} 1435}
1436 1436
1437 1437
1438static int snd_ali_prepare(snd_pcm_substream_t * substream) 1438static int snd_ali_prepare(struct snd_pcm_substream *substream)
1439{ 1439{
1440 ali_t *codec = snd_pcm_substream_chip(substream); 1440 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1441 snd_pcm_runtime_t *runtime = substream->runtime; 1441 struct snd_pcm_runtime *runtime = substream->runtime;
1442 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1442 struct snd_ali_voice *pvoice = runtime->private_data;
1443 unsigned int LBA; 1443 unsigned int LBA;
1444 unsigned int Delta; 1444 unsigned int Delta;
1445 unsigned int ESO; 1445 unsigned int ESO;
@@ -1522,11 +1522,11 @@ static int snd_ali_prepare(snd_pcm_substream_t * substream)
1522} 1522}
1523 1523
1524 1524
1525static snd_pcm_uframes_t snd_ali_playback_pointer(snd_pcm_substream_t *substream) 1525static snd_pcm_uframes_t snd_ali_playback_pointer(struct snd_pcm_substream *substream)
1526{ 1526{
1527 ali_t *codec = snd_pcm_substream_chip(substream); 1527 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1528 snd_pcm_runtime_t *runtime = substream->runtime; 1528 struct snd_pcm_runtime *runtime = substream->runtime;
1529 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1529 struct snd_ali_voice *pvoice = runtime->private_data;
1530 unsigned int cso; 1530 unsigned int cso;
1531 1531
1532 spin_lock(&codec->reg_lock); 1532 spin_lock(&codec->reg_lock);
@@ -1543,11 +1543,11 @@ static snd_pcm_uframes_t snd_ali_playback_pointer(snd_pcm_substream_t *substream
1543} 1543}
1544 1544
1545 1545
1546static snd_pcm_uframes_t snd_ali_pointer(snd_pcm_substream_t *substream) 1546static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream)
1547{ 1547{
1548 ali_t *codec = snd_pcm_substream_chip(substream); 1548 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1549 snd_pcm_runtime_t *runtime = substream->runtime; 1549 struct snd_pcm_runtime *runtime = substream->runtime;
1550 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1550 struct snd_ali_voice *pvoice = runtime->private_data;
1551 unsigned int cso; 1551 unsigned int cso;
1552 1552
1553 spin_lock(&codec->reg_lock); 1553 spin_lock(&codec->reg_lock);
@@ -1562,7 +1562,7 @@ static snd_pcm_uframes_t snd_ali_pointer(snd_pcm_substream_t *substream)
1562 return cso; 1562 return cso;
1563} 1563}
1564 1564
1565static snd_pcm_hardware_t snd_ali_playback = 1565static struct snd_pcm_hardware snd_ali_playback =
1566{ 1566{
1567 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1567 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1568 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1568 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1588,7 +1588,7 @@ static snd_pcm_hardware_t snd_ali_playback =
1588 * Capture support device description 1588 * Capture support device description
1589 */ 1589 */
1590 1590
1591static snd_pcm_hardware_t snd_ali_capture = 1591static struct snd_pcm_hardware snd_ali_capture =
1592{ 1592{
1593 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1593 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1594 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1594 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1610,10 +1610,10 @@ static snd_pcm_hardware_t snd_ali_capture =
1610 .fifo_size = 0, 1610 .fifo_size = 0,
1611}; 1611};
1612 1612
1613static void snd_ali_pcm_free_substream(snd_pcm_runtime_t *runtime) 1613static void snd_ali_pcm_free_substream(struct snd_pcm_runtime *runtime)
1614{ 1614{
1615 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data; 1615 struct snd_ali_voice *pvoice = runtime->private_data;
1616 ali_t *codec; 1616 struct snd_ali *codec;
1617 1617
1618 if (pvoice) { 1618 if (pvoice) {
1619 codec = pvoice->codec; 1619 codec = pvoice->codec;
@@ -1621,12 +1621,12 @@ static void snd_ali_pcm_free_substream(snd_pcm_runtime_t *runtime)
1621 } 1621 }
1622} 1622}
1623 1623
1624static int snd_ali_open(snd_pcm_substream_t * substream, int rec, int channel, 1624static int snd_ali_open(struct snd_pcm_substream *substream, int rec, int channel,
1625 snd_pcm_hardware_t *phw) 1625 struct snd_pcm_hardware *phw)
1626{ 1626{
1627 ali_t *codec = snd_pcm_substream_chip(substream); 1627 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1628 snd_pcm_runtime_t *runtime = substream->runtime; 1628 struct snd_pcm_runtime *runtime = substream->runtime;
1629 snd_ali_voice_t *pvoice; 1629 struct snd_ali_voice *pvoice;
1630 1630
1631 pvoice = snd_ali_alloc_voice(codec, SNDRV_ALI_VOICE_TYPE_PCM, rec, channel); 1631 pvoice = snd_ali_alloc_voice(codec, SNDRV_ALI_VOICE_TYPE_PCM, rec, channel);
1632 if (pvoice == NULL) 1632 if (pvoice == NULL)
@@ -1642,32 +1642,32 @@ static int snd_ali_open(snd_pcm_substream_t * substream, int rec, int channel,
1642 return 0; 1642 return 0;
1643} 1643}
1644 1644
1645static int snd_ali_playback_open(snd_pcm_substream_t * substream) 1645static int snd_ali_playback_open(struct snd_pcm_substream *substream)
1646{ 1646{
1647 return snd_ali_open(substream, 0, -1, &snd_ali_playback); 1647 return snd_ali_open(substream, 0, -1, &snd_ali_playback);
1648} 1648}
1649 1649
1650static int snd_ali_capture_open(snd_pcm_substream_t * substream) 1650static int snd_ali_capture_open(struct snd_pcm_substream *substream)
1651{ 1651{
1652 return snd_ali_open(substream, 1, -1, &snd_ali_capture); 1652 return snd_ali_open(substream, 1, -1, &snd_ali_capture);
1653} 1653}
1654 1654
1655static int snd_ali_playback_close(snd_pcm_substream_t * substream) 1655static int snd_ali_playback_close(struct snd_pcm_substream *substream)
1656{ 1656{
1657 return 0; 1657 return 0;
1658} 1658}
1659 1659
1660static int snd_ali_close(snd_pcm_substream_t * substream) 1660static int snd_ali_close(struct snd_pcm_substream *substream)
1661{ 1661{
1662 ali_t *codec = snd_pcm_substream_chip(substream); 1662 struct snd_ali *codec = snd_pcm_substream_chip(substream);
1663 snd_ali_voice_t *pvoice = (snd_ali_voice_t *) substream->runtime->private_data; 1663 struct snd_ali_voice *pvoice = substream->runtime->private_data;
1664 1664
1665 snd_ali_disable_special_channel(codec,pvoice->number); 1665 snd_ali_disable_special_channel(codec,pvoice->number);
1666 1666
1667 return 0; 1667 return 0;
1668} 1668}
1669 1669
1670static snd_pcm_ops_t snd_ali_playback_ops = { 1670static struct snd_pcm_ops snd_ali_playback_ops = {
1671 .open = snd_ali_playback_open, 1671 .open = snd_ali_playback_open,
1672 .close = snd_ali_playback_close, 1672 .close = snd_ali_playback_close,
1673 .ioctl = snd_ali_ioctl, 1673 .ioctl = snd_ali_ioctl,
@@ -1678,7 +1678,7 @@ static snd_pcm_ops_t snd_ali_playback_ops = {
1678 .pointer = snd_ali_playback_pointer, 1678 .pointer = snd_ali_playback_pointer,
1679}; 1679};
1680 1680
1681static snd_pcm_ops_t snd_ali_capture_ops = { 1681static struct snd_pcm_ops snd_ali_capture_ops = {
1682 .open = snd_ali_capture_open, 1682 .open = snd_ali_capture_open,
1683 .close = snd_ali_close, 1683 .close = snd_ali_close,
1684 .ioctl = snd_ali_ioctl, 1684 .ioctl = snd_ali_ioctl,
@@ -1693,17 +1693,17 @@ static snd_pcm_ops_t snd_ali_capture_ops = {
1693 * Modem PCM 1693 * Modem PCM
1694 */ 1694 */
1695 1695
1696static int snd_ali_modem_hw_params(snd_pcm_substream_t * substream, 1696static int snd_ali_modem_hw_params(struct snd_pcm_substream *substream,
1697 snd_pcm_hw_params_t * hw_params) 1697 struct snd_pcm_hw_params *hw_params)
1698{ 1698{
1699 ali_t *chip = snd_pcm_substream_chip(substream); 1699 struct snd_ali *chip = snd_pcm_substream_chip(substream);
1700 unsigned int modem_num = chip->num_of_codecs - 1; 1700 unsigned int modem_num = chip->num_of_codecs - 1;
1701 snd_ac97_write(chip->ac97[modem_num], AC97_LINE1_RATE, params_rate(hw_params)); 1701 snd_ac97_write(chip->ac97[modem_num], AC97_LINE1_RATE, params_rate(hw_params));
1702 snd_ac97_write(chip->ac97[modem_num], AC97_LINE1_LEVEL, 0); 1702 snd_ac97_write(chip->ac97[modem_num], AC97_LINE1_LEVEL, 0);
1703 return snd_ali_hw_params(substream, hw_params); 1703 return snd_ali_hw_params(substream, hw_params);
1704} 1704}
1705 1705
1706static snd_pcm_hardware_t snd_ali_modem = 1706static struct snd_pcm_hardware snd_ali_modem =
1707{ 1707{
1708 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1708 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1709 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1709 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1724,10 +1724,10 @@ static snd_pcm_hardware_t snd_ali_modem =
1724 .fifo_size = 0, 1724 .fifo_size = 0,
1725}; 1725};
1726 1726
1727static int snd_ali_modem_open(snd_pcm_substream_t * substream, int rec, int channel) 1727static int snd_ali_modem_open(struct snd_pcm_substream *substream, int rec, int channel)
1728{ 1728{
1729 static unsigned int rates [] = {8000,9600,12000,16000}; 1729 static unsigned int rates [] = {8000,9600,12000,16000};
1730 static snd_pcm_hw_constraint_list_t hw_constraint_rates = { 1730 static struct snd_pcm_hw_constraint_list hw_constraint_rates = {
1731 .count = ARRAY_SIZE(rates), 1731 .count = ARRAY_SIZE(rates),
1732 .list = rates, 1732 .list = rates,
1733 .mask = 0, 1733 .mask = 0,
@@ -1739,17 +1739,17 @@ static int snd_ali_modem_open(snd_pcm_substream_t * substream, int rec, int chan
1739 SNDRV_PCM_HW_PARAM_RATE, &hw_constraint_rates); 1739 SNDRV_PCM_HW_PARAM_RATE, &hw_constraint_rates);
1740} 1740}
1741 1741
1742static int snd_ali_modem_playback_open(snd_pcm_substream_t * substream) 1742static int snd_ali_modem_playback_open(struct snd_pcm_substream *substream)
1743{ 1743{
1744 return snd_ali_modem_open(substream, 0, ALI_MODEM_OUT_CHANNEL); 1744 return snd_ali_modem_open(substream, 0, ALI_MODEM_OUT_CHANNEL);
1745} 1745}
1746 1746
1747static int snd_ali_modem_capture_open(snd_pcm_substream_t * substream) 1747static int snd_ali_modem_capture_open(struct snd_pcm_substream *substream)
1748{ 1748{
1749 return snd_ali_modem_open(substream, 1, ALI_MODEM_IN_CHANNEL); 1749 return snd_ali_modem_open(substream, 1, ALI_MODEM_IN_CHANNEL);
1750} 1750}
1751 1751
1752static snd_pcm_ops_t snd_ali_modem_playback_ops = { 1752static struct snd_pcm_ops snd_ali_modem_playback_ops = {
1753 .open = snd_ali_modem_playback_open, 1753 .open = snd_ali_modem_playback_open,
1754 .close = snd_ali_close, 1754 .close = snd_ali_close,
1755 .ioctl = snd_pcm_lib_ioctl, 1755 .ioctl = snd_pcm_lib_ioctl,
@@ -1760,7 +1760,7 @@ static snd_pcm_ops_t snd_ali_modem_playback_ops = {
1760 .pointer = snd_ali_pointer, 1760 .pointer = snd_ali_pointer,
1761}; 1761};
1762 1762
1763static snd_pcm_ops_t snd_ali_modem_capture_ops = { 1763static struct snd_pcm_ops snd_ali_modem_capture_ops = {
1764 .open = snd_ali_modem_capture_open, 1764 .open = snd_ali_modem_capture_open,
1765 .close = snd_ali_close, 1765 .close = snd_ali_close,
1766 .ioctl = snd_pcm_lib_ioctl, 1766 .ioctl = snd_pcm_lib_ioctl,
@@ -1776,22 +1776,22 @@ struct ali_pcm_description {
1776 char *name; 1776 char *name;
1777 unsigned int playback_num; 1777 unsigned int playback_num;
1778 unsigned int capture_num; 1778 unsigned int capture_num;
1779 snd_pcm_ops_t *playback_ops; 1779 struct snd_pcm_ops *playback_ops;
1780 snd_pcm_ops_t *capture_ops; 1780 struct snd_pcm_ops *capture_ops;
1781 unsigned short class; 1781 unsigned short class;
1782}; 1782};
1783 1783
1784 1784
1785static void snd_ali_pcm_free(snd_pcm_t *pcm) 1785static void snd_ali_pcm_free(struct snd_pcm *pcm)
1786{ 1786{
1787 ali_t *codec = pcm->private_data; 1787 struct snd_ali *codec = pcm->private_data;
1788 codec->pcm[pcm->device] = NULL; 1788 codec->pcm[pcm->device] = NULL;
1789} 1789}
1790 1790
1791 1791
1792static int __devinit snd_ali_pcm(ali_t * codec, int device, struct ali_pcm_description *desc) 1792static int __devinit snd_ali_pcm(struct snd_ali * codec, int device, struct ali_pcm_description *desc)
1793{ 1793{
1794 snd_pcm_t *pcm; 1794 struct snd_pcm *pcm;
1795 int err; 1795 int err;
1796 1796
1797 err = snd_pcm_new(codec->card, desc->name, device, 1797 err = snd_pcm_new(codec->card, desc->name, device,
@@ -1823,7 +1823,7 @@ static struct ali_pcm_description ali_pcms[] = {
1823 { "ALI 5451 modem", 1, 1, &snd_ali_modem_playback_ops, &snd_ali_modem_capture_ops, SNDRV_PCM_CLASS_MODEM } 1823 { "ALI 5451 modem", 1, 1, &snd_ali_modem_playback_ops, &snd_ali_modem_capture_ops, SNDRV_PCM_CLASS_MODEM }
1824}; 1824};
1825 1825
1826static int __devinit snd_ali_build_pcms(ali_t *codec) 1826static int __devinit snd_ali_build_pcms(struct snd_ali *codec)
1827{ 1827{
1828 int i, err; 1828 int i, err;
1829 for(i = 0 ; i < codec->num_of_codecs && i < ARRAY_SIZE(ali_pcms) ; i++) 1829 for(i = 0 ; i < codec->num_of_codecs && i < ARRAY_SIZE(ali_pcms) ; i++)
@@ -1838,7 +1838,7 @@ static int __devinit snd_ali_build_pcms(ali_t *codec)
1838.info = snd_ali5451_spdif_info, .get = snd_ali5451_spdif_get, \ 1838.info = snd_ali5451_spdif_info, .get = snd_ali5451_spdif_get, \
1839.put = snd_ali5451_spdif_put, .private_value = value} 1839.put = snd_ali5451_spdif_put, .private_value = value}
1840 1840
1841static int snd_ali5451_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 1841static int snd_ali5451_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1842{ 1842{
1843 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1843 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1844 uinfo->count = 1; 1844 uinfo->count = 1;
@@ -1847,9 +1847,9 @@ static int snd_ali5451_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
1847 return 0; 1847 return 0;
1848} 1848}
1849 1849
1850static int snd_ali5451_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1850static int snd_ali5451_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1851{ 1851{
1852 ali_t *codec = kcontrol->private_data; 1852 struct snd_ali *codec = kcontrol->private_data;
1853 unsigned int enable; 1853 unsigned int enable;
1854 1854
1855 enable = ucontrol->value.integer.value[0] ? 1 : 0; 1855 enable = ucontrol->value.integer.value[0] ? 1 : 0;
@@ -1873,9 +1873,9 @@ static int snd_ali5451_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
1873 return 0; 1873 return 0;
1874} 1874}
1875 1875
1876static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1876static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1877{ 1877{
1878 ali_t *codec = kcontrol->private_data; 1878 struct snd_ali *codec = kcontrol->private_data;
1879 unsigned int change = 0, enable = 0; 1879 unsigned int change = 0, enable = 0;
1880 1880
1881 enable = ucontrol->value.integer.value[0] ? 1 : 0; 1881 enable = ucontrol->value.integer.value[0] ? 1 : 0;
@@ -1930,7 +1930,7 @@ static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
1930 return change; 1930 return change;
1931} 1931}
1932 1932
1933static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinitdata = { 1933static struct snd_kcontrol_new snd_ali5451_mixer_spdif[] __devinitdata = {
1934 /* spdif aplayback switch */ 1934 /* spdif aplayback switch */
1935 /* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */ 1935 /* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */
1936 ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("Output ",NONE,SWITCH), 0, 0), 1936 ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("Output ",NONE,SWITCH), 0, 0),
@@ -1940,24 +1940,24 @@ static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinitdata = {
1940 ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, 2) 1940 ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, 2)
1941}; 1941};
1942 1942
1943static void snd_ali_mixer_free_ac97_bus(ac97_bus_t *bus) 1943static void snd_ali_mixer_free_ac97_bus(struct snd_ac97_bus *bus)
1944{ 1944{
1945 ali_t *codec = bus->private_data; 1945 struct snd_ali *codec = bus->private_data;
1946 codec->ac97_bus = NULL; 1946 codec->ac97_bus = NULL;
1947} 1947}
1948 1948
1949static void snd_ali_mixer_free_ac97(ac97_t *ac97) 1949static void snd_ali_mixer_free_ac97(struct snd_ac97 *ac97)
1950{ 1950{
1951 ali_t *codec = ac97->private_data; 1951 struct snd_ali *codec = ac97->private_data;
1952 codec->ac97[ac97->num] = NULL; 1952 codec->ac97[ac97->num] = NULL;
1953} 1953}
1954 1954
1955static int __devinit snd_ali_mixer(ali_t * codec) 1955static int __devinit snd_ali_mixer(struct snd_ali * codec)
1956{ 1956{
1957 ac97_template_t ac97; 1957 struct snd_ac97_template ac97;
1958 unsigned int idx; 1958 unsigned int idx;
1959 int i, err; 1959 int i, err;
1960 static ac97_bus_ops_t ops = { 1960 static struct snd_ac97_bus_ops ops = {
1961 .write = snd_ali_codec_write, 1961 .write = snd_ali_codec_write,
1962 .read = snd_ali_codec_read, 1962 .read = snd_ali_codec_read,
1963 }; 1963 };
@@ -1991,10 +1991,10 @@ static int __devinit snd_ali_mixer(ali_t * codec)
1991} 1991}
1992 1992
1993#ifdef CONFIG_PM 1993#ifdef CONFIG_PM
1994static int ali_suspend(snd_card_t *card, pm_message_t state) 1994static int ali_suspend(struct snd_card *card, pm_message_t state)
1995{ 1995{
1996 ali_t *chip = card->pm_private_data; 1996 struct snd_ali *chip = card->pm_private_data;
1997 ali_image_t *im; 1997 struct snd_ali_image *im;
1998 int i, j; 1998 int i, j;
1999 1999
2000 im = chip->image; 2000 im = chip->image;
@@ -2037,10 +2037,10 @@ static int ali_suspend(snd_card_t *card, pm_message_t state)
2037 return 0; 2037 return 0;
2038} 2038}
2039 2039
2040static int ali_resume(snd_card_t *card) 2040static int ali_resume(struct snd_card *card)
2041{ 2041{
2042 ali_t *chip = card->pm_private_data; 2042 struct snd_ali *chip = card->pm_private_data;
2043 ali_image_t *im; 2043 struct snd_ali_image *im;
2044 int i, j; 2044 int i, j;
2045 2045
2046 im = chip->image; 2046 im = chip->image;
@@ -2078,7 +2078,7 @@ static int ali_resume(snd_card_t *card)
2078} 2078}
2079#endif /* CONFIG_PM */ 2079#endif /* CONFIG_PM */
2080 2080
2081static int snd_ali_free(ali_t * codec) 2081static int snd_ali_free(struct snd_ali * codec)
2082{ 2082{
2083 if (codec->hw_initialized) 2083 if (codec->hw_initialized)
2084 snd_ali_disable_address_interrupt(codec); 2084 snd_ali_disable_address_interrupt(codec);
@@ -2098,7 +2098,7 @@ static int snd_ali_free(ali_t * codec)
2098 return 0; 2098 return 0;
2099} 2099}
2100 2100
2101static int snd_ali_chip_init(ali_t *codec) 2101static int snd_ali_chip_init(struct snd_ali *codec)
2102{ 2102{
2103 unsigned int legacy; 2103 unsigned int legacy;
2104 unsigned char temp; 2104 unsigned char temp;
@@ -2157,22 +2157,22 @@ static int snd_ali_chip_init(ali_t *codec)
2157} 2157}
2158 2158
2159/* proc for register dump */ 2159/* proc for register dump */
2160static void snd_ali_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buf) 2160static void snd_ali_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buf)
2161{ 2161{
2162 ali_t *codec = entry->private_data; 2162 struct snd_ali *codec = entry->private_data;
2163 int i; 2163 int i;
2164 for(i = 0 ; i < 256 ; i+= 4) 2164 for(i = 0 ; i < 256 ; i+= 4)
2165 snd_iprintf(buf, "%02x: %08x\n", i, inl(ALI_REG(codec, i))); 2165 snd_iprintf(buf, "%02x: %08x\n", i, inl(ALI_REG(codec, i)));
2166} 2166}
2167 2167
2168static void __devinit snd_ali_proc_init(ali_t *codec) 2168static void __devinit snd_ali_proc_init(struct snd_ali *codec)
2169{ 2169{
2170 snd_info_entry_t *entry; 2170 struct snd_info_entry *entry;
2171 if(!snd_card_proc_new(codec->card, "ali5451", &entry)) 2171 if(!snd_card_proc_new(codec->card, "ali5451", &entry))
2172 snd_info_set_text_ops(entry, codec, 1024, snd_ali_proc_read); 2172 snd_info_set_text_ops(entry, codec, 1024, snd_ali_proc_read);
2173} 2173}
2174 2174
2175static int __devinit snd_ali_resources(ali_t *codec) 2175static int __devinit snd_ali_resources(struct snd_ali *codec)
2176{ 2176{
2177 int err; 2177 int err;
2178 2178
@@ -2189,27 +2189,25 @@ static int __devinit snd_ali_resources(ali_t *codec)
2189 snd_ali_printk("resouces allocated.\n"); 2189 snd_ali_printk("resouces allocated.\n");
2190 return 0; 2190 return 0;
2191} 2191}
2192static int snd_ali_dev_free(snd_device_t *device) 2192static int snd_ali_dev_free(struct snd_device *device)
2193{ 2193{
2194 ali_t *codec=device->device_data; 2194 struct snd_ali *codec=device->device_data;
2195 snd_ali_free(codec); 2195 snd_ali_free(codec);
2196 return 0; 2196 return 0;
2197} 2197}
2198 2198
2199static int __devinit snd_ali_create(snd_card_t * card, 2199static int __devinit snd_ali_create(struct snd_card *card,
2200 struct pci_dev *pci, 2200 struct pci_dev *pci,
2201 int pcm_streams, 2201 int pcm_streams,
2202 int spdif_support, 2202 int spdif_support,
2203 ali_t ** r_ali) 2203 struct snd_ali ** r_ali)
2204{ 2204{
2205 ali_t *codec; 2205 struct snd_ali *codec;
2206 int i, err; 2206 int i, err;
2207 unsigned short cmdw = 0; 2207 unsigned short cmdw = 0;
2208 struct pci_dev *pci_dev = NULL; 2208 struct pci_dev *pci_dev = NULL;
2209 static snd_device_ops_t ops = { 2209 static struct snd_device_ops ops = {
2210 (snd_dev_free_t *)snd_ali_dev_free, 2210 .dev_free = snd_ali_dev_free,
2211 NULL,
2212 NULL
2213 }; 2211 };
2214 2212
2215 *r_ali = NULL; 2213 *r_ali = NULL;
@@ -2334,8 +2332,8 @@ static int __devinit snd_ali_create(snd_card_t * card,
2334static int __devinit snd_ali_probe(struct pci_dev *pci, 2332static int __devinit snd_ali_probe(struct pci_dev *pci,
2335 const struct pci_device_id *pci_id) 2333 const struct pci_device_id *pci_id)
2336{ 2334{
2337 snd_card_t *card; 2335 struct snd_card *card;
2338 ali_t *codec; 2336 struct snd_ali *codec;
2339 int err; 2337 int err;
2340 2338
2341 snd_ali_printk("probe ...\n"); 2339 snd_ali_printk("probe ...\n");