aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:53:15 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:18:56 -0500
commitbee1a5be8b6210a0a4e27e38d0f76847b0a014ae (patch)
treec8059b86095309e23b4fa61d576e96c722466ee6 /sound
parentabfd67bd6fcc07b54d54e00a9105900f478323a6 (diff)
[ALSA] Remove xxx_t typedefs: PCI Trident
Modules: Trident driver Remove xxx_t typedefs from the PCI Trident driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/trident/trident.c4
-rw-r--r--sound/pci/trident/trident_main.c708
-rw-r--r--sound/pci/trident/trident_memory.c92
-rw-r--r--sound/pci/trident/trident_synth.c159
4 files changed, 515 insertions, 448 deletions
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index 940d531575c0..0999f1f83a99 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -76,8 +76,8 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
76 const struct pci_device_id *pci_id) 76 const struct pci_device_id *pci_id)
77{ 77{
78 static int dev; 78 static int dev;
79 snd_card_t *card; 79 struct snd_card *card;
80 trident_t *trident; 80 struct snd_trident *trident;
81 const char *str; 81 const char *str;
82 int err, pcm_dev = 0; 82 int err, pcm_dev = 0;
83 83
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 62f109f020a5..6277dccebf64 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -44,17 +44,23 @@
44 44
45#include <asm/io.h> 45#include <asm/io.h>
46 46
47static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream); 47static int snd_trident_pcm_mixer_build(struct snd_trident *trident,
48static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream); 48 struct snd_trident_voice * voice,
49static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs); 49 struct snd_pcm_substream *substream);
50static int snd_trident_pcm_mixer_free(struct snd_trident *trident,
51 struct snd_trident_voice * voice,
52 struct snd_pcm_substream *substream);
53static irqreturn_t snd_trident_interrupt(int irq, void *dev_id,
54 struct pt_regs *regs);
50#ifdef CONFIG_PM 55#ifdef CONFIG_PM
51static int snd_trident_suspend(snd_card_t *card, pm_message_t state); 56static int snd_trident_suspend(struct snd_card *card, pm_message_t state);
52static int snd_trident_resume(snd_card_t *card); 57static int snd_trident_resume(struct snd_card *card);
53#endif 58#endif
54static int snd_trident_sis_reset(trident_t *trident); 59static int snd_trident_sis_reset(struct snd_trident *trident);
55 60
56static void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max); 61static void snd_trident_clear_voices(struct snd_trident * trident,
57static int snd_trident_free(trident_t *trident); 62 unsigned short v_min, unsigned short v_max);
63static int snd_trident_free(struct snd_trident *trident);
58 64
59/* 65/*
60 * common I/O routines 66 * common I/O routines
@@ -62,7 +68,7 @@ static int snd_trident_free(trident_t *trident);
62 68
63 69
64#if 0 70#if 0
65static void snd_trident_print_voice_regs(trident_t *trident, int voice) 71static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
66{ 72{
67 unsigned int val, tmp; 73 unsigned int val, tmp;
68 74
@@ -104,7 +110,7 @@ static void snd_trident_print_voice_regs(trident_t *trident, int voice)
104#endif 110#endif
105 111
106/*--------------------------------------------------------------------------- 112/*---------------------------------------------------------------------------
107 unsigned short snd_trident_codec_read(ac97_t *ac97, unsigned short reg) 113 unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned short reg)
108 114
109 Description: This routine will do all of the reading from the external 115 Description: This routine will do all of the reading from the external
110 CODEC (AC97). 116 CODEC (AC97).
@@ -115,12 +121,12 @@ static void snd_trident_print_voice_regs(trident_t *trident, int voice)
115 returns: 16 bit value read from the AC97. 121 returns: 16 bit value read from the AC97.
116 122
117 ---------------------------------------------------------------------------*/ 123 ---------------------------------------------------------------------------*/
118static unsigned short snd_trident_codec_read(ac97_t *ac97, unsigned short reg) 124static unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned short reg)
119{ 125{
120 unsigned int data = 0, treg; 126 unsigned int data = 0, treg;
121 unsigned short count = 0xffff; 127 unsigned short count = 0xffff;
122 unsigned long flags; 128 unsigned long flags;
123 trident_t *trident = ac97->private_data; 129 struct snd_trident *trident = ac97->private_data;
124 130
125 spin_lock_irqsave(&trident->reg_lock, flags); 131 spin_lock_irqsave(&trident->reg_lock, flags);
126 if (trident->device == TRIDENT_DEVICE_ID_DX) { 132 if (trident->device == TRIDENT_DEVICE_ID_DX) {
@@ -153,7 +159,8 @@ static unsigned short snd_trident_codec_read(ac97_t *ac97, unsigned short reg)
153 } 159 }
154 160
155 if (count == 0 && !trident->ac97_detect) { 161 if (count == 0 && !trident->ac97_detect) {
156 snd_printk(KERN_ERR "ac97 codec read TIMEOUT [0x%x/0x%x]!!!\n", reg, data); 162 snd_printk(KERN_ERR "ac97 codec read TIMEOUT [0x%x/0x%x]!!!\n",
163 reg, data);
157 data = 0; 164 data = 0;
158 } 165 }
159 166
@@ -162,7 +169,8 @@ static unsigned short snd_trident_codec_read(ac97_t *ac97, unsigned short reg)
162} 169}
163 170
164/*--------------------------------------------------------------------------- 171/*---------------------------------------------------------------------------
165 void snd_trident_codec_write(ac97_t *ac97, unsigned short reg, unsigned short wdata) 172 void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
173 unsigned short wdata)
166 174
167 Description: This routine will do all of the writing to the external 175 Description: This routine will do all of the writing to the external
168 CODEC (AC97). 176 CODEC (AC97).
@@ -174,12 +182,13 @@ static unsigned short snd_trident_codec_read(ac97_t *ac97, unsigned short reg)
174 returns: TRUE if everything went ok, else FALSE. 182 returns: TRUE if everything went ok, else FALSE.
175 183
176 ---------------------------------------------------------------------------*/ 184 ---------------------------------------------------------------------------*/
177static void snd_trident_codec_write(ac97_t *ac97, unsigned short reg, unsigned short wdata) 185static void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
186 unsigned short wdata)
178{ 187{
179 unsigned int address, data; 188 unsigned int address, data;
180 unsigned short count = 0xffff; 189 unsigned short count = 0xffff;
181 unsigned long flags; 190 unsigned long flags;
182 trident_t *trident = ac97->private_data; 191 struct snd_trident *trident = ac97->private_data;
183 192
184 data = ((unsigned long) wdata) << 16; 193 data = ((unsigned long) wdata) << 16;
185 194
@@ -230,7 +239,7 @@ static void snd_trident_codec_write(ac97_t *ac97, unsigned short reg, unsigned s
230} 239}
231 240
232/*--------------------------------------------------------------------------- 241/*---------------------------------------------------------------------------
233 void snd_trident_enable_eso(trident_t *trident) 242 void snd_trident_enable_eso(struct snd_trident *trident)
234 243
235 Description: This routine will enable end of loop interrupts. 244 Description: This routine will enable end of loop interrupts.
236 End of loop interrupts will occur when a running 245 End of loop interrupts will occur when a running
@@ -241,7 +250,7 @@ static void snd_trident_codec_write(ac97_t *ac97, unsigned short reg, unsigned s
241 250
242 ---------------------------------------------------------------------------*/ 251 ---------------------------------------------------------------------------*/
243 252
244static void snd_trident_enable_eso(trident_t * trident) 253static void snd_trident_enable_eso(struct snd_trident * trident)
245{ 254{
246 unsigned int val; 255 unsigned int val;
247 256
@@ -254,7 +263,7 @@ static void snd_trident_enable_eso(trident_t * trident)
254} 263}
255 264
256/*--------------------------------------------------------------------------- 265/*---------------------------------------------------------------------------
257 void snd_trident_disable_eso(trident_t *trident) 266 void snd_trident_disable_eso(struct snd_trident *trident)
258 267
259 Description: This routine will disable end of loop interrupts. 268 Description: This routine will disable end of loop interrupts.
260 End of loop interrupts will occur when a running 269 End of loop interrupts will occur when a running
@@ -268,7 +277,7 @@ static void snd_trident_enable_eso(trident_t * trident)
268 277
269 ---------------------------------------------------------------------------*/ 278 ---------------------------------------------------------------------------*/
270 279
271static void snd_trident_disable_eso(trident_t * trident) 280static void snd_trident_disable_eso(struct snd_trident * trident)
272{ 281{
273 unsigned int tmp; 282 unsigned int tmp;
274 283
@@ -279,7 +288,7 @@ static void snd_trident_disable_eso(trident_t * trident)
279} 288}
280 289
281/*--------------------------------------------------------------------------- 290/*---------------------------------------------------------------------------
282 void snd_trident_start_voice(trident_t * trident, unsigned int voice) 291 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
283 292
284 Description: Start a voice, any channel 0 thru 63. 293 Description: Start a voice, any channel 0 thru 63.
285 This routine automatically handles the fact that there are 294 This routine automatically handles the fact that there are
@@ -292,7 +301,7 @@ static void snd_trident_disable_eso(trident_t * trident)
292 301
293 ---------------------------------------------------------------------------*/ 302 ---------------------------------------------------------------------------*/
294 303
295void snd_trident_start_voice(trident_t * trident, unsigned int voice) 304void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
296{ 305{
297 unsigned int mask = 1 << (voice & 0x1f); 306 unsigned int mask = 1 << (voice & 0x1f);
298 unsigned int reg = (voice & 0x20) ? T4D_START_B : T4D_START_A; 307 unsigned int reg = (voice & 0x20) ? T4D_START_B : T4D_START_A;
@@ -301,7 +310,7 @@ void snd_trident_start_voice(trident_t * trident, unsigned int voice)
301} 310}
302 311
303/*--------------------------------------------------------------------------- 312/*---------------------------------------------------------------------------
304 void snd_trident_stop_voice(trident_t * trident, unsigned int voice) 313 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
305 314
306 Description: Stop a voice, any channel 0 thru 63. 315 Description: Stop a voice, any channel 0 thru 63.
307 This routine automatically handles the fact that there are 316 This routine automatically handles the fact that there are
@@ -314,7 +323,7 @@ void snd_trident_start_voice(trident_t * trident, unsigned int voice)
314 323
315 ---------------------------------------------------------------------------*/ 324 ---------------------------------------------------------------------------*/
316 325
317void snd_trident_stop_voice(trident_t * trident, unsigned int voice) 326void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
318{ 327{
319 unsigned int mask = 1 << (voice & 0x1f); 328 unsigned int mask = 1 << (voice & 0x1f);
320 unsigned int reg = (voice & 0x20) ? T4D_STOP_B : T4D_STOP_A; 329 unsigned int reg = (voice & 0x20) ? T4D_STOP_B : T4D_STOP_A;
@@ -323,7 +332,7 @@ void snd_trident_stop_voice(trident_t * trident, unsigned int voice)
323} 332}
324 333
325/*--------------------------------------------------------------------------- 334/*---------------------------------------------------------------------------
326 int snd_trident_allocate_pcm_channel(trident_t *trident) 335 int snd_trident_allocate_pcm_channel(struct snd_trident *trident)
327 336
328 Description: Allocate hardware channel in Bank B (32-63). 337 Description: Allocate hardware channel in Bank B (32-63).
329 338
@@ -333,7 +342,7 @@ void snd_trident_stop_voice(trident_t * trident, unsigned int voice)
333 342
334 ---------------------------------------------------------------------------*/ 343 ---------------------------------------------------------------------------*/
335 344
336static int snd_trident_allocate_pcm_channel(trident_t * trident) 345static int snd_trident_allocate_pcm_channel(struct snd_trident * trident)
337{ 346{
338 int idx; 347 int idx;
339 348
@@ -361,7 +370,7 @@ static int snd_trident_allocate_pcm_channel(trident_t * trident)
361 370
362 ---------------------------------------------------------------------------*/ 371 ---------------------------------------------------------------------------*/
363 372
364static void snd_trident_free_pcm_channel(trident_t *trident, int channel) 373static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channel)
365{ 374{
366 if (channel < 32 || channel > 63) 375 if (channel < 32 || channel > 63)
367 return; 376 return;
@@ -383,7 +392,7 @@ static void snd_trident_free_pcm_channel(trident_t *trident, int channel)
383 392
384 ---------------------------------------------------------------------------*/ 393 ---------------------------------------------------------------------------*/
385 394
386static int snd_trident_allocate_synth_channel(trident_t * trident) 395static int snd_trident_allocate_synth_channel(struct snd_trident * trident)
387{ 396{
388 int idx; 397 int idx;
389 398
@@ -409,7 +418,7 @@ static int snd_trident_allocate_synth_channel(trident_t * trident)
409 418
410 ---------------------------------------------------------------------------*/ 419 ---------------------------------------------------------------------------*/
411 420
412static void snd_trident_free_synth_channel(trident_t *trident, int channel) 421static void snd_trident_free_synth_channel(struct snd_trident *trident, int channel)
413{ 422{
414 if (channel < 0 || channel > 31) 423 if (channel < 0 || channel > 31)
415 return; 424 return;
@@ -432,8 +441,8 @@ static void snd_trident_free_synth_channel(trident_t *trident, int channel)
432 441
433 ---------------------------------------------------------------------------*/ 442 ---------------------------------------------------------------------------*/
434 443
435void snd_trident_write_voice_regs(trident_t * trident, 444void snd_trident_write_voice_regs(struct snd_trident * trident,
436 snd_trident_voice_t * voice) 445 struct snd_trident_voice * voice)
437{ 446{
438 unsigned int FmcRvolCvol; 447 unsigned int FmcRvolCvol;
439 unsigned int regs[5]; 448 unsigned int regs[5];
@@ -452,14 +461,16 @@ void snd_trident_write_voice_regs(trident_t * trident,
452 (voice->Vol & 0x000003ff) : 461 (voice->Vol & 0x000003ff) :
453 ((voice->Vol & 0x00003fc) << (16-2)) | 462 ((voice->Vol & 0x00003fc) << (16-2)) |
454 (voice->EC & 0x00000fff); 463 (voice->EC & 0x00000fff);
455 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) | (voice->FMS & 0x0000000f); 464 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) |
465 (voice->FMS & 0x0000000f);
456 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff); 466 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff);
457 regs[3] = (voice->Attribute << 16) | FmcRvolCvol; 467 regs[3] = (voice->Attribute << 16) | FmcRvolCvol;
458 break; 468 break;
459 case TRIDENT_DEVICE_ID_DX: 469 case TRIDENT_DEVICE_ID_DX:
460 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) | 470 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) |
461 (voice->EC & 0x00000fff); 471 (voice->EC & 0x00000fff);
462 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) | (voice->FMS & 0x0000000f); 472 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) |
473 (voice->FMS & 0x0000000f);
463 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff); 474 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff);
464 regs[3] = FmcRvolCvol; 475 regs[3] = FmcRvolCvol;
465 break; 476 break;
@@ -467,8 +478,10 @@ void snd_trident_write_voice_regs(trident_t * trident,
467 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) | 478 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) |
468 (voice->EC & 0x00000fff); 479 (voice->EC & 0x00000fff);
469 regs[0] = (voice->Delta << 24) | (voice->CSO & 0x00ffffff); 480 regs[0] = (voice->Delta << 24) | (voice->CSO & 0x00ffffff);
470 regs[2] = ((voice->Delta << 16) & 0xff000000) | (voice->ESO & 0x00ffffff); 481 regs[2] = ((voice->Delta << 16) & 0xff000000) |
471 regs[3] = (voice->Alpha << 20) | ((voice->FMS & 0x0000000f) << 16) | FmcRvolCvol; 482 (voice->ESO & 0x00ffffff);
483 regs[3] = (voice->Alpha << 20) |
484 ((voice->FMS & 0x0000000f) << 16) | FmcRvolCvol;
472 break; 485 break;
473 default: 486 default:
474 snd_BUG(); 487 snd_BUG();
@@ -504,14 +517,17 @@ void snd_trident_write_voice_regs(trident_t * trident,
504 517
505 ---------------------------------------------------------------------------*/ 518 ---------------------------------------------------------------------------*/
506 519
507static void snd_trident_write_cso_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int CSO) 520static void snd_trident_write_cso_reg(struct snd_trident * trident,
521 struct snd_trident_voice * voice,
522 unsigned int CSO)
508{ 523{
509 voice->CSO = CSO; 524 voice->CSO = CSO;
510 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); 525 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
511 if (trident->device != TRIDENT_DEVICE_ID_NX) { 526 if (trident->device != TRIDENT_DEVICE_ID_NX) {
512 outw(voice->CSO, TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2); 527 outw(voice->CSO, TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2);
513 } else { 528 } else {
514 outl((voice->Delta << 24) | (voice->CSO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_CSO)); 529 outl((voice->Delta << 24) |
530 (voice->CSO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_CSO));
515 } 531 }
516} 532}
517 533
@@ -527,14 +543,17 @@ static void snd_trident_write_cso_reg(trident_t * trident, snd_trident_voice_t *
527 543
528 ---------------------------------------------------------------------------*/ 544 ---------------------------------------------------------------------------*/
529 545
530static void snd_trident_write_eso_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int ESO) 546static void snd_trident_write_eso_reg(struct snd_trident * trident,
547 struct snd_trident_voice * voice,
548 unsigned int ESO)
531{ 549{
532 voice->ESO = ESO; 550 voice->ESO = ESO;
533 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); 551 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
534 if (trident->device != TRIDENT_DEVICE_ID_NX) { 552 if (trident->device != TRIDENT_DEVICE_ID_NX) {
535 outw(voice->ESO, TRID_REG(trident, CH_DX_ESO_DELTA) + 2); 553 outw(voice->ESO, TRID_REG(trident, CH_DX_ESO_DELTA) + 2);
536 } else { 554 } else {
537 outl(((voice->Delta << 16) & 0xff000000) | (voice->ESO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_ESO)); 555 outl(((voice->Delta << 16) & 0xff000000) | (voice->ESO & 0x00ffffff),
556 TRID_REG(trident, CH_NX_DELTA_ESO));
538 } 557 }
539} 558}
540 559
@@ -550,7 +569,9 @@ static void snd_trident_write_eso_reg(trident_t * trident, snd_trident_voice_t *
550 569
551 ---------------------------------------------------------------------------*/ 570 ---------------------------------------------------------------------------*/
552 571
553static void snd_trident_write_vol_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int Vol) 572static void snd_trident_write_vol_reg(struct snd_trident * trident,
573 struct snd_trident_voice * voice,
574 unsigned int Vol)
554{ 575{
555 voice->Vol = Vol; 576 voice->Vol = Vol;
556 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); 577 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
@@ -561,7 +582,8 @@ static void snd_trident_write_vol_reg(trident_t * trident, snd_trident_voice_t *
561 break; 582 break;
562 case TRIDENT_DEVICE_ID_SI7018: 583 case TRIDENT_DEVICE_ID_SI7018:
563 // printk("voice->Vol = 0x%x\n", voice->Vol); 584 // printk("voice->Vol = 0x%x\n", voice->Vol);
564 outw((voice->CTRL << 12) | voice->Vol, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); 585 outw((voice->CTRL << 12) | voice->Vol,
586 TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
565 break; 587 break;
566 } 588 }
567} 589}
@@ -578,11 +600,14 @@ static void snd_trident_write_vol_reg(trident_t * trident, snd_trident_voice_t *
578 600
579 ---------------------------------------------------------------------------*/ 601 ---------------------------------------------------------------------------*/
580 602
581static void snd_trident_write_pan_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int Pan) 603static void snd_trident_write_pan_reg(struct snd_trident * trident,
604 struct snd_trident_voice * voice,
605 unsigned int Pan)
582{ 606{
583 voice->Pan = Pan; 607 voice->Pan = Pan;
584 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); 608 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
585 outb(((voice->GVSel & 0x01) << 7) | (voice->Pan & 0x7f), TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 3)); 609 outb(((voice->GVSel & 0x01) << 7) | (voice->Pan & 0x7f),
610 TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 3));
586} 611}
587 612
588/*--------------------------------------------------------------------------- 613/*---------------------------------------------------------------------------
@@ -597,12 +622,16 @@ static void snd_trident_write_pan_reg(trident_t * trident, snd_trident_voice_t *
597 622
598 ---------------------------------------------------------------------------*/ 623 ---------------------------------------------------------------------------*/
599 624
600static void snd_trident_write_rvol_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int RVol) 625static void snd_trident_write_rvol_reg(struct snd_trident * trident,
626 struct snd_trident_voice * voice,
627 unsigned int RVol)
601{ 628{
602 voice->RVol = RVol; 629 voice->RVol = RVol;
603 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); 630 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
604 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) | (voice->CVol & 0x007f), 631 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) |
605 TRID_REG(trident, trident->device == TRIDENT_DEVICE_ID_NX ? CH_NX_ALPHA_FMS_FMC_RVOL_CVOL : CH_DX_FMC_RVOL_CVOL)); 632 (voice->CVol & 0x007f),
633 TRID_REG(trident, trident->device == TRIDENT_DEVICE_ID_NX ?
634 CH_NX_ALPHA_FMS_FMC_RVOL_CVOL : CH_DX_FMC_RVOL_CVOL));
606} 635}
607 636
608/*--------------------------------------------------------------------------- 637/*---------------------------------------------------------------------------
@@ -617,12 +646,16 @@ static void snd_trident_write_rvol_reg(trident_t * trident, snd_trident_voice_t
617 646
618 ---------------------------------------------------------------------------*/ 647 ---------------------------------------------------------------------------*/
619 648
620static void snd_trident_write_cvol_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int CVol) 649static void snd_trident_write_cvol_reg(struct snd_trident * trident,
650 struct snd_trident_voice * voice,
651 unsigned int CVol)
621{ 652{
622 voice->CVol = CVol; 653 voice->CVol = CVol;
623 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); 654 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
624 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) | (voice->CVol & 0x007f), 655 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) |
625 TRID_REG(trident, trident->device == TRIDENT_DEVICE_ID_NX ? CH_NX_ALPHA_FMS_FMC_RVOL_CVOL : CH_DX_FMC_RVOL_CVOL)); 656 (voice->CVol & 0x007f),
657 TRID_REG(trident, trident->device == TRIDENT_DEVICE_ID_NX ?
658 CH_NX_ALPHA_FMS_FMC_RVOL_CVOL : CH_DX_FMC_RVOL_CVOL));
626} 659}
627 660
628/*--------------------------------------------------------------------------- 661/*---------------------------------------------------------------------------
@@ -696,7 +729,8 @@ static unsigned int snd_trident_convert_adc_rate(unsigned int rate)
696 Returns: Delta value. 729 Returns: Delta value.
697 730
698 ---------------------------------------------------------------------------*/ 731 ---------------------------------------------------------------------------*/
699static unsigned int snd_trident_spurious_threshold(unsigned int rate, unsigned int period_size) 732static unsigned int snd_trident_spurious_threshold(unsigned int rate,
733 unsigned int period_size)
700{ 734{
701 unsigned int res = (rate * period_size) / 48000; 735 unsigned int res = (rate * period_size) / 48000;
702 if (res < 64) 736 if (res < 64)
@@ -717,10 +751,10 @@ static unsigned int snd_trident_spurious_threshold(unsigned int rate, unsigned i
717 Returns: Control value. 751 Returns: Control value.
718 752
719 ---------------------------------------------------------------------------*/ 753 ---------------------------------------------------------------------------*/
720static unsigned int snd_trident_control_mode(snd_pcm_substream_t *substream) 754static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream)
721{ 755{
722 unsigned int CTRL; 756 unsigned int CTRL;
723 snd_pcm_runtime_t *runtime = substream->runtime; 757 struct snd_pcm_runtime *runtime = substream->runtime;
724 758
725 /* set ctrl mode 759 /* set ctrl mode
726 CTRL default: 8-bit (unsigned) mono, loop mode enabled 760 CTRL default: 8-bit (unsigned) mono, loop mode enabled
@@ -752,7 +786,7 @@ static unsigned int snd_trident_control_mode(snd_pcm_substream_t *substream)
752 786
753 ---------------------------------------------------------------------------*/ 787 ---------------------------------------------------------------------------*/
754 788
755static int snd_trident_ioctl(snd_pcm_substream_t * substream, 789static int snd_trident_ioctl(struct snd_pcm_substream *substream,
756 unsigned int cmd, 790 unsigned int cmd,
757 void *arg) 791 void *arg)
758{ 792{
@@ -774,12 +808,12 @@ static int snd_trident_ioctl(snd_pcm_substream_t * substream,
774 808
775 ---------------------------------------------------------------------------*/ 809 ---------------------------------------------------------------------------*/
776 810
777static int snd_trident_allocate_pcm_mem(snd_pcm_substream_t * substream, 811static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream,
778 snd_pcm_hw_params_t * hw_params) 812 struct snd_pcm_hw_params *hw_params)
779{ 813{
780 trident_t *trident = snd_pcm_substream_chip(substream); 814 struct snd_trident *trident = snd_pcm_substream_chip(substream);
781 snd_pcm_runtime_t *runtime = substream->runtime; 815 struct snd_pcm_runtime *runtime = substream->runtime;
782 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 816 struct snd_trident_voice *voice = runtime->private_data;
783 int err; 817 int err;
784 818
785 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) 819 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
@@ -808,13 +842,13 @@ static int snd_trident_allocate_pcm_mem(snd_pcm_substream_t * substream,
808 842
809 ---------------------------------------------------------------------------*/ 843 ---------------------------------------------------------------------------*/
810 844
811static int snd_trident_allocate_evoice(snd_pcm_substream_t * substream, 845static int snd_trident_allocate_evoice(struct snd_pcm_substream *substream,
812 snd_pcm_hw_params_t * hw_params) 846 struct snd_pcm_hw_params *hw_params)
813{ 847{
814 trident_t *trident = snd_pcm_substream_chip(substream); 848 struct snd_trident *trident = snd_pcm_substream_chip(substream);
815 snd_pcm_runtime_t *runtime = substream->runtime; 849 struct snd_pcm_runtime *runtime = substream->runtime;
816 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 850 struct snd_trident_voice *voice = runtime->private_data;
817 snd_trident_voice_t *evoice = voice->extra; 851 struct snd_trident_voice *evoice = voice->extra;
818 852
819 /* voice management */ 853 /* voice management */
820 854
@@ -848,8 +882,8 @@ static int snd_trident_allocate_evoice(snd_pcm_substream_t * substream,
848 882
849 ---------------------------------------------------------------------------*/ 883 ---------------------------------------------------------------------------*/
850 884
851static int snd_trident_hw_params(snd_pcm_substream_t * substream, 885static int snd_trident_hw_params(struct snd_pcm_substream *substream,
852 snd_pcm_hw_params_t * hw_params) 886 struct snd_pcm_hw_params *hw_params)
853{ 887{
854 int err; 888 int err;
855 889
@@ -870,12 +904,12 @@ static int snd_trident_hw_params(snd_pcm_substream_t * substream,
870 904
871 ---------------------------------------------------------------------------*/ 905 ---------------------------------------------------------------------------*/
872 906
873static int snd_trident_hw_free(snd_pcm_substream_t * substream) 907static int snd_trident_hw_free(struct snd_pcm_substream *substream)
874{ 908{
875 trident_t *trident = snd_pcm_substream_chip(substream); 909 struct snd_trident *trident = snd_pcm_substream_chip(substream);
876 snd_pcm_runtime_t *runtime = substream->runtime; 910 struct snd_pcm_runtime *runtime = substream->runtime;
877 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 911 struct snd_trident_voice *voice = runtime->private_data;
878 snd_trident_voice_t *evoice = voice ? voice->extra : NULL; 912 struct snd_trident_voice *evoice = voice ? voice->extra : NULL;
879 913
880 if (trident->tlb.entries) { 914 if (trident->tlb.entries) {
881 if (voice && voice->memblk) { 915 if (voice && voice->memblk) {
@@ -902,13 +936,13 @@ static int snd_trident_hw_free(snd_pcm_substream_t * substream)
902 936
903 ---------------------------------------------------------------------------*/ 937 ---------------------------------------------------------------------------*/
904 938
905static int snd_trident_playback_prepare(snd_pcm_substream_t * substream) 939static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
906{ 940{
907 trident_t *trident = snd_pcm_substream_chip(substream); 941 struct snd_trident *trident = snd_pcm_substream_chip(substream);
908 snd_pcm_runtime_t *runtime = substream->runtime; 942 struct snd_pcm_runtime *runtime = substream->runtime;
909 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 943 struct snd_trident_voice *voice = runtime->private_data;
910 snd_trident_voice_t *evoice = voice->extra; 944 struct snd_trident_voice *evoice = voice->extra;
911 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[substream->number]; 945 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number];
912 946
913 spin_lock_irq(&trident->reg_lock); 947 spin_lock_irq(&trident->reg_lock);
914 948
@@ -988,8 +1022,8 @@ static int snd_trident_playback_prepare(snd_pcm_substream_t * substream)
988 1022
989 ---------------------------------------------------------------------------*/ 1023 ---------------------------------------------------------------------------*/
990 1024
991static int snd_trident_capture_hw_params(snd_pcm_substream_t * substream, 1025static int snd_trident_capture_hw_params(struct snd_pcm_substream *substream,
992 snd_pcm_hw_params_t * hw_params) 1026 struct snd_pcm_hw_params *hw_params)
993{ 1027{
994 return snd_trident_allocate_pcm_mem(substream, hw_params); 1028 return snd_trident_allocate_pcm_mem(substream, hw_params);
995} 1029}
@@ -1005,11 +1039,11 @@ static int snd_trident_capture_hw_params(snd_pcm_substream_t * substream,
1005 1039
1006 ---------------------------------------------------------------------------*/ 1040 ---------------------------------------------------------------------------*/
1007 1041
1008static int snd_trident_capture_prepare(snd_pcm_substream_t * substream) 1042static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
1009{ 1043{
1010 trident_t *trident = snd_pcm_substream_chip(substream); 1044 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1011 snd_pcm_runtime_t *runtime = substream->runtime; 1045 struct snd_pcm_runtime *runtime = substream->runtime;
1012 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1046 struct snd_trident_voice *voice = runtime->private_data;
1013 unsigned int val, ESO_bytes; 1047 unsigned int val, ESO_bytes;
1014 1048
1015 spin_lock_irq(&trident->reg_lock); 1049 spin_lock_irq(&trident->reg_lock);
@@ -1097,8 +1131,8 @@ static int snd_trident_capture_prepare(snd_pcm_substream_t * substream)
1097 1131
1098 ---------------------------------------------------------------------------*/ 1132 ---------------------------------------------------------------------------*/
1099 1133
1100static int snd_trident_si7018_capture_hw_params(snd_pcm_substream_t * substream, 1134static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substream,
1101 snd_pcm_hw_params_t * hw_params) 1135 struct snd_pcm_hw_params *hw_params)
1102{ 1136{
1103 int err; 1137 int err;
1104 1138
@@ -1119,12 +1153,12 @@ static int snd_trident_si7018_capture_hw_params(snd_pcm_substream_t * substream,
1119 1153
1120 ---------------------------------------------------------------------------*/ 1154 ---------------------------------------------------------------------------*/
1121 1155
1122static int snd_trident_si7018_capture_hw_free(snd_pcm_substream_t * substream) 1156static int snd_trident_si7018_capture_hw_free(struct snd_pcm_substream *substream)
1123{ 1157{
1124 trident_t *trident = snd_pcm_substream_chip(substream); 1158 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1125 snd_pcm_runtime_t *runtime = substream->runtime; 1159 struct snd_pcm_runtime *runtime = substream->runtime;
1126 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1160 struct snd_trident_voice *voice = runtime->private_data;
1127 snd_trident_voice_t *evoice = voice ? voice->extra : NULL; 1161 struct snd_trident_voice *evoice = voice ? voice->extra : NULL;
1128 1162
1129 snd_pcm_lib_free_pages(substream); 1163 snd_pcm_lib_free_pages(substream);
1130 if (evoice != NULL) { 1164 if (evoice != NULL) {
@@ -1145,12 +1179,12 @@ static int snd_trident_si7018_capture_hw_free(snd_pcm_substream_t * substream)
1145 1179
1146 ---------------------------------------------------------------------------*/ 1180 ---------------------------------------------------------------------------*/
1147 1181
1148static int snd_trident_si7018_capture_prepare(snd_pcm_substream_t * substream) 1182static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substream)
1149{ 1183{
1150 trident_t *trident = snd_pcm_substream_chip(substream); 1184 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1151 snd_pcm_runtime_t *runtime = substream->runtime; 1185 struct snd_pcm_runtime *runtime = substream->runtime;
1152 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1186 struct snd_trident_voice *voice = runtime->private_data;
1153 snd_trident_voice_t *evoice = voice->extra; 1187 struct snd_trident_voice *evoice = voice->extra;
1154 1188
1155 spin_lock_irq(&trident->reg_lock); 1189 spin_lock_irq(&trident->reg_lock);
1156 1190
@@ -1216,12 +1250,12 @@ static int snd_trident_si7018_capture_prepare(snd_pcm_substream_t * substream)
1216 1250
1217 ---------------------------------------------------------------------------*/ 1251 ---------------------------------------------------------------------------*/
1218 1252
1219static int snd_trident_foldback_prepare(snd_pcm_substream_t * substream) 1253static int snd_trident_foldback_prepare(struct snd_pcm_substream *substream)
1220{ 1254{
1221 trident_t *trident = snd_pcm_substream_chip(substream); 1255 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1222 snd_pcm_runtime_t *runtime = substream->runtime; 1256 struct snd_pcm_runtime *runtime = substream->runtime;
1223 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1257 struct snd_trident_voice *voice = runtime->private_data;
1224 snd_trident_voice_t *evoice = voice->extra; 1258 struct snd_trident_voice *evoice = voice->extra;
1225 1259
1226 spin_lock_irq(&trident->reg_lock); 1260 spin_lock_irq(&trident->reg_lock);
1227 1261
@@ -1294,10 +1328,10 @@ static int snd_trident_foldback_prepare(snd_pcm_substream_t * substream)
1294 1328
1295 ---------------------------------------------------------------------------*/ 1329 ---------------------------------------------------------------------------*/
1296 1330
1297static int snd_trident_spdif_hw_params(snd_pcm_substream_t * substream, 1331static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
1298 snd_pcm_hw_params_t * hw_params) 1332 struct snd_pcm_hw_params *hw_params)
1299{ 1333{
1300 trident_t *trident = snd_pcm_substream_chip(substream); 1334 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1301 unsigned int old_bits = 0, change = 0; 1335 unsigned int old_bits = 0, change = 0;
1302 int err; 1336 int err;
1303 1337
@@ -1359,13 +1393,13 @@ static int snd_trident_spdif_hw_params(snd_pcm_substream_t * substream,
1359 1393
1360 ---------------------------------------------------------------------------*/ 1394 ---------------------------------------------------------------------------*/
1361 1395
1362static int snd_trident_spdif_prepare(snd_pcm_substream_t * substream) 1396static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
1363{ 1397{
1364 trident_t *trident = snd_pcm_substream_chip(substream); 1398 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1365 snd_pcm_runtime_t *runtime = substream->runtime; 1399 struct snd_pcm_runtime *runtime = substream->runtime;
1366 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1400 struct snd_trident_voice *voice = runtime->private_data;
1367 snd_trident_voice_t *evoice = voice->extra; 1401 struct snd_trident_voice *evoice = voice->extra;
1368 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[substream->number]; 1402 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number];
1369 unsigned int RESO, LBAO; 1403 unsigned int RESO, LBAO;
1370 unsigned int temp; 1404 unsigned int temp;
1371 1405
@@ -1498,15 +1532,15 @@ static int snd_trident_spdif_prepare(snd_pcm_substream_t * substream)
1498 1532
1499 ---------------------------------------------------------------------------*/ 1533 ---------------------------------------------------------------------------*/
1500 1534
1501static int snd_trident_trigger(snd_pcm_substream_t *substream, 1535static int snd_trident_trigger(struct snd_pcm_substream *substream,
1502 int cmd) 1536 int cmd)
1503 1537
1504{ 1538{
1505 trident_t *trident = snd_pcm_substream_chip(substream); 1539 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1506 struct list_head *pos; 1540 struct list_head *pos;
1507 snd_pcm_substream_t *s; 1541 struct snd_pcm_substream *s;
1508 unsigned int what, whati, capture_flag, spdif_flag; 1542 unsigned int what, whati, capture_flag, spdif_flag;
1509 snd_trident_voice_t *voice, *evoice; 1543 struct snd_trident_voice *voice, *evoice;
1510 unsigned int val, go; 1544 unsigned int val, go;
1511 1545
1512 switch (cmd) { 1546 switch (cmd) {
@@ -1528,8 +1562,8 @@ static int snd_trident_trigger(snd_pcm_substream_t *substream,
1528 val = inl(TRID_REG(trident, T4D_STIMER)) & 0x00ffffff; 1562 val = inl(TRID_REG(trident, T4D_STIMER)) & 0x00ffffff;
1529 snd_pcm_group_for_each(pos, substream) { 1563 snd_pcm_group_for_each(pos, substream) {
1530 s = snd_pcm_group_substream_entry(pos); 1564 s = snd_pcm_group_substream_entry(pos);
1531 if ((trident_t *) snd_pcm_substream_chip(s) == trident) { 1565 if ((struct snd_trident *) snd_pcm_substream_chip(s) == trident) {
1532 voice = (snd_trident_voice_t *) s->runtime->private_data; 1566 voice = s->runtime->private_data;
1533 evoice = voice->extra; 1567 evoice = voice->extra;
1534 what |= 1 << (voice->number & 0x1f); 1568 what |= 1 << (voice->number & 0x1f);
1535 if (evoice == NULL) { 1569 if (evoice == NULL) {
@@ -1596,11 +1630,11 @@ static int snd_trident_trigger(snd_pcm_substream_t *substream,
1596 1630
1597 ---------------------------------------------------------------------------*/ 1631 ---------------------------------------------------------------------------*/
1598 1632
1599static snd_pcm_uframes_t snd_trident_playback_pointer(snd_pcm_substream_t * substream) 1633static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *substream)
1600{ 1634{
1601 trident_t *trident = snd_pcm_substream_chip(substream); 1635 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1602 snd_pcm_runtime_t *runtime = substream->runtime; 1636 struct snd_pcm_runtime *runtime = substream->runtime;
1603 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1637 struct snd_trident_voice *voice = runtime->private_data;
1604 unsigned int cso; 1638 unsigned int cso;
1605 1639
1606 if (!voice->running) 1640 if (!voice->running)
@@ -1635,11 +1669,11 @@ static snd_pcm_uframes_t snd_trident_playback_pointer(snd_pcm_substream_t * subs
1635 1669
1636 ---------------------------------------------------------------------------*/ 1670 ---------------------------------------------------------------------------*/
1637 1671
1638static snd_pcm_uframes_t snd_trident_capture_pointer(snd_pcm_substream_t * substream) 1672static snd_pcm_uframes_t snd_trident_capture_pointer(struct snd_pcm_substream *substream)
1639{ 1673{
1640 trident_t *trident = snd_pcm_substream_chip(substream); 1674 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1641 snd_pcm_runtime_t *runtime = substream->runtime; 1675 struct snd_pcm_runtime *runtime = substream->runtime;
1642 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1676 struct snd_trident_voice *voice = runtime->private_data;
1643 unsigned int result; 1677 unsigned int result;
1644 1678
1645 if (!voice->running) 1679 if (!voice->running)
@@ -1665,11 +1699,11 @@ static snd_pcm_uframes_t snd_trident_capture_pointer(snd_pcm_substream_t * subst
1665 1699
1666 ---------------------------------------------------------------------------*/ 1700 ---------------------------------------------------------------------------*/
1667 1701
1668static snd_pcm_uframes_t snd_trident_spdif_pointer(snd_pcm_substream_t * substream) 1702static snd_pcm_uframes_t snd_trident_spdif_pointer(struct snd_pcm_substream *substream)
1669{ 1703{
1670 trident_t *trident = snd_pcm_substream_chip(substream); 1704 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1671 snd_pcm_runtime_t *runtime = substream->runtime; 1705 struct snd_pcm_runtime *runtime = substream->runtime;
1672 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1706 struct snd_trident_voice *voice = runtime->private_data;
1673 unsigned int result; 1707 unsigned int result;
1674 1708
1675 if (!voice->running) 1709 if (!voice->running)
@@ -1684,7 +1718,7 @@ static snd_pcm_uframes_t snd_trident_spdif_pointer(snd_pcm_substream_t * substre
1684 * Playback support device description 1718 * Playback support device description
1685 */ 1719 */
1686 1720
1687static snd_pcm_hardware_t snd_trident_playback = 1721static struct snd_pcm_hardware snd_trident_playback =
1688{ 1722{
1689 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1723 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1690 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1724 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1709,7 +1743,7 @@ static snd_pcm_hardware_t snd_trident_playback =
1709 * Capture support device description 1743 * Capture support device description
1710 */ 1744 */
1711 1745
1712static snd_pcm_hardware_t snd_trident_capture = 1746static struct snd_pcm_hardware snd_trident_capture =
1713{ 1747{
1714 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1748 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1715 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1749 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1734,7 +1768,7 @@ static snd_pcm_hardware_t snd_trident_capture =
1734 * Foldback capture support device description 1768 * Foldback capture support device description
1735 */ 1769 */
1736 1770
1737static snd_pcm_hardware_t snd_trident_foldback = 1771static struct snd_pcm_hardware snd_trident_foldback =
1738{ 1772{
1739 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1773 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1740 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1774 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1758,7 +1792,7 @@ static snd_pcm_hardware_t snd_trident_foldback =
1758 * SPDIF playback support device description 1792 * SPDIF playback support device description
1759 */ 1793 */
1760 1794
1761static snd_pcm_hardware_t snd_trident_spdif = 1795static struct snd_pcm_hardware snd_trident_spdif =
1762{ 1796{
1763 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1797 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1764 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1798 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1779,7 +1813,7 @@ static snd_pcm_hardware_t snd_trident_spdif =
1779 .fifo_size = 0, 1813 .fifo_size = 0,
1780}; 1814};
1781 1815
1782static snd_pcm_hardware_t snd_trident_spdif_7018 = 1816static struct snd_pcm_hardware snd_trident_spdif_7018 =
1783{ 1817{
1784 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1818 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1785 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1819 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1799,10 +1833,10 @@ static snd_pcm_hardware_t snd_trident_spdif_7018 =
1799 .fifo_size = 0, 1833 .fifo_size = 0,
1800}; 1834};
1801 1835
1802static void snd_trident_pcm_free_substream(snd_pcm_runtime_t *runtime) 1836static void snd_trident_pcm_free_substream(struct snd_pcm_runtime *runtime)
1803{ 1837{
1804 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1838 struct snd_trident_voice *voice = runtime->private_data;
1805 trident_t *trident; 1839 struct snd_trident *trident;
1806 1840
1807 if (voice) { 1841 if (voice) {
1808 trident = voice->trident; 1842 trident = voice->trident;
@@ -1810,11 +1844,11 @@ static void snd_trident_pcm_free_substream(snd_pcm_runtime_t *runtime)
1810 } 1844 }
1811} 1845}
1812 1846
1813static int snd_trident_playback_open(snd_pcm_substream_t * substream) 1847static int snd_trident_playback_open(struct snd_pcm_substream *substream)
1814{ 1848{
1815 trident_t *trident = snd_pcm_substream_chip(substream); 1849 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1816 snd_pcm_runtime_t *runtime = substream->runtime; 1850 struct snd_pcm_runtime *runtime = substream->runtime;
1817 snd_trident_voice_t *voice; 1851 struct snd_trident_voice *voice;
1818 1852
1819 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); 1853 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1820 if (voice == NULL) 1854 if (voice == NULL)
@@ -1838,11 +1872,11 @@ static int snd_trident_playback_open(snd_pcm_substream_t * substream)
1838 Parameters: substream - PCM substream class 1872 Parameters: substream - PCM substream class
1839 1873
1840 ---------------------------------------------------------------------------*/ 1874 ---------------------------------------------------------------------------*/
1841static int snd_trident_playback_close(snd_pcm_substream_t * substream) 1875static int snd_trident_playback_close(struct snd_pcm_substream *substream)
1842{ 1876{
1843 trident_t *trident = snd_pcm_substream_chip(substream); 1877 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1844 snd_pcm_runtime_t *runtime = substream->runtime; 1878 struct snd_pcm_runtime *runtime = substream->runtime;
1845 snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data; 1879 struct snd_trident_voice *voice = runtime->private_data;
1846 1880
1847 snd_trident_pcm_mixer_free(trident, voice, substream); 1881 snd_trident_pcm_mixer_free(trident, voice, substream);
1848 return 0; 1882 return 0;
@@ -1859,11 +1893,11 @@ static int snd_trident_playback_close(snd_pcm_substream_t * substream)
1859 1893
1860 ---------------------------------------------------------------------------*/ 1894 ---------------------------------------------------------------------------*/
1861 1895
1862static int snd_trident_spdif_open(snd_pcm_substream_t * substream) 1896static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
1863{ 1897{
1864 trident_t *trident = snd_pcm_substream_chip(substream); 1898 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1865 snd_trident_voice_t *voice; 1899 struct snd_trident_voice *voice;
1866 snd_pcm_runtime_t *runtime = substream->runtime; 1900 struct snd_pcm_runtime *runtime = substream->runtime;
1867 1901
1868 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); 1902 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1869 if (voice == NULL) 1903 if (voice == NULL)
@@ -1900,9 +1934,9 @@ static int snd_trident_spdif_open(snd_pcm_substream_t * substream)
1900 1934
1901 ---------------------------------------------------------------------------*/ 1935 ---------------------------------------------------------------------------*/
1902 1936
1903static int snd_trident_spdif_close(snd_pcm_substream_t * substream) 1937static int snd_trident_spdif_close(struct snd_pcm_substream *substream)
1904{ 1938{
1905 trident_t *trident = snd_pcm_substream_chip(substream); 1939 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1906 unsigned int temp; 1940 unsigned int temp;
1907 1941
1908 spin_lock_irq(&trident->reg_lock); 1942 spin_lock_irq(&trident->reg_lock);
@@ -1938,11 +1972,11 @@ static int snd_trident_spdif_close(snd_pcm_substream_t * substream)
1938 1972
1939 ---------------------------------------------------------------------------*/ 1973 ---------------------------------------------------------------------------*/
1940 1974
1941static int snd_trident_capture_open(snd_pcm_substream_t * substream) 1975static int snd_trident_capture_open(struct snd_pcm_substream *substream)
1942{ 1976{
1943 trident_t *trident = snd_pcm_substream_chip(substream); 1977 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1944 snd_trident_voice_t *voice; 1978 struct snd_trident_voice *voice;
1945 snd_pcm_runtime_t *runtime = substream->runtime; 1979 struct snd_pcm_runtime *runtime = substream->runtime;
1946 1980
1947 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); 1981 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1948 if (voice == NULL) 1982 if (voice == NULL)
@@ -1966,7 +2000,7 @@ static int snd_trident_capture_open(snd_pcm_substream_t * substream)
1966 Parameters: substream - PCM substream class 2000 Parameters: substream - PCM substream class
1967 2001
1968 ---------------------------------------------------------------------------*/ 2002 ---------------------------------------------------------------------------*/
1969static int snd_trident_capture_close(snd_pcm_substream_t * substream) 2003static int snd_trident_capture_close(struct snd_pcm_substream *substream)
1970{ 2004{
1971 return 0; 2005 return 0;
1972} 2006}
@@ -1982,11 +2016,11 @@ static int snd_trident_capture_close(snd_pcm_substream_t * substream)
1982 2016
1983 ---------------------------------------------------------------------------*/ 2017 ---------------------------------------------------------------------------*/
1984 2018
1985static int snd_trident_foldback_open(snd_pcm_substream_t * substream) 2019static int snd_trident_foldback_open(struct snd_pcm_substream *substream)
1986{ 2020{
1987 trident_t *trident = snd_pcm_substream_chip(substream); 2021 struct snd_trident *trident = snd_pcm_substream_chip(substream);
1988 snd_trident_voice_t *voice; 2022 struct snd_trident_voice *voice;
1989 snd_pcm_runtime_t *runtime = substream->runtime; 2023 struct snd_pcm_runtime *runtime = substream->runtime;
1990 2024
1991 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); 2025 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1992 if (voice == NULL) 2026 if (voice == NULL)
@@ -2009,12 +2043,12 @@ static int snd_trident_foldback_open(snd_pcm_substream_t * substream)
2009 Parameters: substream - PCM substream class 2043 Parameters: substream - PCM substream class
2010 2044
2011 ---------------------------------------------------------------------------*/ 2045 ---------------------------------------------------------------------------*/
2012static int snd_trident_foldback_close(snd_pcm_substream_t * substream) 2046static int snd_trident_foldback_close(struct snd_pcm_substream *substream)
2013{ 2047{
2014 trident_t *trident = snd_pcm_substream_chip(substream); 2048 struct snd_trident *trident = snd_pcm_substream_chip(substream);
2015 snd_trident_voice_t *voice; 2049 struct snd_trident_voice *voice;
2016 snd_pcm_runtime_t *runtime = substream->runtime; 2050 struct snd_pcm_runtime *runtime = substream->runtime;
2017 voice = (snd_trident_voice_t *) runtime->private_data; 2051 voice = runtime->private_data;
2018 2052
2019 /* stop capture channel */ 2053 /* stop capture channel */
2020 spin_lock_irq(&trident->reg_lock); 2054 spin_lock_irq(&trident->reg_lock);
@@ -2027,7 +2061,7 @@ static int snd_trident_foldback_close(snd_pcm_substream_t * substream)
2027 PCM operations 2061 PCM operations
2028 ---------------------------------------------------------------------------*/ 2062 ---------------------------------------------------------------------------*/
2029 2063
2030static snd_pcm_ops_t snd_trident_playback_ops = { 2064static struct snd_pcm_ops snd_trident_playback_ops = {
2031 .open = snd_trident_playback_open, 2065 .open = snd_trident_playback_open,
2032 .close = snd_trident_playback_close, 2066 .close = snd_trident_playback_close,
2033 .ioctl = snd_trident_ioctl, 2067 .ioctl = snd_trident_ioctl,
@@ -2038,7 +2072,7 @@ static snd_pcm_ops_t snd_trident_playback_ops = {
2038 .pointer = snd_trident_playback_pointer, 2072 .pointer = snd_trident_playback_pointer,
2039}; 2073};
2040 2074
2041static snd_pcm_ops_t snd_trident_nx_playback_ops = { 2075static struct snd_pcm_ops snd_trident_nx_playback_ops = {
2042 .open = snd_trident_playback_open, 2076 .open = snd_trident_playback_open,
2043 .close = snd_trident_playback_close, 2077 .close = snd_trident_playback_close,
2044 .ioctl = snd_trident_ioctl, 2078 .ioctl = snd_trident_ioctl,
@@ -2050,7 +2084,7 @@ static snd_pcm_ops_t snd_trident_nx_playback_ops = {
2050 .page = snd_pcm_sgbuf_ops_page, 2084 .page = snd_pcm_sgbuf_ops_page,
2051}; 2085};
2052 2086
2053static snd_pcm_ops_t snd_trident_capture_ops = { 2087static struct snd_pcm_ops snd_trident_capture_ops = {
2054 .open = snd_trident_capture_open, 2088 .open = snd_trident_capture_open,
2055 .close = snd_trident_capture_close, 2089 .close = snd_trident_capture_close,
2056 .ioctl = snd_trident_ioctl, 2090 .ioctl = snd_trident_ioctl,
@@ -2061,7 +2095,7 @@ static snd_pcm_ops_t snd_trident_capture_ops = {
2061 .pointer = snd_trident_capture_pointer, 2095 .pointer = snd_trident_capture_pointer,
2062}; 2096};
2063 2097
2064static snd_pcm_ops_t snd_trident_si7018_capture_ops = { 2098static struct snd_pcm_ops snd_trident_si7018_capture_ops = {
2065 .open = snd_trident_capture_open, 2099 .open = snd_trident_capture_open,
2066 .close = snd_trident_capture_close, 2100 .close = snd_trident_capture_close,
2067 .ioctl = snd_trident_ioctl, 2101 .ioctl = snd_trident_ioctl,
@@ -2072,7 +2106,7 @@ static snd_pcm_ops_t snd_trident_si7018_capture_ops = {
2072 .pointer = snd_trident_playback_pointer, 2106 .pointer = snd_trident_playback_pointer,
2073}; 2107};
2074 2108
2075static snd_pcm_ops_t snd_trident_foldback_ops = { 2109static struct snd_pcm_ops snd_trident_foldback_ops = {
2076 .open = snd_trident_foldback_open, 2110 .open = snd_trident_foldback_open,
2077 .close = snd_trident_foldback_close, 2111 .close = snd_trident_foldback_close,
2078 .ioctl = snd_trident_ioctl, 2112 .ioctl = snd_trident_ioctl,
@@ -2083,7 +2117,7 @@ static snd_pcm_ops_t snd_trident_foldback_ops = {
2083 .pointer = snd_trident_playback_pointer, 2117 .pointer = snd_trident_playback_pointer,
2084}; 2118};
2085 2119
2086static snd_pcm_ops_t snd_trident_nx_foldback_ops = { 2120static struct snd_pcm_ops snd_trident_nx_foldback_ops = {
2087 .open = snd_trident_foldback_open, 2121 .open = snd_trident_foldback_open,
2088 .close = snd_trident_foldback_close, 2122 .close = snd_trident_foldback_close,
2089 .ioctl = snd_trident_ioctl, 2123 .ioctl = snd_trident_ioctl,
@@ -2095,7 +2129,7 @@ static snd_pcm_ops_t snd_trident_nx_foldback_ops = {
2095 .page = snd_pcm_sgbuf_ops_page, 2129 .page = snd_pcm_sgbuf_ops_page,
2096}; 2130};
2097 2131
2098static snd_pcm_ops_t snd_trident_spdif_ops = { 2132static struct snd_pcm_ops snd_trident_spdif_ops = {
2099 .open = snd_trident_spdif_open, 2133 .open = snd_trident_spdif_open,
2100 .close = snd_trident_spdif_close, 2134 .close = snd_trident_spdif_close,
2101 .ioctl = snd_trident_ioctl, 2135 .ioctl = snd_trident_ioctl,
@@ -2106,7 +2140,7 @@ static snd_pcm_ops_t snd_trident_spdif_ops = {
2106 .pointer = snd_trident_spdif_pointer, 2140 .pointer = snd_trident_spdif_pointer,
2107}; 2141};
2108 2142
2109static snd_pcm_ops_t snd_trident_spdif_7018_ops = { 2143static struct snd_pcm_ops snd_trident_spdif_7018_ops = {
2110 .open = snd_trident_spdif_open, 2144 .open = snd_trident_spdif_open,
2111 .close = snd_trident_spdif_close, 2145 .close = snd_trident_spdif_close,
2112 .ioctl = snd_trident_ioctl, 2146 .ioctl = snd_trident_ioctl,
@@ -2128,9 +2162,10 @@ static snd_pcm_ops_t snd_trident_spdif_7018_ops = {
2128 2162
2129 ---------------------------------------------------------------------------*/ 2163 ---------------------------------------------------------------------------*/
2130 2164
2131int __devinit snd_trident_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm) 2165int __devinit snd_trident_pcm(struct snd_trident * trident,
2166 int device, struct snd_pcm ** rpcm)
2132{ 2167{
2133 snd_pcm_t *pcm; 2168 struct snd_pcm *pcm;
2134 int err; 2169 int err;
2135 2170
2136 if (rpcm) 2171 if (rpcm)
@@ -2156,7 +2191,7 @@ int __devinit snd_trident_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm
2156 trident->pcm = pcm; 2191 trident->pcm = pcm;
2157 2192
2158 if (trident->tlb.entries) { 2193 if (trident->tlb.entries) {
2159 snd_pcm_substream_t *substream; 2194 struct snd_pcm_substream *substream;
2160 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) 2195 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next)
2161 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, 2196 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG,
2162 snd_dma_pci_data(trident->pci), 2197 snd_dma_pci_data(trident->pci),
@@ -2185,12 +2220,13 @@ int __devinit snd_trident_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm
2185 2220
2186 ---------------------------------------------------------------------------*/ 2221 ---------------------------------------------------------------------------*/
2187 2222
2188int __devinit snd_trident_foldback_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm) 2223int __devinit snd_trident_foldback_pcm(struct snd_trident * trident,
2224 int device, struct snd_pcm ** rpcm)
2189{ 2225{
2190 snd_pcm_t *foldback; 2226 struct snd_pcm *foldback;
2191 int err; 2227 int err;
2192 int num_chan = 3; 2228 int num_chan = 3;
2193 snd_pcm_substream_t *substream; 2229 struct snd_pcm_substream *substream;
2194 2230
2195 if (rpcm) 2231 if (rpcm)
2196 *rpcm = NULL; 2232 *rpcm = NULL;
@@ -2241,9 +2277,10 @@ int __devinit snd_trident_foldback_pcm(trident_t * trident, int device, snd_pcm_
2241 2277
2242 ---------------------------------------------------------------------------*/ 2278 ---------------------------------------------------------------------------*/
2243 2279
2244int __devinit snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm) 2280int __devinit snd_trident_spdif_pcm(struct snd_trident * trident,
2281 int device, struct snd_pcm ** rpcm)
2245{ 2282{
2246 snd_pcm_t *spdif; 2283 struct snd_pcm *spdif;
2247 int err; 2284 int err;
2248 2285
2249 if (rpcm) 2286 if (rpcm)
@@ -2279,7 +2316,8 @@ int __devinit snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t *
2279 Description: enable/disable S/PDIF out from ac97 mixer 2316 Description: enable/disable S/PDIF out from ac97 mixer
2280 ---------------------------------------------------------------------------*/ 2317 ---------------------------------------------------------------------------*/
2281 2318
2282static int snd_trident_spdif_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2319static int snd_trident_spdif_control_info(struct snd_kcontrol *kcontrol,
2320 struct snd_ctl_elem_info *uinfo)
2283{ 2321{
2284 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 2322 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
2285 uinfo->count = 1; 2323 uinfo->count = 1;
@@ -2288,10 +2326,10 @@ static int snd_trident_spdif_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
2288 return 0; 2326 return 0;
2289} 2327}
2290 2328
2291static int snd_trident_spdif_control_get(snd_kcontrol_t * kcontrol, 2329static int snd_trident_spdif_control_get(struct snd_kcontrol *kcontrol,
2292 snd_ctl_elem_value_t * ucontrol) 2330 struct snd_ctl_elem_value *ucontrol)
2293{ 2331{
2294 trident_t *trident = snd_kcontrol_chip(kcontrol); 2332 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2295 unsigned char val; 2333 unsigned char val;
2296 2334
2297 spin_lock_irq(&trident->reg_lock); 2335 spin_lock_irq(&trident->reg_lock);
@@ -2301,10 +2339,10 @@ static int snd_trident_spdif_control_get(snd_kcontrol_t * kcontrol,
2301 return 0; 2339 return 0;
2302} 2340}
2303 2341
2304static int snd_trident_spdif_control_put(snd_kcontrol_t * kcontrol, 2342static int snd_trident_spdif_control_put(struct snd_kcontrol *kcontrol,
2305 snd_ctl_elem_value_t * ucontrol) 2343 struct snd_ctl_elem_value *ucontrol)
2306{ 2344{
2307 trident_t *trident = snd_kcontrol_chip(kcontrol); 2345 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2308 unsigned char val; 2346 unsigned char val;
2309 int change; 2347 int change;
2310 2348
@@ -2332,7 +2370,7 @@ static int snd_trident_spdif_control_put(snd_kcontrol_t * kcontrol,
2332 return change; 2370 return change;
2333} 2371}
2334 2372
2335static snd_kcontrol_new_t snd_trident_spdif_control __devinitdata = 2373static struct snd_kcontrol_new snd_trident_spdif_control __devinitdata =
2336{ 2374{
2337 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2375 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2338 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 2376 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH),
@@ -2348,17 +2386,18 @@ static snd_kcontrol_new_t snd_trident_spdif_control __devinitdata =
2348 Description: put/get the S/PDIF default settings 2386 Description: put/get the S/PDIF default settings
2349 ---------------------------------------------------------------------------*/ 2387 ---------------------------------------------------------------------------*/
2350 2388
2351static int snd_trident_spdif_default_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2389static int snd_trident_spdif_default_info(struct snd_kcontrol *kcontrol,
2390 struct snd_ctl_elem_info *uinfo)
2352{ 2391{
2353 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 2392 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
2354 uinfo->count = 1; 2393 uinfo->count = 1;
2355 return 0; 2394 return 0;
2356} 2395}
2357 2396
2358static int snd_trident_spdif_default_get(snd_kcontrol_t * kcontrol, 2397static int snd_trident_spdif_default_get(struct snd_kcontrol *kcontrol,
2359 snd_ctl_elem_value_t * ucontrol) 2398 struct snd_ctl_elem_value *ucontrol)
2360{ 2399{
2361 trident_t *trident = snd_kcontrol_chip(kcontrol); 2400 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2362 2401
2363 spin_lock_irq(&trident->reg_lock); 2402 spin_lock_irq(&trident->reg_lock);
2364 ucontrol->value.iec958.status[0] = (trident->spdif_bits >> 0) & 0xff; 2403 ucontrol->value.iec958.status[0] = (trident->spdif_bits >> 0) & 0xff;
@@ -2369,10 +2408,10 @@ static int snd_trident_spdif_default_get(snd_kcontrol_t * kcontrol,
2369 return 0; 2408 return 0;
2370} 2409}
2371 2410
2372static int snd_trident_spdif_default_put(snd_kcontrol_t * kcontrol, 2411static int snd_trident_spdif_default_put(struct snd_kcontrol *kcontrol,
2373 snd_ctl_elem_value_t * ucontrol) 2412 struct snd_ctl_elem_value *ucontrol)
2374{ 2413{
2375 trident_t *trident = snd_kcontrol_chip(kcontrol); 2414 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2376 unsigned int val; 2415 unsigned int val;
2377 int change; 2416 int change;
2378 2417
@@ -2394,7 +2433,7 @@ static int snd_trident_spdif_default_put(snd_kcontrol_t * kcontrol,
2394 return change; 2433 return change;
2395} 2434}
2396 2435
2397static snd_kcontrol_new_t snd_trident_spdif_default __devinitdata = 2436static struct snd_kcontrol_new snd_trident_spdif_default __devinitdata =
2398{ 2437{
2399 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2438 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2400 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 2439 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
@@ -2409,15 +2448,16 @@ static snd_kcontrol_new_t snd_trident_spdif_default __devinitdata =
2409 Description: put/get the S/PDIF mask 2448 Description: put/get the S/PDIF mask
2410 ---------------------------------------------------------------------------*/ 2449 ---------------------------------------------------------------------------*/
2411 2450
2412static int snd_trident_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2451static int snd_trident_spdif_mask_info(struct snd_kcontrol *kcontrol,
2452 struct snd_ctl_elem_info *uinfo)
2413{ 2453{
2414 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 2454 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
2415 uinfo->count = 1; 2455 uinfo->count = 1;
2416 return 0; 2456 return 0;
2417} 2457}
2418 2458
2419static int snd_trident_spdif_mask_get(snd_kcontrol_t * kcontrol, 2459static int snd_trident_spdif_mask_get(struct snd_kcontrol *kcontrol,
2420 snd_ctl_elem_value_t * ucontrol) 2460 struct snd_ctl_elem_value *ucontrol)
2421{ 2461{
2422 ucontrol->value.iec958.status[0] = 0xff; 2462 ucontrol->value.iec958.status[0] = 0xff;
2423 ucontrol->value.iec958.status[1] = 0xff; 2463 ucontrol->value.iec958.status[1] = 0xff;
@@ -2426,7 +2466,7 @@ static int snd_trident_spdif_mask_get(snd_kcontrol_t * kcontrol,
2426 return 0; 2466 return 0;
2427} 2467}
2428 2468
2429static snd_kcontrol_new_t snd_trident_spdif_mask __devinitdata = 2469static struct snd_kcontrol_new snd_trident_spdif_mask __devinitdata =
2430{ 2470{
2431 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2471 .access = SNDRV_CTL_ELEM_ACCESS_READ,
2432 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2472 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -2441,17 +2481,18 @@ static snd_kcontrol_new_t snd_trident_spdif_mask __devinitdata =
2441 Description: put/get the S/PDIF stream settings 2481 Description: put/get the S/PDIF stream settings
2442 ---------------------------------------------------------------------------*/ 2482 ---------------------------------------------------------------------------*/
2443 2483
2444static int snd_trident_spdif_stream_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2484static int snd_trident_spdif_stream_info(struct snd_kcontrol *kcontrol,
2485 struct snd_ctl_elem_info *uinfo)
2445{ 2486{
2446 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 2487 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
2447 uinfo->count = 1; 2488 uinfo->count = 1;
2448 return 0; 2489 return 0;
2449} 2490}
2450 2491
2451static int snd_trident_spdif_stream_get(snd_kcontrol_t * kcontrol, 2492static int snd_trident_spdif_stream_get(struct snd_kcontrol *kcontrol,
2452 snd_ctl_elem_value_t * ucontrol) 2493 struct snd_ctl_elem_value *ucontrol)
2453{ 2494{
2454 trident_t *trident = snd_kcontrol_chip(kcontrol); 2495 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2455 2496
2456 spin_lock_irq(&trident->reg_lock); 2497 spin_lock_irq(&trident->reg_lock);
2457 ucontrol->value.iec958.status[0] = (trident->spdif_pcm_bits >> 0) & 0xff; 2498 ucontrol->value.iec958.status[0] = (trident->spdif_pcm_bits >> 0) & 0xff;
@@ -2462,10 +2503,10 @@ static int snd_trident_spdif_stream_get(snd_kcontrol_t * kcontrol,
2462 return 0; 2503 return 0;
2463} 2504}
2464 2505
2465static int snd_trident_spdif_stream_put(snd_kcontrol_t * kcontrol, 2506static int snd_trident_spdif_stream_put(struct snd_kcontrol *kcontrol,
2466 snd_ctl_elem_value_t * ucontrol) 2507 struct snd_ctl_elem_value *ucontrol)
2467{ 2508{
2468 trident_t *trident = snd_kcontrol_chip(kcontrol); 2509 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2469 unsigned int val; 2510 unsigned int val;
2470 int change; 2511 int change;
2471 2512
@@ -2487,7 +2528,7 @@ static int snd_trident_spdif_stream_put(snd_kcontrol_t * kcontrol,
2487 return change; 2528 return change;
2488} 2529}
2489 2530
2490static snd_kcontrol_new_t snd_trident_spdif_stream __devinitdata = 2531static struct snd_kcontrol_new snd_trident_spdif_stream __devinitdata =
2491{ 2532{
2492 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2533 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
2493 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2534 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -2503,7 +2544,8 @@ static snd_kcontrol_new_t snd_trident_spdif_stream __devinitdata =
2503 Description: enable/disable rear path for ac97 2544 Description: enable/disable rear path for ac97
2504 ---------------------------------------------------------------------------*/ 2545 ---------------------------------------------------------------------------*/
2505 2546
2506static int snd_trident_ac97_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2547static int snd_trident_ac97_control_info(struct snd_kcontrol *kcontrol,
2548 struct snd_ctl_elem_info *uinfo)
2507{ 2549{
2508 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 2550 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
2509 uinfo->count = 1; 2551 uinfo->count = 1;
@@ -2512,10 +2554,10 @@ static int snd_trident_ac97_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
2512 return 0; 2554 return 0;
2513} 2555}
2514 2556
2515static int snd_trident_ac97_control_get(snd_kcontrol_t * kcontrol, 2557static int snd_trident_ac97_control_get(struct snd_kcontrol *kcontrol,
2516 snd_ctl_elem_value_t * ucontrol) 2558 struct snd_ctl_elem_value *ucontrol)
2517{ 2559{
2518 trident_t *trident = snd_kcontrol_chip(kcontrol); 2560 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2519 unsigned char val; 2561 unsigned char val;
2520 2562
2521 spin_lock_irq(&trident->reg_lock); 2563 spin_lock_irq(&trident->reg_lock);
@@ -2525,10 +2567,10 @@ static int snd_trident_ac97_control_get(snd_kcontrol_t * kcontrol,
2525 return 0; 2567 return 0;
2526} 2568}
2527 2569
2528static int snd_trident_ac97_control_put(snd_kcontrol_t * kcontrol, 2570static int snd_trident_ac97_control_put(struct snd_kcontrol *kcontrol,
2529 snd_ctl_elem_value_t * ucontrol) 2571 struct snd_ctl_elem_value *ucontrol)
2530{ 2572{
2531 trident_t *trident = snd_kcontrol_chip(kcontrol); 2573 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2532 unsigned char val; 2574 unsigned char val;
2533 int change = 0; 2575 int change = 0;
2534 2576
@@ -2544,7 +2586,7 @@ static int snd_trident_ac97_control_put(snd_kcontrol_t * kcontrol,
2544 return change; 2586 return change;
2545} 2587}
2546 2588
2547static snd_kcontrol_new_t snd_trident_ac97_rear_control __devinitdata = 2589static struct snd_kcontrol_new snd_trident_ac97_rear_control __devinitdata =
2548{ 2590{
2549 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2591 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2550 .name = "Rear Path", 2592 .name = "Rear Path",
@@ -2560,7 +2602,8 @@ static snd_kcontrol_new_t snd_trident_ac97_rear_control __devinitdata =
2560 Description: wave & music volume control 2602 Description: wave & music volume control
2561 ---------------------------------------------------------------------------*/ 2603 ---------------------------------------------------------------------------*/
2562 2604
2563static int snd_trident_vol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2605static int snd_trident_vol_control_info(struct snd_kcontrol *kcontrol,
2606 struct snd_ctl_elem_info *uinfo)
2564{ 2607{
2565 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2608 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2566 uinfo->count = 2; 2609 uinfo->count = 2;
@@ -2569,10 +2612,10 @@ static int snd_trident_vol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
2569 return 0; 2612 return 0;
2570} 2613}
2571 2614
2572static int snd_trident_vol_control_get(snd_kcontrol_t * kcontrol, 2615static int snd_trident_vol_control_get(struct snd_kcontrol *kcontrol,
2573 snd_ctl_elem_value_t * ucontrol) 2616 struct snd_ctl_elem_value *ucontrol)
2574{ 2617{
2575 trident_t *trident = snd_kcontrol_chip(kcontrol); 2618 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2576 unsigned int val; 2619 unsigned int val;
2577 2620
2578 val = trident->musicvol_wavevol; 2621 val = trident->musicvol_wavevol;
@@ -2581,10 +2624,10 @@ static int snd_trident_vol_control_get(snd_kcontrol_t * kcontrol,
2581 return 0; 2624 return 0;
2582} 2625}
2583 2626
2584static int snd_trident_vol_control_put(snd_kcontrol_t * kcontrol, 2627static int snd_trident_vol_control_put(struct snd_kcontrol *kcontrol,
2585 snd_ctl_elem_value_t * ucontrol) 2628 struct snd_ctl_elem_value *ucontrol)
2586{ 2629{
2587 trident_t *trident = snd_kcontrol_chip(kcontrol); 2630 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2588 unsigned int val; 2631 unsigned int val;
2589 int change = 0; 2632 int change = 0;
2590 2633
@@ -2599,7 +2642,7 @@ static int snd_trident_vol_control_put(snd_kcontrol_t * kcontrol,
2599 return change; 2642 return change;
2600} 2643}
2601 2644
2602static snd_kcontrol_new_t snd_trident_vol_music_control __devinitdata = 2645static struct snd_kcontrol_new snd_trident_vol_music_control __devinitdata =
2603{ 2646{
2604 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2647 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2605 .name = "Music Playback Volume", 2648 .name = "Music Playback Volume",
@@ -2609,7 +2652,7 @@ static snd_kcontrol_new_t snd_trident_vol_music_control __devinitdata =
2609 .private_value = 16, 2652 .private_value = 16,
2610}; 2653};
2611 2654
2612static snd_kcontrol_new_t snd_trident_vol_wave_control __devinitdata = 2655static struct snd_kcontrol_new snd_trident_vol_wave_control __devinitdata =
2613{ 2656{
2614 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2657 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2615 .name = "Wave Playback Volume", 2658 .name = "Wave Playback Volume",
@@ -2625,9 +2668,10 @@ static snd_kcontrol_new_t snd_trident_vol_wave_control __devinitdata =
2625 Description: PCM front volume control 2668 Description: PCM front volume control
2626 ---------------------------------------------------------------------------*/ 2669 ---------------------------------------------------------------------------*/
2627 2670
2628static int snd_trident_pcm_vol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2671static int snd_trident_pcm_vol_control_info(struct snd_kcontrol *kcontrol,
2672 struct snd_ctl_elem_info *uinfo)
2629{ 2673{
2630 trident_t *trident = snd_kcontrol_chip(kcontrol); 2674 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2631 2675
2632 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2676 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2633 uinfo->count = 1; 2677 uinfo->count = 1;
@@ -2638,11 +2682,11 @@ static int snd_trident_pcm_vol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_el
2638 return 0; 2682 return 0;
2639} 2683}
2640 2684
2641static int snd_trident_pcm_vol_control_get(snd_kcontrol_t * kcontrol, 2685static int snd_trident_pcm_vol_control_get(struct snd_kcontrol *kcontrol,
2642 snd_ctl_elem_value_t * ucontrol) 2686 struct snd_ctl_elem_value *ucontrol)
2643{ 2687{
2644 trident_t *trident = snd_kcontrol_chip(kcontrol); 2688 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2645 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2689 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2646 2690
2647 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { 2691 if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
2648 ucontrol->value.integer.value[0] = 1023 - mix->vol; 2692 ucontrol->value.integer.value[0] = 1023 - mix->vol;
@@ -2652,11 +2696,11 @@ static int snd_trident_pcm_vol_control_get(snd_kcontrol_t * kcontrol,
2652 return 0; 2696 return 0;
2653} 2697}
2654 2698
2655static int snd_trident_pcm_vol_control_put(snd_kcontrol_t * kcontrol, 2699static int snd_trident_pcm_vol_control_put(struct snd_kcontrol *kcontrol,
2656 snd_ctl_elem_value_t * ucontrol) 2700 struct snd_ctl_elem_value *ucontrol)
2657{ 2701{
2658 trident_t *trident = snd_kcontrol_chip(kcontrol); 2702 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2659 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2703 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2660 unsigned int val; 2704 unsigned int val;
2661 int change = 0; 2705 int change = 0;
2662 2706
@@ -2674,7 +2718,7 @@ static int snd_trident_pcm_vol_control_put(snd_kcontrol_t * kcontrol,
2674 return change; 2718 return change;
2675} 2719}
2676 2720
2677static snd_kcontrol_new_t snd_trident_pcm_vol_control __devinitdata = 2721static struct snd_kcontrol_new snd_trident_pcm_vol_control __devinitdata =
2678{ 2722{
2679 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2680 .name = "PCM Front Playback Volume", 2724 .name = "PCM Front Playback Volume",
@@ -2691,7 +2735,8 @@ static snd_kcontrol_new_t snd_trident_pcm_vol_control __devinitdata =
2691 Description: PCM front pan control 2735 Description: PCM front pan control
2692 ---------------------------------------------------------------------------*/ 2736 ---------------------------------------------------------------------------*/
2693 2737
2694static int snd_trident_pcm_pan_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2738static int snd_trident_pcm_pan_control_info(struct snd_kcontrol *kcontrol,
2739 struct snd_ctl_elem_info *uinfo)
2695{ 2740{
2696 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2741 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2697 uinfo->count = 1; 2742 uinfo->count = 1;
@@ -2700,11 +2745,11 @@ static int snd_trident_pcm_pan_control_info(snd_kcontrol_t *kcontrol, snd_ctl_el
2700 return 0; 2745 return 0;
2701} 2746}
2702 2747
2703static int snd_trident_pcm_pan_control_get(snd_kcontrol_t * kcontrol, 2748static int snd_trident_pcm_pan_control_get(struct snd_kcontrol *kcontrol,
2704 snd_ctl_elem_value_t * ucontrol) 2749 struct snd_ctl_elem_value *ucontrol)
2705{ 2750{
2706 trident_t *trident = snd_kcontrol_chip(kcontrol); 2751 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2707 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2752 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2708 2753
2709 ucontrol->value.integer.value[0] = mix->pan; 2754 ucontrol->value.integer.value[0] = mix->pan;
2710 if (ucontrol->value.integer.value[0] & 0x40) { 2755 if (ucontrol->value.integer.value[0] & 0x40) {
@@ -2715,11 +2760,11 @@ static int snd_trident_pcm_pan_control_get(snd_kcontrol_t * kcontrol,
2715 return 0; 2760 return 0;
2716} 2761}
2717 2762
2718static int snd_trident_pcm_pan_control_put(snd_kcontrol_t * kcontrol, 2763static int snd_trident_pcm_pan_control_put(struct snd_kcontrol *kcontrol,
2719 snd_ctl_elem_value_t * ucontrol) 2764 struct snd_ctl_elem_value *ucontrol)
2720{ 2765{
2721 trident_t *trident = snd_kcontrol_chip(kcontrol); 2766 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2722 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2767 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2723 unsigned char val; 2768 unsigned char val;
2724 int change = 0; 2769 int change = 0;
2725 2770
@@ -2736,7 +2781,7 @@ static int snd_trident_pcm_pan_control_put(snd_kcontrol_t * kcontrol,
2736 return change; 2781 return change;
2737} 2782}
2738 2783
2739static snd_kcontrol_new_t snd_trident_pcm_pan_control __devinitdata = 2784static struct snd_kcontrol_new snd_trident_pcm_pan_control __devinitdata =
2740{ 2785{
2741 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2786 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2742 .name = "PCM Pan Playback Control", 2787 .name = "PCM Pan Playback Control",
@@ -2753,7 +2798,8 @@ static snd_kcontrol_new_t snd_trident_pcm_pan_control __devinitdata =
2753 Description: PCM reverb volume control 2798 Description: PCM reverb volume control
2754 ---------------------------------------------------------------------------*/ 2799 ---------------------------------------------------------------------------*/
2755 2800
2756static int snd_trident_pcm_rvol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2801static int snd_trident_pcm_rvol_control_info(struct snd_kcontrol *kcontrol,
2802 struct snd_ctl_elem_info *uinfo)
2757{ 2803{
2758 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2804 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2759 uinfo->count = 1; 2805 uinfo->count = 1;
@@ -2762,21 +2808,21 @@ static int snd_trident_pcm_rvol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_e
2762 return 0; 2808 return 0;
2763} 2809}
2764 2810
2765static int snd_trident_pcm_rvol_control_get(snd_kcontrol_t * kcontrol, 2811static int snd_trident_pcm_rvol_control_get(struct snd_kcontrol *kcontrol,
2766 snd_ctl_elem_value_t * ucontrol) 2812 struct snd_ctl_elem_value *ucontrol)
2767{ 2813{
2768 trident_t *trident = snd_kcontrol_chip(kcontrol); 2814 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2769 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2815 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2770 2816
2771 ucontrol->value.integer.value[0] = 127 - mix->rvol; 2817 ucontrol->value.integer.value[0] = 127 - mix->rvol;
2772 return 0; 2818 return 0;
2773} 2819}
2774 2820
2775static int snd_trident_pcm_rvol_control_put(snd_kcontrol_t * kcontrol, 2821static int snd_trident_pcm_rvol_control_put(struct snd_kcontrol *kcontrol,
2776 snd_ctl_elem_value_t * ucontrol) 2822 struct snd_ctl_elem_value *ucontrol)
2777{ 2823{
2778 trident_t *trident = snd_kcontrol_chip(kcontrol); 2824 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2779 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2825 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2780 unsigned short val; 2826 unsigned short val;
2781 int change = 0; 2827 int change = 0;
2782 2828
@@ -2790,7 +2836,7 @@ static int snd_trident_pcm_rvol_control_put(snd_kcontrol_t * kcontrol,
2790 return change; 2836 return change;
2791} 2837}
2792 2838
2793static snd_kcontrol_new_t snd_trident_pcm_rvol_control __devinitdata = 2839static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata =
2794{ 2840{
2795 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2841 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2796 .name = "PCM Reverb Playback Volume", 2842 .name = "PCM Reverb Playback Volume",
@@ -2807,7 +2853,8 @@ static snd_kcontrol_new_t snd_trident_pcm_rvol_control __devinitdata =
2807 Description: PCM chorus volume control 2853 Description: PCM chorus volume control
2808 ---------------------------------------------------------------------------*/ 2854 ---------------------------------------------------------------------------*/
2809 2855
2810static int snd_trident_pcm_cvol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2856static int snd_trident_pcm_cvol_control_info(struct snd_kcontrol *kcontrol,
2857 struct snd_ctl_elem_info *uinfo)
2811{ 2858{
2812 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2859 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2813 uinfo->count = 1; 2860 uinfo->count = 1;
@@ -2816,21 +2863,21 @@ static int snd_trident_pcm_cvol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_e
2816 return 0; 2863 return 0;
2817} 2864}
2818 2865
2819static int snd_trident_pcm_cvol_control_get(snd_kcontrol_t * kcontrol, 2866static int snd_trident_pcm_cvol_control_get(struct snd_kcontrol *kcontrol,
2820 snd_ctl_elem_value_t * ucontrol) 2867 struct snd_ctl_elem_value *ucontrol)
2821{ 2868{
2822 trident_t *trident = snd_kcontrol_chip(kcontrol); 2869 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2823 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2870 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2824 2871
2825 ucontrol->value.integer.value[0] = 127 - mix->cvol; 2872 ucontrol->value.integer.value[0] = 127 - mix->cvol;
2826 return 0; 2873 return 0;
2827} 2874}
2828 2875
2829static int snd_trident_pcm_cvol_control_put(snd_kcontrol_t * kcontrol, 2876static int snd_trident_pcm_cvol_control_put(struct snd_kcontrol *kcontrol,
2830 snd_ctl_elem_value_t * ucontrol) 2877 struct snd_ctl_elem_value *ucontrol)
2831{ 2878{
2832 trident_t *trident = snd_kcontrol_chip(kcontrol); 2879 struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
2833 snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2880 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
2834 unsigned short val; 2881 unsigned short val;
2835 int change = 0; 2882 int change = 0;
2836 2883
@@ -2844,7 +2891,7 @@ static int snd_trident_pcm_cvol_control_put(snd_kcontrol_t * kcontrol,
2844 return change; 2891 return change;
2845} 2892}
2846 2893
2847static snd_kcontrol_new_t snd_trident_pcm_cvol_control __devinitdata = 2894static struct snd_kcontrol_new snd_trident_pcm_cvol_control __devinitdata =
2848{ 2895{
2849 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2896 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2850 .name = "PCM Chorus Playback Volume", 2897 .name = "PCM Chorus Playback Volume",
@@ -2855,9 +2902,11 @@ static snd_kcontrol_new_t snd_trident_pcm_cvol_control __devinitdata =
2855 .put = snd_trident_pcm_cvol_control_put, 2902 .put = snd_trident_pcm_cvol_control_put,
2856}; 2903};
2857 2904
2858static void snd_trident_notify_pcm_change1(snd_card_t * card, snd_kcontrol_t *kctl, int num, int activate) 2905static void snd_trident_notify_pcm_change1(struct snd_card *card,
2906 struct snd_kcontrol *kctl,
2907 int num, int activate)
2859{ 2908{
2860 snd_ctl_elem_id_t id; 2909 struct snd_ctl_elem_id id;
2861 2910
2862 if (! kctl) 2911 if (! kctl)
2863 return; 2912 return;
@@ -2870,7 +2919,9 @@ static void snd_trident_notify_pcm_change1(snd_card_t * card, snd_kcontrol_t *kc
2870 snd_ctl_build_ioff(&id, kctl, num)); 2919 snd_ctl_build_ioff(&id, kctl, num));
2871} 2920}
2872 2921
2873static void snd_trident_notify_pcm_change(trident_t *trident, snd_trident_pcm_mixer_t *tmix, int num, int activate) 2922static void snd_trident_notify_pcm_change(struct snd_trident *trident,
2923 struct snd_trident_pcm_mixer *tmix,
2924 int num, int activate)
2874{ 2925{
2875 snd_trident_notify_pcm_change1(trident->card, trident->ctl_vol, num, activate); 2926 snd_trident_notify_pcm_change1(trident->card, trident->ctl_vol, num, activate);
2876 snd_trident_notify_pcm_change1(trident->card, trident->ctl_pan, num, activate); 2927 snd_trident_notify_pcm_change1(trident->card, trident->ctl_pan, num, activate);
@@ -2878,9 +2929,11 @@ static void snd_trident_notify_pcm_change(trident_t *trident, snd_trident_pcm_mi
2878 snd_trident_notify_pcm_change1(trident->card, trident->ctl_cvol, num, activate); 2929 snd_trident_notify_pcm_change1(trident->card, trident->ctl_cvol, num, activate);
2879} 2930}
2880 2931
2881static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t *voice, snd_pcm_substream_t *substream) 2932static int snd_trident_pcm_mixer_build(struct snd_trident *trident,
2933 struct snd_trident_voice *voice,
2934 struct snd_pcm_substream *substream)
2882{ 2935{
2883 snd_trident_pcm_mixer_t *tmix; 2936 struct snd_trident_pcm_mixer *tmix;
2884 2937
2885 snd_assert(trident != NULL && voice != NULL && substream != NULL, return -EINVAL); 2938 snd_assert(trident != NULL && voice != NULL && substream != NULL, return -EINVAL);
2886 tmix = &trident->pcm_mixer[substream->number]; 2939 tmix = &trident->pcm_mixer[substream->number];
@@ -2893,9 +2946,9 @@ static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t *
2893 return 0; 2946 return 0;
2894} 2947}
2895 2948
2896static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t *voice, snd_pcm_substream_t *substream) 2949static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice *voice, struct snd_pcm_substream *substream)
2897{ 2950{
2898 snd_trident_pcm_mixer_t *tmix; 2951 struct snd_trident_pcm_mixer *tmix;
2899 2952
2900 snd_assert(trident != NULL && substream != NULL, return -EINVAL); 2953 snd_assert(trident != NULL && substream != NULL, return -EINVAL);
2901 tmix = &trident->pcm_mixer[substream->number]; 2954 tmix = &trident->pcm_mixer[substream->number];
@@ -2915,14 +2968,14 @@ static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t *v
2915 2968
2916 ---------------------------------------------------------------------------*/ 2969 ---------------------------------------------------------------------------*/
2917 2970
2918static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device) 2971static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spdif_device)
2919{ 2972{
2920 ac97_template_t _ac97; 2973 struct snd_ac97_template _ac97;
2921 snd_card_t * card = trident->card; 2974 struct snd_card *card = trident->card;
2922 snd_kcontrol_t *kctl; 2975 struct snd_kcontrol *kctl;
2923 snd_ctl_elem_value_t *uctl; 2976 struct snd_ctl_elem_value *uctl;
2924 int idx, err, retries = 2; 2977 int idx, err, retries = 2;
2925 static ac97_bus_ops_t ops = { 2978 static struct snd_ac97_bus_ops ops = {
2926 .write = snd_trident_codec_write, 2979 .write = snd_trident_codec_write,
2927 .read = snd_trident_codec_read, 2980 .read = snd_trident_codec_read,
2928 }; 2981 };
@@ -2959,7 +3012,7 @@ static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device
2959 snd_printk(KERN_ERR "SI7018: the secondary codec - invalid access\n"); 3012 snd_printk(KERN_ERR "SI7018: the secondary codec - invalid access\n");
2960#if 0 // only for my testing purpose --jk 3013#if 0 // only for my testing purpose --jk
2961 { 3014 {
2962 ac97_t *mc97; 3015 struct snd_ac97 *mc97;
2963 err = snd_ac97_modem(trident->card, &_ac97, &mc97); 3016 err = snd_ac97_modem(trident->card, &_ac97, &mc97);
2964 if (err < 0) 3017 if (err < 0)
2965 snd_printk(KERN_ERR "snd_ac97_modem returned error %i\n", err); 3018 snd_printk(KERN_ERR "snd_ac97_modem returned error %i\n", err);
@@ -2982,7 +3035,7 @@ static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device
2982 } 3035 }
2983 3036
2984 for (idx = 0; idx < 32; idx++) { 3037 for (idx = 0; idx < 32; idx++) {
2985 snd_trident_pcm_mixer_t *tmix; 3038 struct snd_trident_pcm_mixer *tmix;
2986 3039
2987 tmix = &trident->pcm_mixer[idx]; 3040 tmix = &trident->pcm_mixer[idx];
2988 tmix->voice = NULL; 3041 tmix->voice = NULL;
@@ -3080,7 +3133,7 @@ static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device
3080 3133
3081static unsigned char snd_trident_gameport_read(struct gameport *gameport) 3134static unsigned char snd_trident_gameport_read(struct gameport *gameport)
3082{ 3135{
3083 trident_t *chip = gameport_get_port_data(gameport); 3136 struct snd_trident *chip = gameport_get_port_data(gameport);
3084 3137
3085 snd_assert(chip, return 0); 3138 snd_assert(chip, return 0);
3086 return inb(TRID_REG(chip, GAMEPORT_LEGACY)); 3139 return inb(TRID_REG(chip, GAMEPORT_LEGACY));
@@ -3088,7 +3141,7 @@ static unsigned char snd_trident_gameport_read(struct gameport *gameport)
3088 3141
3089static void snd_trident_gameport_trigger(struct gameport *gameport) 3142static void snd_trident_gameport_trigger(struct gameport *gameport)
3090{ 3143{
3091 trident_t *chip = gameport_get_port_data(gameport); 3144 struct snd_trident *chip = gameport_get_port_data(gameport);
3092 3145
3093 snd_assert(chip, return); 3146 snd_assert(chip, return);
3094 outb(0xff, TRID_REG(chip, GAMEPORT_LEGACY)); 3147 outb(0xff, TRID_REG(chip, GAMEPORT_LEGACY));
@@ -3096,7 +3149,7 @@ static void snd_trident_gameport_trigger(struct gameport *gameport)
3096 3149
3097static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) 3150static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
3098{ 3151{
3099 trident_t *chip = gameport_get_port_data(gameport); 3152 struct snd_trident *chip = gameport_get_port_data(gameport);
3100 int i; 3153 int i;
3101 3154
3102 snd_assert(chip, return 0); 3155 snd_assert(chip, return 0);
@@ -3113,7 +3166,7 @@ static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes
3113 3166
3114static int snd_trident_gameport_open(struct gameport *gameport, int mode) 3167static int snd_trident_gameport_open(struct gameport *gameport, int mode)
3115{ 3168{
3116 trident_t *chip = gameport_get_port_data(gameport); 3169 struct snd_trident *chip = gameport_get_port_data(gameport);
3117 3170
3118 snd_assert(chip, return 0); 3171 snd_assert(chip, return 0);
3119 3172
@@ -3130,7 +3183,7 @@ static int snd_trident_gameport_open(struct gameport *gameport, int mode)
3130 } 3183 }
3131} 3184}
3132 3185
3133int __devinit snd_trident_create_gameport(trident_t *chip) 3186int __devinit snd_trident_create_gameport(struct snd_trident *chip)
3134{ 3187{
3135 struct gameport *gp; 3188 struct gameport *gp;
3136 3189
@@ -3156,7 +3209,7 @@ int __devinit snd_trident_create_gameport(trident_t *chip)
3156 return 0; 3209 return 0;
3157} 3210}
3158 3211
3159static inline void snd_trident_free_gameport(trident_t *chip) 3212static inline void snd_trident_free_gameport(struct snd_trident *chip)
3160{ 3213{
3161 if (chip->gameport) { 3214 if (chip->gameport) {
3162 gameport_unregister_port(chip->gameport); 3215 gameport_unregister_port(chip->gameport);
@@ -3164,14 +3217,14 @@ static inline void snd_trident_free_gameport(trident_t *chip)
3164 } 3217 }
3165} 3218}
3166#else 3219#else
3167int __devinit snd_trident_create_gameport(trident_t *chip) { return -ENOSYS; } 3220int __devinit snd_trident_create_gameport(struct snd_trident *chip) { return -ENOSYS; }
3168static inline void snd_trident_free_gameport(trident_t *chip) { } 3221static inline void snd_trident_free_gameport(struct snd_trident *chip) { }
3169#endif /* CONFIG_GAMEPORT */ 3222#endif /* CONFIG_GAMEPORT */
3170 3223
3171/* 3224/*
3172 * delay for 1 tick 3225 * delay for 1 tick
3173 */ 3226 */
3174static inline void do_delay(trident_t *chip) 3227static inline void do_delay(struct snd_trident *chip)
3175{ 3228{
3176 schedule_timeout_uninterruptible(1); 3229 schedule_timeout_uninterruptible(1);
3177} 3230}
@@ -3180,7 +3233,7 @@ static inline void do_delay(trident_t *chip)
3180 * SiS reset routine 3233 * SiS reset routine
3181 */ 3234 */
3182 3235
3183static int snd_trident_sis_reset(trident_t *trident) 3236static int snd_trident_sis_reset(struct snd_trident *trident)
3184{ 3237{
3185 unsigned long end_time; 3238 unsigned long end_time;
3186 unsigned int i; 3239 unsigned int i;
@@ -3233,10 +3286,10 @@ static int snd_trident_sis_reset(trident_t *trident)
3233 * /proc interface 3286 * /proc interface
3234 */ 3287 */
3235 3288
3236static void snd_trident_proc_read(snd_info_entry_t *entry, 3289static void snd_trident_proc_read(struct snd_info_entry *entry,
3237 snd_info_buffer_t * buffer) 3290 struct snd_info_buffer *buffer)
3238{ 3291{
3239 trident_t *trident = entry->private_data; 3292 struct snd_trident *trident = entry->private_data;
3240 char *s; 3293 char *s;
3241 3294
3242 switch (trident->device) { 3295 switch (trident->device) {
@@ -3274,9 +3327,9 @@ static void snd_trident_proc_read(snd_info_entry_t *entry,
3274#endif 3327#endif
3275} 3328}
3276 3329
3277static void __devinit snd_trident_proc_init(trident_t * trident) 3330static void __devinit snd_trident_proc_init(struct snd_trident * trident)
3278{ 3331{
3279 snd_info_entry_t *entry; 3332 struct snd_info_entry *entry;
3280 const char *s = "trident"; 3333 const char *s = "trident";
3281 3334
3282 if (trident->device == TRIDENT_DEVICE_ID_SI7018) 3335 if (trident->device == TRIDENT_DEVICE_ID_SI7018)
@@ -3285,9 +3338,9 @@ static void __devinit snd_trident_proc_init(trident_t * trident)
3285 snd_info_set_text_ops(entry, trident, 1024, snd_trident_proc_read); 3338 snd_info_set_text_ops(entry, trident, 1024, snd_trident_proc_read);
3286} 3339}
3287 3340
3288static int snd_trident_dev_free(snd_device_t *device) 3341static int snd_trident_dev_free(struct snd_device *device)
3289{ 3342{
3290 trident_t *trident = device->device_data; 3343 struct snd_trident *trident = device->device_data;
3291 return snd_trident_free(trident); 3344 return snd_trident_free(trident);
3292} 3345}
3293 3346
@@ -3303,7 +3356,7 @@ static int snd_trident_dev_free(snd_device_t *device)
3303 3356
3304 ---------------------------------------------------------------------------*/ 3357 ---------------------------------------------------------------------------*/
3305 3358
3306static int __devinit snd_trident_tlb_alloc(trident_t *trident) 3359static int __devinit snd_trident_tlb_alloc(struct snd_trident *trident)
3307{ 3360{
3308 int i; 3361 int i;
3309 3362
@@ -3318,7 +3371,7 @@ static int __devinit snd_trident_tlb_alloc(trident_t *trident)
3318 trident->tlb.entries = (unsigned int*)(((unsigned long)trident->tlb.buffer.area + SNDRV_TRIDENT_MAX_PAGES * 4 - 1) & ~(SNDRV_TRIDENT_MAX_PAGES * 4 - 1)); 3371 trident->tlb.entries = (unsigned int*)(((unsigned long)trident->tlb.buffer.area + SNDRV_TRIDENT_MAX_PAGES * 4 - 1) & ~(SNDRV_TRIDENT_MAX_PAGES * 4 - 1));
3319 trident->tlb.entries_dmaaddr = (trident->tlb.buffer.addr + SNDRV_TRIDENT_MAX_PAGES * 4 - 1) & ~(SNDRV_TRIDENT_MAX_PAGES * 4 - 1); 3372 trident->tlb.entries_dmaaddr = (trident->tlb.buffer.addr + SNDRV_TRIDENT_MAX_PAGES * 4 - 1) & ~(SNDRV_TRIDENT_MAX_PAGES * 4 - 1);
3320 /* allocate shadow TLB page table (virtual addresses) */ 3373 /* allocate shadow TLB page table (virtual addresses) */
3321 trident->tlb.shadow_entries = (unsigned long *)vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long)); 3374 trident->tlb.shadow_entries = vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long));
3322 if (trident->tlb.shadow_entries == NULL) { 3375 if (trident->tlb.shadow_entries == NULL) {
3323 snd_printk(KERN_ERR "trident: unable to allocate shadow TLB entries\n"); 3376 snd_printk(KERN_ERR "trident: unable to allocate shadow TLB entries\n");
3324 return -ENOMEM; 3377 return -ENOMEM;
@@ -3340,7 +3393,7 @@ static int __devinit snd_trident_tlb_alloc(trident_t *trident)
3340 if (trident->tlb.memhdr == NULL) 3393 if (trident->tlb.memhdr == NULL)
3341 return -ENOMEM; 3394 return -ENOMEM;
3342 3395
3343 trident->tlb.memhdr->block_extra_size = sizeof(snd_trident_memblk_arg_t); 3396 trident->tlb.memhdr->block_extra_size = sizeof(struct snd_trident_memblk_arg);
3344 return 0; 3397 return 0;
3345} 3398}
3346 3399
@@ -3348,7 +3401,7 @@ static int __devinit snd_trident_tlb_alloc(trident_t *trident)
3348 * initialize 4D DX chip 3401 * initialize 4D DX chip
3349 */ 3402 */
3350 3403
3351static void snd_trident_stop_all_voices(trident_t *trident) 3404static void snd_trident_stop_all_voices(struct snd_trident *trident)
3352{ 3405{
3353 outl(0xffffffff, TRID_REG(trident, T4D_STOP_A)); 3406 outl(0xffffffff, TRID_REG(trident, T4D_STOP_A));
3354 outl(0xffffffff, TRID_REG(trident, T4D_STOP_B)); 3407 outl(0xffffffff, TRID_REG(trident, T4D_STOP_B));
@@ -3356,7 +3409,7 @@ static void snd_trident_stop_all_voices(trident_t *trident)
3356 outl(0, TRID_REG(trident, T4D_AINTEN_B)); 3409 outl(0, TRID_REG(trident, T4D_AINTEN_B));
3357} 3410}
3358 3411
3359static int snd_trident_4d_dx_init(trident_t *trident) 3412static int snd_trident_4d_dx_init(struct snd_trident *trident)
3360{ 3413{
3361 struct pci_dev *pci = trident->pci; 3414 struct pci_dev *pci = trident->pci;
3362 unsigned long end_time; 3415 unsigned long end_time;
@@ -3396,7 +3449,7 @@ static int snd_trident_4d_dx_init(trident_t *trident)
3396/* 3449/*
3397 * initialize 4D NX chip 3450 * initialize 4D NX chip
3398 */ 3451 */
3399static int snd_trident_4d_nx_init(trident_t *trident) 3452static int snd_trident_4d_nx_init(struct snd_trident *trident)
3400{ 3453{
3401 struct pci_dev *pci = trident->pci; 3454 struct pci_dev *pci = trident->pci;
3402 unsigned long end_time; 3455 unsigned long end_time;
@@ -3453,7 +3506,7 @@ static int snd_trident_4d_nx_init(trident_t *trident)
3453/* 3506/*
3454 * initialize sis7018 chip 3507 * initialize sis7018 chip
3455 */ 3508 */
3456static int snd_trident_sis_init(trident_t *trident) 3509static int snd_trident_sis_init(struct snd_trident *trident)
3457{ 3510{
3458 int err; 3511 int err;
3459 3512
@@ -3484,18 +3537,18 @@ static int snd_trident_sis_init(trident_t *trident)
3484 3537
3485 ---------------------------------------------------------------------------*/ 3538 ---------------------------------------------------------------------------*/
3486 3539
3487int __devinit snd_trident_create(snd_card_t * card, 3540int __devinit snd_trident_create(struct snd_card *card,
3488 struct pci_dev *pci, 3541 struct pci_dev *pci,
3489 int pcm_streams, 3542 int pcm_streams,
3490 int pcm_spdif_device, 3543 int pcm_spdif_device,
3491 int max_wavetable_size, 3544 int max_wavetable_size,
3492 trident_t ** rtrident) 3545 struct snd_trident ** rtrident)
3493{ 3546{
3494 trident_t *trident; 3547 struct snd_trident *trident;
3495 int i, err; 3548 int i, err;
3496 snd_trident_voice_t *voice; 3549 struct snd_trident_voice *voice;
3497 snd_trident_pcm_mixer_t *tmix; 3550 struct snd_trident_pcm_mixer *tmix;
3498 static snd_device_ops_t ops = { 3551 static struct snd_device_ops ops = {
3499 .dev_free = snd_trident_dev_free, 3552 .dev_free = snd_trident_dev_free,
3500 }; 3553 };
3501 3554
@@ -3543,7 +3596,8 @@ int __devinit snd_trident_create(snd_card_t * card,
3543 } 3596 }
3544 trident->port = pci_resource_start(pci, 0); 3597 trident->port = pci_resource_start(pci, 0);
3545 3598
3546 if (request_irq(pci->irq, snd_trident_interrupt, SA_INTERRUPT|SA_SHIRQ, "Trident Audio", (void *) trident)) { 3599 if (request_irq(pci->irq, snd_trident_interrupt, SA_INTERRUPT|SA_SHIRQ,
3600 "Trident Audio", trident)) {
3547 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 3601 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
3548 snd_trident_free(trident); 3602 snd_trident_free(trident);
3549 return -EBUSY; 3603 return -EBUSY;
@@ -3627,7 +3681,7 @@ int __devinit snd_trident_create(snd_card_t * card,
3627 3681
3628 ---------------------------------------------------------------------------*/ 3682 ---------------------------------------------------------------------------*/
3629 3683
3630static int snd_trident_free(trident_t *trident) 3684static int snd_trident_free(struct snd_trident *trident)
3631{ 3685{
3632 snd_trident_free_gameport(trident); 3686 snd_trident_free_gameport(trident);
3633 snd_trident_disable_eso(trident); 3687 snd_trident_disable_eso(trident);
@@ -3647,7 +3701,7 @@ static int snd_trident_free(trident_t *trident)
3647 snd_dma_free_pages(&trident->tlb.buffer); 3701 snd_dma_free_pages(&trident->tlb.buffer);
3648 } 3702 }
3649 if (trident->irq >= 0) 3703 if (trident->irq >= 0)
3650 free_irq(trident->irq, (void *)trident); 3704 free_irq(trident->irq, trident);
3651 pci_release_regions(trident->pci); 3705 pci_release_regions(trident->pci);
3652 pci_disable_device(trident->pci); 3706 pci_disable_device(trident->pci);
3653 kfree(trident); 3707 kfree(trident);
@@ -3674,10 +3728,10 @@ static int snd_trident_free(trident_t *trident)
3674 3728
3675static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) 3729static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
3676{ 3730{
3677 trident_t *trident = dev_id; 3731 struct snd_trident *trident = dev_id;
3678 unsigned int audio_int, chn_int, stimer, channel, mask, tmp; 3732 unsigned int audio_int, chn_int, stimer, channel, mask, tmp;
3679 int delta; 3733 int delta;
3680 snd_trident_voice_t *voice; 3734 struct snd_trident_voice *voice;
3681 3735
3682 audio_int = inl(TRID_REG(trident, T4D_MISCINT)); 3736 audio_int = inl(TRID_REG(trident, T4D_MISCINT));
3683 if ((audio_int & (ADDRESS_IRQ|MPU401_IRQ)) == 0) 3737 if ((audio_int & (ADDRESS_IRQ|MPU401_IRQ)) == 0)
@@ -3779,21 +3833,21 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *
3779 Returns: None. 3833 Returns: None.
3780 3834
3781 ---------------------------------------------------------------------------*/ 3835 ---------------------------------------------------------------------------*/
3782int snd_trident_attach_synthesizer(trident_t *trident) 3836int snd_trident_attach_synthesizer(struct snd_trident *trident)
3783{ 3837{
3784#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) 3838#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
3785 if (snd_seq_device_new(trident->card, 1, SNDRV_SEQ_DEV_ID_TRIDENT, 3839 if (snd_seq_device_new(trident->card, 1, SNDRV_SEQ_DEV_ID_TRIDENT,
3786 sizeof(trident_t*), &trident->seq_dev) >= 0) { 3840 sizeof(struct snd_trident *), &trident->seq_dev) >= 0) {
3787 strcpy(trident->seq_dev->name, "4DWave"); 3841 strcpy(trident->seq_dev->name, "4DWave");
3788 *(trident_t**)SNDRV_SEQ_DEVICE_ARGPTR(trident->seq_dev) = trident; 3842 *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(trident->seq_dev) = trident;
3789 } 3843 }
3790#endif 3844#endif
3791 return 0; 3845 return 0;
3792} 3846}
3793 3847
3794snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port) 3848struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, int client, int port)
3795{ 3849{
3796 snd_trident_voice_t *pvoice; 3850 struct snd_trident_voice *pvoice;
3797 unsigned long flags; 3851 unsigned long flags;
3798 int idx; 3852 int idx;
3799 3853
@@ -3835,10 +3889,10 @@ snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int
3835 return NULL; 3889 return NULL;
3836} 3890}
3837 3891
3838void snd_trident_free_voice(trident_t * trident, snd_trident_voice_t *voice) 3892void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice)
3839{ 3893{
3840 unsigned long flags; 3894 unsigned long flags;
3841 void (*private_free)(snd_trident_voice_t *); 3895 void (*private_free)(struct snd_trident_voice *);
3842 void *private_data; 3896 void *private_data;
3843 3897
3844 if (voice == NULL || !voice->use) 3898 if (voice == NULL || !voice->use)
@@ -3863,7 +3917,7 @@ void snd_trident_free_voice(trident_t * trident, snd_trident_voice_t *voice)
3863 private_free(voice); 3917 private_free(voice);
3864} 3918}
3865 3919
3866static void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max) 3920static void snd_trident_clear_voices(struct snd_trident * trident, unsigned short v_min, unsigned short v_max)
3867{ 3921{
3868 unsigned int i, val, mask[2] = { 0, 0 }; 3922 unsigned int i, val, mask[2] = { 0, 0 };
3869 3923
@@ -3884,9 +3938,9 @@ static void snd_trident_clear_voices(trident_t * trident, unsigned short v_min,
3884} 3938}
3885 3939
3886#ifdef CONFIG_PM 3940#ifdef CONFIG_PM
3887static int snd_trident_suspend(snd_card_t *card, pm_message_t state) 3941static int snd_trident_suspend(struct snd_card *card, pm_message_t state)
3888{ 3942{
3889 trident_t *trident = card->pm_private_data; 3943 struct snd_trident *trident = card->pm_private_data;
3890 3944
3891 trident->in_suspend = 1; 3945 trident->in_suspend = 1;
3892 snd_pcm_suspend_all(trident->pcm); 3946 snd_pcm_suspend_all(trident->pcm);
@@ -3910,9 +3964,9 @@ static int snd_trident_suspend(snd_card_t *card, pm_message_t state)
3910 return 0; 3964 return 0;
3911} 3965}
3912 3966
3913static int snd_trident_resume(snd_card_t *card) 3967static int snd_trident_resume(struct snd_card *card)
3914{ 3968{
3915 trident_t *trident = card->pm_private_data; 3969 struct snd_trident *trident = card->pm_private_data;
3916 3970
3917 pci_enable_device(trident->pci); 3971 pci_enable_device(trident->pci);
3918 if (pci_set_dma_mask(trident->pci, 0x3fffffff) < 0 || 3972 if (pci_set_dma_mask(trident->pci, 0x3fffffff) < 0 ||
diff --git a/sound/pci/trident/trident_memory.c b/sound/pci/trident/trident_memory.c
index f3e6c546af74..cf09ea99755c 100644
--- a/sound/pci/trident/trident_memory.c
+++ b/sound/pci/trident/trident_memory.c
@@ -68,13 +68,14 @@
68#define page_to_addr(trident,page) __tlb_to_addr(trident, (page) << 1) 68#define page_to_addr(trident,page) __tlb_to_addr(trident, (page) << 1)
69 69
70/* fill TLB entries -- we need to fill two entries */ 70/* fill TLB entries -- we need to fill two entries */
71static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr, dma_addr_t addr) 71static inline void set_tlb_bus(struct snd_trident *trident, int page,
72 unsigned long ptr, dma_addr_t addr)
72{ 73{
73 page <<= 1; 74 page <<= 1;
74 __set_tlb_bus(trident, page, ptr, addr); 75 __set_tlb_bus(trident, page, ptr, addr);
75 __set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE, addr + SNDRV_TRIDENT_PAGE_SIZE); 76 __set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE, addr + SNDRV_TRIDENT_PAGE_SIZE);
76} 77}
77static inline void set_silent_tlb(trident_t *trident, int page) 78static inline void set_silent_tlb(struct snd_trident *trident, int page)
78{ 79{
79 page <<= 1; 80 page <<= 1;
80 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); 81 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
@@ -97,7 +98,8 @@ static inline void set_silent_tlb(trident_t *trident, int page)
97#define page_to_addr(trident,page) __tlb_to_addr(trident, (page) * UNIT_PAGES) 98#define page_to_addr(trident,page) __tlb_to_addr(trident, (page) * UNIT_PAGES)
98 99
99/* fill TLB entries -- UNIT_PAGES entries must be filled */ 100/* fill TLB entries -- UNIT_PAGES entries must be filled */
100static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr, dma_addr_t addr) 101static inline void set_tlb_bus(struct snd_trident *trident, int page,
102 unsigned long ptr, dma_addr_t addr)
101{ 103{
102 int i; 104 int i;
103 page *= UNIT_PAGES; 105 page *= UNIT_PAGES;
@@ -107,7 +109,7 @@ static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr,
107 addr += SNDRV_TRIDENT_PAGE_SIZE; 109 addr += SNDRV_TRIDENT_PAGE_SIZE;
108 } 110 }
109} 111}
110static inline void set_silent_tlb(trident_t *trident, int page) 112static inline void set_silent_tlb(struct snd_trident *trident, int page)
111{ 113{
112 int i; 114 int i;
113 page *= UNIT_PAGES; 115 page *= UNIT_PAGES;
@@ -118,7 +120,7 @@ static inline void set_silent_tlb(trident_t *trident, int page)
118#endif /* PAGE_SIZE */ 120#endif /* PAGE_SIZE */
119 121
120/* calculate buffer pointer from offset address */ 122/* calculate buffer pointer from offset address */
121static inline void *offset_ptr(trident_t *trident, int offset) 123static inline void *offset_ptr(struct snd_trident *trident, int offset)
122{ 124{
123 char *ptr; 125 char *ptr;
124 ptr = page_to_ptr(trident, get_aligned_page(offset)); 126 ptr = page_to_ptr(trident, get_aligned_page(offset));
@@ -127,16 +129,16 @@ static inline void *offset_ptr(trident_t *trident, int offset)
127} 129}
128 130
129/* first and last (aligned) pages of memory block */ 131/* first and last (aligned) pages of memory block */
130#define firstpg(blk) (((snd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->first_page) 132#define firstpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page)
131#define lastpg(blk) (((snd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->last_page) 133#define lastpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page)
132 134
133/* 135/*
134 * search empty pages which may contain given size 136 * search empty pages which may contain given size
135 */ 137 */
136static snd_util_memblk_t * 138static struct snd_util_memblk *
137search_empty(snd_util_memhdr_t *hdr, int size) 139search_empty(struct snd_util_memhdr *hdr, int size)
138{ 140{
139 snd_util_memblk_t *blk, *prev; 141 struct snd_util_memblk *blk, *prev;
140 int page, psize; 142 int page, psize;
141 struct list_head *p; 143 struct list_head *p;
142 144
@@ -144,7 +146,7 @@ search_empty(snd_util_memhdr_t *hdr, int size)
144 prev = NULL; 146 prev = NULL;
145 page = 0; 147 page = 0;
146 list_for_each(p, &hdr->block) { 148 list_for_each(p, &hdr->block) {
147 blk = list_entry(p, snd_util_memblk_t, list); 149 blk = list_entry(p, struct snd_util_memblk, list);
148 if (page + psize <= firstpg(blk)) 150 if (page + psize <= firstpg(blk))
149 goto __found_pages; 151 goto __found_pages;
150 page = lastpg(blk) + 1; 152 page = lastpg(blk) + 1;
@@ -183,12 +185,13 @@ static int is_valid_page(unsigned long ptr)
183/* 185/*
184 * page allocation for DMA (Scatter-Gather version) 186 * page allocation for DMA (Scatter-Gather version)
185 */ 187 */
186static snd_util_memblk_t * 188static struct snd_util_memblk *
187snd_trident_alloc_sg_pages(trident_t *trident, snd_pcm_substream_t *substream) 189snd_trident_alloc_sg_pages(struct snd_trident *trident,
190 struct snd_pcm_substream *substream)
188{ 191{
189 snd_util_memhdr_t *hdr; 192 struct snd_util_memhdr *hdr;
190 snd_util_memblk_t *blk; 193 struct snd_util_memblk *blk;
191 snd_pcm_runtime_t *runtime = substream->runtime; 194 struct snd_pcm_runtime *runtime = substream->runtime;
192 int idx, page; 195 int idx, page;
193 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); 196 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);
194 197
@@ -230,13 +233,14 @@ snd_trident_alloc_sg_pages(trident_t *trident, snd_pcm_substream_t *substream)
230/* 233/*
231 * page allocation for DMA (contiguous version) 234 * page allocation for DMA (contiguous version)
232 */ 235 */
233static snd_util_memblk_t * 236static struct snd_util_memblk *
234snd_trident_alloc_cont_pages(trident_t *trident, snd_pcm_substream_t *substream) 237snd_trident_alloc_cont_pages(struct snd_trident *trident,
238 struct snd_pcm_substream *substream)
235{ 239{
236 snd_util_memhdr_t *hdr; 240 struct snd_util_memhdr *hdr;
237 snd_util_memblk_t *blk; 241 struct snd_util_memblk *blk;
238 int page; 242 int page;
239 snd_pcm_runtime_t *runtime = substream->runtime; 243 struct snd_pcm_runtime *runtime = substream->runtime;
240 dma_addr_t addr; 244 dma_addr_t addr;
241 unsigned long ptr; 245 unsigned long ptr;
242 246
@@ -270,8 +274,9 @@ snd_trident_alloc_cont_pages(trident_t *trident, snd_pcm_substream_t *substream)
270/* 274/*
271 * page allocation for DMA 275 * page allocation for DMA
272 */ 276 */
273snd_util_memblk_t * 277struct snd_util_memblk *
274snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream) 278snd_trident_alloc_pages(struct snd_trident *trident,
279 struct snd_pcm_substream *substream)
275{ 280{
276 snd_assert(trident != NULL, return NULL); 281 snd_assert(trident != NULL, return NULL);
277 snd_assert(substream != NULL, return NULL); 282 snd_assert(substream != NULL, return NULL);
@@ -285,9 +290,10 @@ snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream)
285/* 290/*
286 * release DMA buffer from page table 291 * release DMA buffer from page table
287 */ 292 */
288int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk) 293int snd_trident_free_pages(struct snd_trident *trident,
294 struct snd_util_memblk *blk)
289{ 295{
290 snd_util_memhdr_t *hdr; 296 struct snd_util_memhdr *hdr;
291 int page; 297 int page;
292 298
293 snd_assert(trident != NULL, return -EINVAL); 299 snd_assert(trident != NULL, return -EINVAL);
@@ -314,17 +320,17 @@ int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk)
314 320
315/* 321/*
316 */ 322 */
317static int synth_alloc_pages(trident_t *hw, snd_util_memblk_t *blk); 323static int synth_alloc_pages(struct snd_trident *hw, struct snd_util_memblk *blk);
318static int synth_free_pages(trident_t *hw, snd_util_memblk_t *blk); 324static int synth_free_pages(struct snd_trident *hw, struct snd_util_memblk *blk);
319 325
320/* 326/*
321 * allocate a synth sample area 327 * allocate a synth sample area
322 */ 328 */
323snd_util_memblk_t * 329struct snd_util_memblk *
324snd_trident_synth_alloc(trident_t *hw, unsigned int size) 330snd_trident_synth_alloc(struct snd_trident *hw, unsigned int size)
325{ 331{
326 snd_util_memblk_t *blk; 332 struct snd_util_memblk *blk;
327 snd_util_memhdr_t *hdr = hw->tlb.memhdr; 333 struct snd_util_memhdr *hdr = hw->tlb.memhdr;
328 334
329 down(&hdr->block_mutex); 335 down(&hdr->block_mutex);
330 blk = __snd_util_mem_alloc(hdr, size); 336 blk = __snd_util_mem_alloc(hdr, size);
@@ -346,9 +352,9 @@ snd_trident_synth_alloc(trident_t *hw, unsigned int size)
346 * free a synth sample area 352 * free a synth sample area
347 */ 353 */
348int 354int
349snd_trident_synth_free(trident_t *hw, snd_util_memblk_t *blk) 355snd_trident_synth_free(struct snd_trident *hw, struct snd_util_memblk *blk)
350{ 356{
351 snd_util_memhdr_t *hdr = hw->tlb.memhdr; 357 struct snd_util_memhdr *hdr = hw->tlb.memhdr;
352 358
353 down(&hdr->block_mutex); 359 down(&hdr->block_mutex);
354 synth_free_pages(hw, blk); 360 synth_free_pages(hw, blk);
@@ -361,7 +367,7 @@ snd_trident_synth_free(trident_t *hw, snd_util_memblk_t *blk)
361/* 367/*
362 * reset TLB entry and free kernel page 368 * reset TLB entry and free kernel page
363 */ 369 */
364static void clear_tlb(trident_t *trident, int page) 370static void clear_tlb(struct snd_trident *trident, int page)
365{ 371{
366 void *ptr = page_to_ptr(trident, page); 372 void *ptr = page_to_ptr(trident, page);
367 dma_addr_t addr = page_to_addr(trident, page); 373 dma_addr_t addr = page_to_addr(trident, page);
@@ -378,20 +384,22 @@ static void clear_tlb(trident_t *trident, int page)
378} 384}
379 385
380/* check new allocation range */ 386/* check new allocation range */
381static void get_single_page_range(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk, int *first_page_ret, int *last_page_ret) 387static void get_single_page_range(struct snd_util_memhdr *hdr,
388 struct snd_util_memblk *blk,
389 int *first_page_ret, int *last_page_ret)
382{ 390{
383 struct list_head *p; 391 struct list_head *p;
384 snd_util_memblk_t *q; 392 struct snd_util_memblk *q;
385 int first_page, last_page; 393 int first_page, last_page;
386 first_page = firstpg(blk); 394 first_page = firstpg(blk);
387 if ((p = blk->list.prev) != &hdr->block) { 395 if ((p = blk->list.prev) != &hdr->block) {
388 q = list_entry(p, snd_util_memblk_t, list); 396 q = list_entry(p, struct snd_util_memblk, list);
389 if (lastpg(q) == first_page) 397 if (lastpg(q) == first_page)
390 first_page++; /* first page was already allocated */ 398 first_page++; /* first page was already allocated */
391 } 399 }
392 last_page = lastpg(blk); 400 last_page = lastpg(blk);
393 if ((p = blk->list.next) != &hdr->block) { 401 if ((p = blk->list.next) != &hdr->block) {
394 q = list_entry(p, snd_util_memblk_t, list); 402 q = list_entry(p, struct snd_util_memblk, list);
395 if (firstpg(q) == last_page) 403 if (firstpg(q) == last_page)
396 last_page--; /* last page was already allocated */ 404 last_page--; /* last page was already allocated */
397 } 405 }
@@ -402,7 +410,7 @@ static void get_single_page_range(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk
402/* 410/*
403 * allocate kernel pages and assign them to TLB 411 * allocate kernel pages and assign them to TLB
404 */ 412 */
405static int synth_alloc_pages(trident_t *hw, snd_util_memblk_t *blk) 413static int synth_alloc_pages(struct snd_trident *hw, struct snd_util_memblk *blk)
406{ 414{
407 int page, first_page, last_page; 415 int page, first_page, last_page;
408 struct snd_dma_buffer dmab; 416 struct snd_dma_buffer dmab;
@@ -438,7 +446,7 @@ __fail:
438/* 446/*
439 * free pages 447 * free pages
440 */ 448 */
441static int synth_free_pages(trident_t *trident, snd_util_memblk_t *blk) 449static int synth_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk)
442{ 450{
443 int page, first_page, last_page; 451 int page, first_page, last_page;
444 452
@@ -452,7 +460,9 @@ static int synth_free_pages(trident_t *trident, snd_util_memblk_t *blk)
452/* 460/*
453 * copy_from_user(blk + offset, data, size) 461 * copy_from_user(blk + offset, data, size)
454 */ 462 */
455int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char __user *data, int size) 463int snd_trident_synth_copy_from_user(struct snd_trident *trident,
464 struct snd_util_memblk *blk,
465 int offset, const char __user *data, int size)
456{ 466{
457 int page, nextofs, end_offset, temp, temp1; 467 int page, nextofs, end_offset, temp, temp1;
458 468
diff --git a/sound/pci/trident/trident_synth.c b/sound/pci/trident/trident_synth.c
index 5d5a719b0585..a49682ef3e3e 100644
--- a/sound/pci/trident/trident_synth.c
+++ b/sound/pci/trident/trident_synth.c
@@ -192,15 +192,15 @@ static unsigned short log_from_linear( unsigned short value )
192 * Sample handling operations 192 * Sample handling operations
193 */ 193 */
194 194
195static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position); 195static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
196static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode); 196static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode);
197static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_seq_frequency_t freq); 197static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq);
198static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_volume_t * volume); 198static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume);
199static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_loop_t * loop); 199static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop);
200static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position); 200static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
201static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, unsigned char *data); 201static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data);
202 202
203static snd_trident_sample_ops_t sample_ops = 203static struct snd_trident_sample_ops sample_ops =
204{ 204{
205 sample_start, 205 sample_start,
206 sample_stop, 206 sample_stop,
@@ -211,7 +211,7 @@ static snd_trident_sample_ops_t sample_ops =
211 sample_private1 211 sample_private1
212}; 212};
213 213
214static void snd_trident_simple_init(snd_trident_voice_t * voice) 214static void snd_trident_simple_init(struct snd_trident_voice * voice)
215{ 215{
216 //voice->handler_wave = interrupt_wave; 216 //voice->handler_wave = interrupt_wave;
217 //voice->handler_volume = interrupt_volume; 217 //voice->handler_volume = interrupt_volume;
@@ -220,10 +220,10 @@ static void snd_trident_simple_init(snd_trident_voice_t * voice)
220 voice->sample_ops = &sample_ops; 220 voice->sample_ops = &sample_ops;
221} 221}
222 222
223static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position) 223static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
224{ 224{
225 simple_instrument_t *simple; 225 struct simple_instrument *simple;
226 snd_seq_kinstr_t *instr; 226 struct snd_seq_kinstr *instr;
227 unsigned long flags; 227 unsigned long flags;
228 unsigned int loop_start, loop_end, sample_start, sample_end, start_offset; 228 unsigned int loop_start, loop_end, sample_start, sample_end, start_offset;
229 unsigned int value; 229 unsigned int value;
@@ -305,7 +305,7 @@ static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_s
305 snd_seq_instr_free_use(trident->synth.ilist, instr); 305 snd_seq_instr_free_use(trident->synth.ilist, instr);
306} 306}
307 307
308static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode) 308static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode)
309{ 309{
310 unsigned long flags; 310 unsigned long flags;
311 311
@@ -329,7 +329,7 @@ static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_se
329 } 329 }
330} 330}
331 331
332static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_seq_frequency_t freq) 332static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq)
333{ 333{
334 unsigned long flags; 334 unsigned long flags;
335 freq >>= 4; 335 freq >>= 4;
@@ -355,7 +355,7 @@ static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_se
355 spin_unlock_irqrestore(&trident->reg_lock, flags); 355 spin_unlock_irqrestore(&trident->reg_lock, flags);
356} 356}
357 357
358static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_volume_t * volume) 358static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume)
359{ 359{
360 unsigned long flags; 360 unsigned long flags;
361 unsigned short value; 361 unsigned short value;
@@ -407,11 +407,11 @@ static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_
407 spin_unlock_irqrestore(&trident->reg_lock, flags); 407 spin_unlock_irqrestore(&trident->reg_lock, flags);
408} 408}
409 409
410static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_loop_t * loop) 410static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop)
411{ 411{
412 unsigned long flags; 412 unsigned long flags;
413 simple_instrument_t *simple; 413 struct simple_instrument *simple;
414 snd_seq_kinstr_t *instr; 414 struct snd_seq_kinstr *instr;
415 unsigned int loop_start, loop_end; 415 unsigned int loop_start, loop_end;
416 416
417 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1); 417 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
@@ -446,11 +446,11 @@ static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_se
446 snd_seq_instr_free_use(trident->synth.ilist, instr); 446 snd_seq_instr_free_use(trident->synth.ilist, instr);
447} 447}
448 448
449static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position) 449static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
450{ 450{
451 unsigned long flags; 451 unsigned long flags;
452 simple_instrument_t *simple; 452 struct simple_instrument *simple;
453 snd_seq_kinstr_t *instr; 453 struct snd_seq_kinstr *instr;
454 unsigned int value; 454 unsigned int value;
455 455
456 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1); 456 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
@@ -496,7 +496,7 @@ static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq
496 snd_seq_instr_free_use(trident->synth.ilist, instr); 496 snd_seq_instr_free_use(trident->synth.ilist, instr);
497} 497}
498 498
499static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, unsigned char *data) 499static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data)
500{ 500{
501} 501}
502 502
@@ -504,10 +504,11 @@ static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, un
504 * Memory management / sample loading 504 * Memory management / sample loading
505 */ 505 */
506 506
507static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t * instr, 507static int snd_trident_simple_put_sample(void *private_data,
508 struct simple_instrument * instr,
508 char __user *data, long len, int atomic) 509 char __user *data, long len, int atomic)
509{ 510{
510 trident_t *trident = private_data; 511 struct snd_trident *trident = private_data;
511 int size = instr->size; 512 int size = instr->size;
512 int shift = 0; 513 int shift = 0;
513 514
@@ -529,7 +530,7 @@ static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t
529 return -EFAULT; 530 return -EFAULT;
530 531
531 if (trident->tlb.entries) { 532 if (trident->tlb.entries) {
532 snd_util_memblk_t *memblk; 533 struct snd_util_memblk *memblk;
533 memblk = snd_trident_synth_alloc(trident, size); 534 memblk = snd_trident_synth_alloc(trident, size);
534 if (memblk == NULL) 535 if (memblk == NULL)
535 return -ENOMEM; 536 return -ENOMEM;
@@ -557,10 +558,11 @@ static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t
557 return 0; 558 return 0;
558} 559}
559 560
560static int snd_trident_simple_get_sample(void *private_data, simple_instrument_t * instr, 561static int snd_trident_simple_get_sample(void *private_data,
562 struct simple_instrument * instr,
561 char __user *data, long len, int atomic) 563 char __user *data, long len, int atomic)
562{ 564{
563 //trident_t *trident = private_data; 565 //struct snd_trident *trident = private_data;
564 int size = instr->size; 566 int size = instr->size;
565 int shift = 0; 567 int shift = 0;
566 568
@@ -578,10 +580,11 @@ static int snd_trident_simple_get_sample(void *private_data, simple_instrument_t
578 return -EBUSY; 580 return -EBUSY;
579} 581}
580 582
581static int snd_trident_simple_remove_sample(void *private_data, simple_instrument_t * instr, 583static int snd_trident_simple_remove_sample(void *private_data,
584 struct simple_instrument * instr,
582 int atomic) 585 int atomic)
583{ 586{
584 trident_t *trident = private_data; 587 struct snd_trident *trident = private_data;
585 int size = instr->size; 588 int size = instr->size;
586 589
587 if (instr->format & SIMPLE_WAVE_16BIT) 590 if (instr->format & SIMPLE_WAVE_16BIT)
@@ -590,7 +593,7 @@ static int snd_trident_simple_remove_sample(void *private_data, simple_instrumen
590 size <<= 1; 593 size <<= 1;
591 594
592 if (trident->tlb.entries) { 595 if (trident->tlb.entries) {
593 snd_util_memblk_t *memblk = (snd_util_memblk_t*)instr->address.ptr; 596 struct snd_util_memblk *memblk = (struct snd_util_memblk *)instr->address.ptr;
594 if (memblk) 597 if (memblk)
595 snd_trident_synth_free(trident, memblk); 598 snd_trident_synth_free(trident, memblk);
596 else 599 else
@@ -612,9 +615,9 @@ static int snd_trident_simple_remove_sample(void *private_data, simple_instrumen
612 return 0; 615 return 0;
613} 616}
614 617
615static void select_instrument(trident_t * trident, snd_trident_voice_t * v) 618static void select_instrument(struct snd_trident * trident, struct snd_trident_voice * v)
616{ 619{
617 snd_seq_kinstr_t *instr; 620 struct snd_seq_kinstr *instr;
618 instr = snd_seq_instr_find(trident->synth.ilist, &v->instr, 0, 1); 621 instr = snd_seq_instr_find(trident->synth.ilist, &v->instr, 0, 1);
619 if (instr != NULL) { 622 if (instr != NULL) {
620 if (instr->ops) { 623 if (instr->ops) {
@@ -629,7 +632,7 @@ static void select_instrument(trident_t * trident, snd_trident_voice_t * v)
629 632
630 */ 633 */
631 634
632static void event_sample(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 635static void event_sample(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
633{ 636{
634 if (v->sample_ops && v->sample_ops->sample_stop) 637 if (v->sample_ops && v->sample_ops->sample_stop)
635 v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY); 638 v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY);
@@ -643,7 +646,7 @@ static void event_sample(snd_seq_event_t * ev, snd_trident_port_t * p, snd_tride
643 select_instrument(p->trident, v); 646 select_instrument(p->trident, v);
644} 647}
645 648
646static void event_cluster(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 649static void event_cluster(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
647{ 650{
648 if (v->sample_ops && v->sample_ops->sample_stop) 651 if (v->sample_ops && v->sample_ops->sample_stop)
649 v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY); 652 v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY);
@@ -651,49 +654,49 @@ static void event_cluster(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trid
651 select_instrument(p->trident, v); 654 select_instrument(p->trident, v);
652} 655}
653 656
654static void event_start(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 657static void event_start(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
655{ 658{
656 if (v->sample_ops && v->sample_ops->sample_start) 659 if (v->sample_ops && v->sample_ops->sample_start)
657 v->sample_ops->sample_start(p->trident, v, ev->data.sample.param.position); 660 v->sample_ops->sample_start(p->trident, v, ev->data.sample.param.position);
658} 661}
659 662
660static void event_stop(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 663static void event_stop(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
661{ 664{
662 if (v->sample_ops && v->sample_ops->sample_stop) 665 if (v->sample_ops && v->sample_ops->sample_stop)
663 v->sample_ops->sample_stop(p->trident, v, ev->data.sample.param.stop_mode); 666 v->sample_ops->sample_stop(p->trident, v, ev->data.sample.param.stop_mode);
664} 667}
665 668
666static void event_freq(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 669static void event_freq(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
667{ 670{
668 if (v->sample_ops && v->sample_ops->sample_freq) 671 if (v->sample_ops && v->sample_ops->sample_freq)
669 v->sample_ops->sample_freq(p->trident, v, ev->data.sample.param.frequency); 672 v->sample_ops->sample_freq(p->trident, v, ev->data.sample.param.frequency);
670} 673}
671 674
672static void event_volume(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 675static void event_volume(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
673{ 676{
674 if (v->sample_ops && v->sample_ops->sample_volume) 677 if (v->sample_ops && v->sample_ops->sample_volume)
675 v->sample_ops->sample_volume(p->trident, v, &ev->data.sample.param.volume); 678 v->sample_ops->sample_volume(p->trident, v, &ev->data.sample.param.volume);
676} 679}
677 680
678static void event_loop(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 681static void event_loop(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
679{ 682{
680 if (v->sample_ops && v->sample_ops->sample_loop) 683 if (v->sample_ops && v->sample_ops->sample_loop)
681 v->sample_ops->sample_loop(p->trident, v, &ev->data.sample.param.loop); 684 v->sample_ops->sample_loop(p->trident, v, &ev->data.sample.param.loop);
682} 685}
683 686
684static void event_position(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 687static void event_position(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
685{ 688{
686 if (v->sample_ops && v->sample_ops->sample_pos) 689 if (v->sample_ops && v->sample_ops->sample_pos)
687 v->sample_ops->sample_pos(p->trident, v, ev->data.sample.param.position); 690 v->sample_ops->sample_pos(p->trident, v, ev->data.sample.param.position);
688} 691}
689 692
690static void event_private1(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v) 693static void event_private1(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
691{ 694{
692 if (v->sample_ops && v->sample_ops->sample_private1) 695 if (v->sample_ops && v->sample_ops->sample_private1)
693 v->sample_ops->sample_private1(p->trident, v, (unsigned char *) &ev->data.sample.param.raw8); 696 v->sample_ops->sample_private1(p->trident, v, (unsigned char *) &ev->data.sample.param.raw8);
694} 697}
695 698
696typedef void (trident_sample_event_handler_t) (snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v); 699typedef void (trident_sample_event_handler_t) (struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v);
697 700
698static trident_sample_event_handler_t *trident_sample_event_handlers[9] = 701static trident_sample_event_handler_t *trident_sample_event_handlers[9] =
699{ 702{
@@ -708,11 +711,11 @@ static trident_sample_event_handler_t *trident_sample_event_handlers[9] =
708 event_private1 711 event_private1
709}; 712};
710 713
711static void snd_trident_sample_event(snd_seq_event_t * ev, snd_trident_port_t * p) 714static void snd_trident_sample_event(struct snd_seq_event * ev, struct snd_trident_port * p)
712{ 715{
713 int idx, voice; 716 int idx, voice;
714 trident_t *trident = p->trident; 717 struct snd_trident *trident = p->trident;
715 snd_trident_voice_t *v; 718 struct snd_trident_voice *v;
716 unsigned long flags; 719 unsigned long flags;
717 720
718 idx = ev->type - SNDRV_SEQ_EVENT_SAMPLE; 721 idx = ev->type - SNDRV_SEQ_EVENT_SAMPLE;
@@ -735,10 +738,10 @@ static void snd_trident_sample_event(snd_seq_event_t * ev, snd_trident_port_t *
735 738
736 */ 739 */
737 740
738static void snd_trident_synth_free_voices(trident_t * trident, int client, int port) 741static void snd_trident_synth_free_voices(struct snd_trident * trident, int client, int port)
739{ 742{
740 int idx; 743 int idx;
741 snd_trident_voice_t *voice; 744 struct snd_trident_voice *voice;
742 745
743 for (idx = 0; idx < 32; idx++) { 746 for (idx = 0; idx < 32; idx++) {
744 voice = &trident->synth.voices[idx]; 747 voice = &trident->synth.voices[idx];
@@ -747,11 +750,11 @@ static void snd_trident_synth_free_voices(trident_t * trident, int client, int p
747 } 750 }
748} 751}
749 752
750static int snd_trident_synth_use(void *private_data, snd_seq_port_subscribe_t * info) 753static int snd_trident_synth_use(void *private_data, struct snd_seq_port_subscribe * info)
751{ 754{
752 snd_trident_port_t *port = (snd_trident_port_t *) private_data; 755 struct snd_trident_port *port = private_data;
753 trident_t *trident = port->trident; 756 struct snd_trident *trident = port->trident;
754 snd_trident_voice_t *voice; 757 struct snd_trident_voice *voice;
755 unsigned int idx; 758 unsigned int idx;
756 unsigned long flags; 759 unsigned long flags;
757 760
@@ -786,10 +789,10 @@ static int snd_trident_synth_use(void *private_data, snd_seq_port_subscribe_t *
786 return 0; 789 return 0;
787} 790}
788 791
789static int snd_trident_synth_unuse(void *private_data, snd_seq_port_subscribe_t * info) 792static int snd_trident_synth_unuse(void *private_data, struct snd_seq_port_subscribe * info)
790{ 793{
791 snd_trident_port_t *port = (snd_trident_port_t *) private_data; 794 struct snd_trident_port *port = private_data;
792 trident_t *trident = port->trident; 795 struct snd_trident *trident = port->trident;
793 unsigned long flags; 796 unsigned long flags;
794 797
795 spin_lock_irqsave(&trident->reg_lock, flags); 798 spin_lock_irqsave(&trident->reg_lock, flags);
@@ -802,18 +805,18 @@ static int snd_trident_synth_unuse(void *private_data, snd_seq_port_subscribe_t
802 805
803 */ 806 */
804 807
805static void snd_trident_synth_free_private_instruments(snd_trident_port_t * p, int client) 808static void snd_trident_synth_free_private_instruments(struct snd_trident_port * p, int client)
806{ 809{
807 snd_seq_instr_header_t ifree; 810 struct snd_seq_instr_header ifree;
808 811
809 memset(&ifree, 0, sizeof(ifree)); 812 memset(&ifree, 0, sizeof(ifree));
810 ifree.cmd = SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE; 813 ifree.cmd = SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE;
811 snd_seq_instr_list_free_cond(p->trident->synth.ilist, &ifree, client, 0); 814 snd_seq_instr_list_free_cond(p->trident->synth.ilist, &ifree, client, 0);
812} 815}
813 816
814static int snd_trident_synth_event_input(snd_seq_event_t * ev, int direct, void *private_data, int atomic, int hop) 817static int snd_trident_synth_event_input(struct snd_seq_event * ev, int direct, void *private_data, int atomic, int hop)
815{ 818{
816 snd_trident_port_t *p = (snd_trident_port_t *) private_data; 819 struct snd_trident_port *p = (struct snd_trident_port *) private_data;
817 820
818 if (p == NULL) 821 if (p == NULL)
819 return -EINVAL; 822 return -EINVAL;
@@ -841,12 +844,12 @@ static int snd_trident_synth_event_input(snd_seq_event_t * ev, int direct, void
841} 844}
842 845
843static void snd_trident_synth_instr_notify(void *private_data, 846static void snd_trident_synth_instr_notify(void *private_data,
844 snd_seq_kinstr_t * instr, 847 struct snd_seq_kinstr * instr,
845 int what) 848 int what)
846{ 849{
847 int idx; 850 int idx;
848 trident_t *trident = private_data; 851 struct snd_trident *trident = private_data;
849 snd_trident_voice_t *pvoice; 852 struct snd_trident_voice *pvoice;
850 unsigned long flags; 853 unsigned long flags;
851 854
852 spin_lock_irqsave(&trident->event_lock, flags); 855 spin_lock_irqsave(&trident->event_lock, flags);
@@ -870,16 +873,16 @@ static void snd_trident_synth_instr_notify(void *private_data,
870 873
871static void snd_trident_synth_free_port(void *private_data) 874static void snd_trident_synth_free_port(void *private_data)
872{ 875{
873 snd_trident_port_t *p = (snd_trident_port_t *) private_data; 876 struct snd_trident_port *p = (struct snd_trident_port *) private_data;
874 877
875 if (p) 878 if (p)
876 snd_midi_channel_free_set(p->chset); 879 snd_midi_channel_free_set(p->chset);
877} 880}
878 881
879static int snd_trident_synth_create_port(trident_t * trident, int idx) 882static int snd_trident_synth_create_port(struct snd_trident * trident, int idx)
880{ 883{
881 snd_trident_port_t *p; 884 struct snd_trident_port *p;
882 snd_seq_port_callback_t callbacks; 885 struct snd_seq_port_callback callbacks;
883 char name[32]; 886 char name[32];
884 char *str; 887 char *str;
885 int result; 888 int result;
@@ -927,17 +930,17 @@ static int snd_trident_synth_create_port(trident_t * trident, int idx)
927 930
928 */ 931 */
929 932
930static int snd_trident_synth_new_device(snd_seq_device_t *dev) 933static int snd_trident_synth_new_device(struct snd_seq_device *dev)
931{ 934{
932 trident_t *trident; 935 struct snd_trident *trident;
933 int client, i; 936 int client, i;
934 snd_seq_client_callback_t callbacks; 937 struct snd_seq_client_callback callbacks;
935 snd_seq_client_info_t cinfo; 938 struct snd_seq_client_info cinfo;
936 snd_seq_port_subscribe_t sub; 939 struct snd_seq_port_subscribe sub;
937 snd_simple_ops_t *simpleops; 940 struct snd_simple_ops *simpleops;
938 char *str; 941 char *str;
939 942
940 trident = *(trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 943 trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
941 if (trident == NULL) 944 if (trident == NULL)
942 return -EINVAL; 945 return -EINVAL;
943 946
@@ -993,11 +996,11 @@ static int snd_trident_synth_new_device(snd_seq_device_t *dev)
993 return 0; 996 return 0;
994} 997}
995 998
996static int snd_trident_synth_delete_device(snd_seq_device_t *dev) 999static int snd_trident_synth_delete_device(struct snd_seq_device *dev)
997{ 1000{
998 trident_t *trident; 1001 struct snd_trident *trident;
999 1002
1000 trident = *(trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 1003 trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
1001 if (trident == NULL) 1004 if (trident == NULL)
1002 return -EINVAL; 1005 return -EINVAL;
1003 1006
@@ -1012,14 +1015,14 @@ static int snd_trident_synth_delete_device(snd_seq_device_t *dev)
1012 1015
1013static int __init alsa_trident_synth_init(void) 1016static int __init alsa_trident_synth_init(void)
1014{ 1017{
1015 static snd_seq_dev_ops_t ops = 1018 static struct snd_seq_dev_ops ops =
1016 { 1019 {
1017 snd_trident_synth_new_device, 1020 snd_trident_synth_new_device,
1018 snd_trident_synth_delete_device 1021 snd_trident_synth_delete_device
1019 }; 1022 };
1020 1023
1021 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_TRIDENT, &ops, 1024 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_TRIDENT, &ops,
1022 sizeof(trident_t*)); 1025 sizeof(struct snd_trident *));
1023} 1026}
1024 1027
1025static void __exit alsa_trident_synth_exit(void) 1028static void __exit alsa_trident_synth_exit(void)