diff options
Diffstat (limited to 'sound/isa/gus/gus_pcm.c')
-rw-r--r-- | sound/isa/gus/gus_pcm.c | 194 |
1 files changed, 98 insertions, 96 deletions
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index bae0fee705ee..d0829393ec8a 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c | |||
@@ -42,12 +42,12 @@ | |||
42 | #define SNDRV_GF1_PCM_PFLG_ACTIVE (1<<0) | 42 | #define SNDRV_GF1_PCM_PFLG_ACTIVE (1<<0) |
43 | #define SNDRV_GF1_PCM_PFLG_NEUTRAL (2<<0) | 43 | #define SNDRV_GF1_PCM_PFLG_NEUTRAL (2<<0) |
44 | 44 | ||
45 | typedef struct { | 45 | struct gus_pcm_private { |
46 | snd_gus_card_t * gus; | 46 | struct snd_gus_card * gus; |
47 | snd_pcm_substream_t * substream; | 47 | struct snd_pcm_substream *substream; |
48 | spinlock_t lock; | 48 | spinlock_t lock; |
49 | unsigned int voices; | 49 | unsigned int voices; |
50 | snd_gus_voice_t *pvoices[2]; | 50 | struct snd_gus_voice *pvoices[2]; |
51 | unsigned int memory; | 51 | unsigned int memory; |
52 | unsigned short flags; | 52 | unsigned short flags; |
53 | unsigned char voice_ctrl, ramp_ctrl; | 53 | unsigned char voice_ctrl, ramp_ctrl; |
@@ -58,13 +58,13 @@ typedef struct { | |||
58 | wait_queue_head_t sleep; | 58 | wait_queue_head_t sleep; |
59 | atomic_t dma_count; | 59 | atomic_t dma_count; |
60 | int final_volume; | 60 | int final_volume; |
61 | } gus_pcm_private_t; | 61 | }; |
62 | 62 | ||
63 | static int snd_gf1_pcm_use_dma = 1; | 63 | static int snd_gf1_pcm_use_dma = 1; |
64 | 64 | ||
65 | static void snd_gf1_pcm_block_change_ack(snd_gus_card_t * gus, void *private_data) | 65 | static void snd_gf1_pcm_block_change_ack(struct snd_gus_card * gus, void *private_data) |
66 | { | 66 | { |
67 | gus_pcm_private_t *pcmp = private_data; | 67 | struct gus_pcm_private *pcmp = private_data; |
68 | 68 | ||
69 | if (pcmp) { | 69 | if (pcmp) { |
70 | atomic_dec(&pcmp->dma_count); | 70 | atomic_dec(&pcmp->dma_count); |
@@ -72,14 +72,14 @@ static void snd_gf1_pcm_block_change_ack(snd_gus_card_t * gus, void *private_dat | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | static int snd_gf1_pcm_block_change(snd_pcm_substream_t * substream, | 75 | static int snd_gf1_pcm_block_change(struct snd_pcm_substream *substream, |
76 | unsigned int offset, | 76 | unsigned int offset, |
77 | unsigned int addr, | 77 | unsigned int addr, |
78 | unsigned int count) | 78 | unsigned int count) |
79 | { | 79 | { |
80 | snd_gf1_dma_block_t block; | 80 | struct snd_gf1_dma_block block; |
81 | snd_pcm_runtime_t *runtime = substream->runtime; | 81 | struct snd_pcm_runtime *runtime = substream->runtime; |
82 | gus_pcm_private_t *pcmp = runtime->private_data; | 82 | struct gus_pcm_private *pcmp = runtime->private_data; |
83 | 83 | ||
84 | count += offset & 31; | 84 | count += offset & 31; |
85 | offset &= ~31; | 85 | offset &= ~31; |
@@ -101,11 +101,11 @@ static int snd_gf1_pcm_block_change(snd_pcm_substream_t * substream, | |||
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static void snd_gf1_pcm_trigger_up(snd_pcm_substream_t * substream) | 104 | static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream) |
105 | { | 105 | { |
106 | snd_pcm_runtime_t *runtime = substream->runtime; | 106 | struct snd_pcm_runtime *runtime = substream->runtime; |
107 | gus_pcm_private_t *pcmp = runtime->private_data; | 107 | struct gus_pcm_private *pcmp = runtime->private_data; |
108 | snd_gus_card_t * gus = pcmp->gus; | 108 | struct snd_gus_card * gus = pcmp->gus; |
109 | unsigned long flags; | 109 | unsigned long flags; |
110 | unsigned char voice_ctrl, ramp_ctrl; | 110 | unsigned char voice_ctrl, ramp_ctrl; |
111 | unsigned short rate; | 111 | unsigned short rate; |
@@ -179,10 +179,11 @@ static void snd_gf1_pcm_trigger_up(snd_pcm_substream_t * substream) | |||
179 | spin_unlock_irqrestore(&gus->reg_lock, flags); | 179 | spin_unlock_irqrestore(&gus->reg_lock, flags); |
180 | } | 180 | } |
181 | 181 | ||
182 | static void snd_gf1_pcm_interrupt_wave(snd_gus_card_t * gus, snd_gus_voice_t *pvoice) | 182 | static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus, |
183 | struct snd_gus_voice *pvoice) | ||
183 | { | 184 | { |
184 | gus_pcm_private_t * pcmp; | 185 | struct gus_pcm_private * pcmp; |
185 | snd_pcm_runtime_t * runtime; | 186 | struct snd_pcm_runtime *runtime; |
186 | unsigned char voice_ctrl, ramp_ctrl; | 187 | unsigned char voice_ctrl, ramp_ctrl; |
187 | unsigned int idx; | 188 | unsigned int idx; |
188 | unsigned int end, step; | 189 | unsigned int end, step; |
@@ -261,11 +262,12 @@ static void snd_gf1_pcm_interrupt_wave(snd_gus_card_t * gus, snd_gus_voice_t *pv | |||
261 | #endif | 262 | #endif |
262 | } | 263 | } |
263 | 264 | ||
264 | static void snd_gf1_pcm_interrupt_volume(snd_gus_card_t * gus, snd_gus_voice_t * pvoice) | 265 | static void snd_gf1_pcm_interrupt_volume(struct snd_gus_card * gus, |
266 | struct snd_gus_voice * pvoice) | ||
265 | { | 267 | { |
266 | unsigned short vol; | 268 | unsigned short vol; |
267 | int cvoice; | 269 | int cvoice; |
268 | gus_pcm_private_t *pcmp = pvoice->private_data; | 270 | struct gus_pcm_private *pcmp = pvoice->private_data; |
269 | 271 | ||
270 | /* stop ramp, but leave rollover bit untouched */ | 272 | /* stop ramp, but leave rollover bit untouched */ |
271 | spin_lock(&gus->reg_lock); | 273 | spin_lock(&gus->reg_lock); |
@@ -289,11 +291,11 @@ static void snd_gf1_pcm_interrupt_volume(snd_gus_card_t * gus, snd_gus_voice_t * | |||
289 | spin_unlock(&gus->reg_lock); | 291 | spin_unlock(&gus->reg_lock); |
290 | } | 292 | } |
291 | 293 | ||
292 | static void snd_gf1_pcm_volume_change(snd_gus_card_t * gus) | 294 | static void snd_gf1_pcm_volume_change(struct snd_gus_card * gus) |
293 | { | 295 | { |
294 | } | 296 | } |
295 | 297 | ||
296 | static int snd_gf1_pcm_poke_block(snd_gus_card_t *gus, unsigned char *buf, | 298 | static int snd_gf1_pcm_poke_block(struct snd_gus_card *gus, unsigned char *buf, |
297 | unsigned int pos, unsigned int count, | 299 | unsigned int pos, unsigned int count, |
298 | int w16, int invert) | 300 | int w16, int invert) |
299 | { | 301 | { |
@@ -341,14 +343,14 @@ static int snd_gf1_pcm_poke_block(snd_gus_card_t *gus, unsigned char *buf, | |||
341 | return 0; | 343 | return 0; |
342 | } | 344 | } |
343 | 345 | ||
344 | static int snd_gf1_pcm_playback_copy(snd_pcm_substream_t *substream, | 346 | static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, |
345 | int voice, | 347 | int voice, |
346 | snd_pcm_uframes_t pos, | 348 | snd_pcm_uframes_t pos, |
347 | void __user *src, | 349 | void __user *src, |
348 | snd_pcm_uframes_t count) | 350 | snd_pcm_uframes_t count) |
349 | { | 351 | { |
350 | snd_pcm_runtime_t *runtime = substream->runtime; | 352 | struct snd_pcm_runtime *runtime = substream->runtime; |
351 | gus_pcm_private_t *pcmp = runtime->private_data; | 353 | struct gus_pcm_private *pcmp = runtime->private_data; |
352 | unsigned int bpos, len; | 354 | unsigned int bpos, len; |
353 | 355 | ||
354 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); | 356 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); |
@@ -360,7 +362,7 @@ static int snd_gf1_pcm_playback_copy(snd_pcm_substream_t *substream, | |||
360 | if (snd_gf1_pcm_use_dma && len > 32) { | 362 | if (snd_gf1_pcm_use_dma && len > 32) { |
361 | return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); | 363 | return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); |
362 | } else { | 364 | } else { |
363 | snd_gus_card_t *gus = pcmp->gus; | 365 | struct snd_gus_card *gus = pcmp->gus; |
364 | int err, w16, invert; | 366 | int err, w16, invert; |
365 | 367 | ||
366 | w16 = (snd_pcm_format_width(runtime->format) == 16); | 368 | w16 = (snd_pcm_format_width(runtime->format) == 16); |
@@ -371,13 +373,13 @@ static int snd_gf1_pcm_playback_copy(snd_pcm_substream_t *substream, | |||
371 | return 0; | 373 | return 0; |
372 | } | 374 | } |
373 | 375 | ||
374 | static int snd_gf1_pcm_playback_silence(snd_pcm_substream_t *substream, | 376 | static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, |
375 | int voice, | 377 | int voice, |
376 | snd_pcm_uframes_t pos, | 378 | snd_pcm_uframes_t pos, |
377 | snd_pcm_uframes_t count) | 379 | snd_pcm_uframes_t count) |
378 | { | 380 | { |
379 | snd_pcm_runtime_t *runtime = substream->runtime; | 381 | struct snd_pcm_runtime *runtime = substream->runtime; |
380 | gus_pcm_private_t *pcmp = runtime->private_data; | 382 | struct gus_pcm_private *pcmp = runtime->private_data; |
381 | unsigned int bpos, len; | 383 | unsigned int bpos, len; |
382 | 384 | ||
383 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); | 385 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); |
@@ -388,7 +390,7 @@ static int snd_gf1_pcm_playback_silence(snd_pcm_substream_t *substream, | |||
388 | if (snd_gf1_pcm_use_dma && len > 32) { | 390 | if (snd_gf1_pcm_use_dma && len > 32) { |
389 | return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); | 391 | return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); |
390 | } else { | 392 | } else { |
391 | snd_gus_card_t *gus = pcmp->gus; | 393 | struct snd_gus_card *gus = pcmp->gus; |
392 | int err, w16, invert; | 394 | int err, w16, invert; |
393 | 395 | ||
394 | w16 = (snd_pcm_format_width(runtime->format) == 16); | 396 | w16 = (snd_pcm_format_width(runtime->format) == 16); |
@@ -399,18 +401,18 @@ static int snd_gf1_pcm_playback_silence(snd_pcm_substream_t *substream, | |||
399 | return 0; | 401 | return 0; |
400 | } | 402 | } |
401 | 403 | ||
402 | static int snd_gf1_pcm_playback_hw_params(snd_pcm_substream_t * substream, | 404 | static int snd_gf1_pcm_playback_hw_params(struct snd_pcm_substream *substream, |
403 | snd_pcm_hw_params_t * hw_params) | 405 | struct snd_pcm_hw_params *hw_params) |
404 | { | 406 | { |
405 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 407 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
406 | snd_pcm_runtime_t *runtime = substream->runtime; | 408 | struct snd_pcm_runtime *runtime = substream->runtime; |
407 | gus_pcm_private_t *pcmp = runtime->private_data; | 409 | struct gus_pcm_private *pcmp = runtime->private_data; |
408 | int err; | 410 | int err; |
409 | 411 | ||
410 | if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) | 412 | if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) |
411 | return err; | 413 | return err; |
412 | if (err > 0) { /* change */ | 414 | if (err > 0) { /* change */ |
413 | snd_gf1_mem_block_t *block; | 415 | struct snd_gf1_mem_block *block; |
414 | if (pcmp->memory > 0) { | 416 | if (pcmp->memory > 0) { |
415 | snd_gf1_mem_free(&gus->gf1.mem_alloc, pcmp->memory); | 417 | snd_gf1_mem_free(&gus->gf1.mem_alloc, pcmp->memory); |
416 | pcmp->memory = 0; | 418 | pcmp->memory = 0; |
@@ -448,10 +450,10 @@ static int snd_gf1_pcm_playback_hw_params(snd_pcm_substream_t * substream, | |||
448 | return 0; | 450 | return 0; |
449 | } | 451 | } |
450 | 452 | ||
451 | static int snd_gf1_pcm_playback_hw_free(snd_pcm_substream_t * substream) | 453 | static int snd_gf1_pcm_playback_hw_free(struct snd_pcm_substream *substream) |
452 | { | 454 | { |
453 | snd_pcm_runtime_t *runtime = substream->runtime; | 455 | struct snd_pcm_runtime *runtime = substream->runtime; |
454 | gus_pcm_private_t *pcmp = runtime->private_data; | 456 | struct gus_pcm_private *pcmp = runtime->private_data; |
455 | 457 | ||
456 | snd_pcm_lib_free_pages(substream); | 458 | snd_pcm_lib_free_pages(substream); |
457 | if (pcmp->pvoices[0]) { | 459 | if (pcmp->pvoices[0]) { |
@@ -469,10 +471,10 @@ static int snd_gf1_pcm_playback_hw_free(snd_pcm_substream_t * substream) | |||
469 | return 0; | 471 | return 0; |
470 | } | 472 | } |
471 | 473 | ||
472 | static int snd_gf1_pcm_playback_prepare(snd_pcm_substream_t * substream) | 474 | static int snd_gf1_pcm_playback_prepare(struct snd_pcm_substream *substream) |
473 | { | 475 | { |
474 | snd_pcm_runtime_t *runtime = substream->runtime; | 476 | struct snd_pcm_runtime *runtime = substream->runtime; |
475 | gus_pcm_private_t *pcmp = runtime->private_data; | 477 | struct gus_pcm_private *pcmp = runtime->private_data; |
476 | 478 | ||
477 | pcmp->bpos = 0; | 479 | pcmp->bpos = 0; |
478 | pcmp->dma_size = snd_pcm_lib_buffer_bytes(substream); | 480 | pcmp->dma_size = snd_pcm_lib_buffer_bytes(substream); |
@@ -481,12 +483,12 @@ static int snd_gf1_pcm_playback_prepare(snd_pcm_substream_t * substream) | |||
481 | return 0; | 483 | return 0; |
482 | } | 484 | } |
483 | 485 | ||
484 | static int snd_gf1_pcm_playback_trigger(snd_pcm_substream_t * substream, | 486 | static int snd_gf1_pcm_playback_trigger(struct snd_pcm_substream *substream, |
485 | int cmd) | 487 | int cmd) |
486 | { | 488 | { |
487 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 489 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
488 | snd_pcm_runtime_t *runtime = substream->runtime; | 490 | struct snd_pcm_runtime *runtime = substream->runtime; |
489 | gus_pcm_private_t *pcmp = runtime->private_data; | 491 | struct gus_pcm_private *pcmp = runtime->private_data; |
490 | int voice; | 492 | int voice; |
491 | 493 | ||
492 | if (cmd == SNDRV_PCM_TRIGGER_START) { | 494 | if (cmd == SNDRV_PCM_TRIGGER_START) { |
@@ -507,11 +509,11 @@ static int snd_gf1_pcm_playback_trigger(snd_pcm_substream_t * substream, | |||
507 | return 0; | 509 | return 0; |
508 | } | 510 | } |
509 | 511 | ||
510 | static snd_pcm_uframes_t snd_gf1_pcm_playback_pointer(snd_pcm_substream_t * substream) | 512 | static snd_pcm_uframes_t snd_gf1_pcm_playback_pointer(struct snd_pcm_substream *substream) |
511 | { | 513 | { |
512 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 514 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
513 | snd_pcm_runtime_t *runtime = substream->runtime; | 515 | struct snd_pcm_runtime *runtime = substream->runtime; |
514 | gus_pcm_private_t *pcmp = runtime->private_data; | 516 | struct gus_pcm_private *pcmp = runtime->private_data; |
515 | unsigned int pos; | 517 | unsigned int pos; |
516 | unsigned char voice_ctrl; | 518 | unsigned char voice_ctrl; |
517 | 519 | ||
@@ -529,22 +531,22 @@ static snd_pcm_uframes_t snd_gf1_pcm_playback_pointer(snd_pcm_substream_t * subs | |||
529 | return pos; | 531 | return pos; |
530 | } | 532 | } |
531 | 533 | ||
532 | static ratnum_t clock = { | 534 | static struct snd_ratnum clock = { |
533 | .num = 9878400/16, | 535 | .num = 9878400/16, |
534 | .den_min = 2, | 536 | .den_min = 2, |
535 | .den_max = 257, | 537 | .den_max = 257, |
536 | .den_step = 1, | 538 | .den_step = 1, |
537 | }; | 539 | }; |
538 | 540 | ||
539 | static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = { | 541 | static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { |
540 | .nrats = 1, | 542 | .nrats = 1, |
541 | .rats = &clock, | 543 | .rats = &clock, |
542 | }; | 544 | }; |
543 | 545 | ||
544 | static int snd_gf1_pcm_capture_hw_params(snd_pcm_substream_t * substream, | 546 | static int snd_gf1_pcm_capture_hw_params(struct snd_pcm_substream *substream, |
545 | snd_pcm_hw_params_t * hw_params) | 547 | struct snd_pcm_hw_params *hw_params) |
546 | { | 548 | { |
547 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 549 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
548 | 550 | ||
549 | gus->c_dma_size = params_buffer_bytes(hw_params); | 551 | gus->c_dma_size = params_buffer_bytes(hw_params); |
550 | gus->c_period_size = params_period_bytes(hw_params); | 552 | gus->c_period_size = params_period_bytes(hw_params); |
@@ -559,15 +561,15 @@ static int snd_gf1_pcm_capture_hw_params(snd_pcm_substream_t * substream, | |||
559 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | 561 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
560 | } | 562 | } |
561 | 563 | ||
562 | static int snd_gf1_pcm_capture_hw_free(snd_pcm_substream_t * substream) | 564 | static int snd_gf1_pcm_capture_hw_free(struct snd_pcm_substream *substream) |
563 | { | 565 | { |
564 | return snd_pcm_lib_free_pages(substream); | 566 | return snd_pcm_lib_free_pages(substream); |
565 | } | 567 | } |
566 | 568 | ||
567 | static int snd_gf1_pcm_capture_prepare(snd_pcm_substream_t * substream) | 569 | static int snd_gf1_pcm_capture_prepare(struct snd_pcm_substream *substream) |
568 | { | 570 | { |
569 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 571 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
570 | snd_pcm_runtime_t *runtime = substream->runtime; | 572 | struct snd_pcm_runtime *runtime = substream->runtime; |
571 | 573 | ||
572 | snd_gf1_i_write8(gus, SNDRV_GF1_GB_RECORD_RATE, runtime->rate_den - 2); | 574 | snd_gf1_i_write8(gus, SNDRV_GF1_GB_RECORD_RATE, runtime->rate_den - 2); |
573 | snd_gf1_i_write8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL, 0); /* disable sampling */ | 575 | snd_gf1_i_write8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL, 0); /* disable sampling */ |
@@ -576,10 +578,10 @@ static int snd_gf1_pcm_capture_prepare(snd_pcm_substream_t * substream) | |||
576 | return 0; | 578 | return 0; |
577 | } | 579 | } |
578 | 580 | ||
579 | static int snd_gf1_pcm_capture_trigger(snd_pcm_substream_t * substream, | 581 | static int snd_gf1_pcm_capture_trigger(struct snd_pcm_substream *substream, |
580 | int cmd) | 582 | int cmd) |
581 | { | 583 | { |
582 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 584 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
583 | int val; | 585 | int val; |
584 | 586 | ||
585 | if (cmd == SNDRV_PCM_TRIGGER_START) { | 587 | if (cmd == SNDRV_PCM_TRIGGER_START) { |
@@ -597,15 +599,15 @@ static int snd_gf1_pcm_capture_trigger(snd_pcm_substream_t * substream, | |||
597 | return 0; | 599 | return 0; |
598 | } | 600 | } |
599 | 601 | ||
600 | static snd_pcm_uframes_t snd_gf1_pcm_capture_pointer(snd_pcm_substream_t * substream) | 602 | static snd_pcm_uframes_t snd_gf1_pcm_capture_pointer(struct snd_pcm_substream *substream) |
601 | { | 603 | { |
602 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 604 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
603 | int pos = snd_dma_pointer(gus->gf1.dma2, gus->c_period_size); | 605 | int pos = snd_dma_pointer(gus->gf1.dma2, gus->c_period_size); |
604 | pos = bytes_to_frames(substream->runtime, (gus->c_pos + pos) % gus->c_dma_size); | 606 | pos = bytes_to_frames(substream->runtime, (gus->c_pos + pos) % gus->c_dma_size); |
605 | return pos; | 607 | return pos; |
606 | } | 608 | } |
607 | 609 | ||
608 | static void snd_gf1_pcm_interrupt_dma_read(snd_gus_card_t * gus) | 610 | static void snd_gf1_pcm_interrupt_dma_read(struct snd_gus_card * gus) |
609 | { | 611 | { |
610 | snd_gf1_i_write8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL, 0); /* disable sampling */ | 612 | snd_gf1_i_write8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL, 0); /* disable sampling */ |
611 | snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL); /* Sampling Control Register */ | 613 | snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL); /* Sampling Control Register */ |
@@ -617,7 +619,7 @@ static void snd_gf1_pcm_interrupt_dma_read(snd_gus_card_t * gus) | |||
617 | } | 619 | } |
618 | } | 620 | } |
619 | 621 | ||
620 | static snd_pcm_hardware_t snd_gf1_pcm_playback = | 622 | static struct snd_pcm_hardware snd_gf1_pcm_playback = |
621 | { | 623 | { |
622 | .info = SNDRV_PCM_INFO_NONINTERLEAVED, | 624 | .info = SNDRV_PCM_INFO_NONINTERLEAVED, |
623 | .formats = (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | | 625 | .formats = (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | |
@@ -635,7 +637,7 @@ static snd_pcm_hardware_t snd_gf1_pcm_playback = | |||
635 | .fifo_size = 0, | 637 | .fifo_size = 0, |
636 | }; | 638 | }; |
637 | 639 | ||
638 | static snd_pcm_hardware_t snd_gf1_pcm_capture = | 640 | static struct snd_pcm_hardware snd_gf1_pcm_capture = |
639 | { | 641 | { |
640 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 642 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
641 | SNDRV_PCM_INFO_MMAP_VALID), | 643 | SNDRV_PCM_INFO_MMAP_VALID), |
@@ -653,16 +655,16 @@ static snd_pcm_hardware_t snd_gf1_pcm_capture = | |||
653 | .fifo_size = 0, | 655 | .fifo_size = 0, |
654 | }; | 656 | }; |
655 | 657 | ||
656 | static void snd_gf1_pcm_playback_free(snd_pcm_runtime_t *runtime) | 658 | static void snd_gf1_pcm_playback_free(struct snd_pcm_runtime *runtime) |
657 | { | 659 | { |
658 | kfree(runtime->private_data); | 660 | kfree(runtime->private_data); |
659 | } | 661 | } |
660 | 662 | ||
661 | static int snd_gf1_pcm_playback_open(snd_pcm_substream_t *substream) | 663 | static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream) |
662 | { | 664 | { |
663 | gus_pcm_private_t *pcmp; | 665 | struct gus_pcm_private *pcmp; |
664 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 666 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
665 | snd_pcm_runtime_t *runtime = substream->runtime; | 667 | struct snd_pcm_runtime *runtime = substream->runtime; |
666 | int err; | 668 | int err; |
667 | 669 | ||
668 | pcmp = kzalloc(sizeof(*pcmp), GFP_KERNEL); | 670 | pcmp = kzalloc(sizeof(*pcmp), GFP_KERNEL); |
@@ -690,11 +692,11 @@ static int snd_gf1_pcm_playback_open(snd_pcm_substream_t *substream) | |||
690 | return 0; | 692 | return 0; |
691 | } | 693 | } |
692 | 694 | ||
693 | static int snd_gf1_pcm_playback_close(snd_pcm_substream_t * substream) | 695 | static int snd_gf1_pcm_playback_close(struct snd_pcm_substream *substream) |
694 | { | 696 | { |
695 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 697 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
696 | snd_pcm_runtime_t *runtime = substream->runtime; | 698 | struct snd_pcm_runtime *runtime = substream->runtime; |
697 | gus_pcm_private_t *pcmp = runtime->private_data; | 699 | struct gus_pcm_private *pcmp = runtime->private_data; |
698 | 700 | ||
699 | if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ)) | 701 | if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ)) |
700 | snd_printk(KERN_ERR "gf1 pcm - serious DMA problem\n"); | 702 | snd_printk(KERN_ERR "gf1 pcm - serious DMA problem\n"); |
@@ -703,10 +705,10 @@ static int snd_gf1_pcm_playback_close(snd_pcm_substream_t * substream) | |||
703 | return 0; | 705 | return 0; |
704 | } | 706 | } |
705 | 707 | ||
706 | static int snd_gf1_pcm_capture_open(snd_pcm_substream_t * substream) | 708 | static int snd_gf1_pcm_capture_open(struct snd_pcm_substream *substream) |
707 | { | 709 | { |
708 | snd_pcm_runtime_t *runtime = substream->runtime; | 710 | struct snd_pcm_runtime *runtime = substream->runtime; |
709 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 711 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
710 | 712 | ||
711 | gus->gf1.interrupt_handler_dma_read = snd_gf1_pcm_interrupt_dma_read; | 713 | gus->gf1.interrupt_handler_dma_read = snd_gf1_pcm_interrupt_dma_read; |
712 | gus->pcm_cap_substream = substream; | 714 | gus->pcm_cap_substream = substream; |
@@ -718,16 +720,16 @@ static int snd_gf1_pcm_capture_open(snd_pcm_substream_t * substream) | |||
718 | return 0; | 720 | return 0; |
719 | } | 721 | } |
720 | 722 | ||
721 | static int snd_gf1_pcm_capture_close(snd_pcm_substream_t * substream) | 723 | static int snd_gf1_pcm_capture_close(struct snd_pcm_substream *substream) |
722 | { | 724 | { |
723 | snd_gus_card_t *gus = snd_pcm_substream_chip(substream); | 725 | struct snd_gus_card *gus = snd_pcm_substream_chip(substream); |
724 | 726 | ||
725 | gus->pcm_cap_substream = NULL; | 727 | gus->pcm_cap_substream = NULL; |
726 | snd_gf1_set_default_handlers(gus, SNDRV_GF1_HANDLER_DMA_READ); | 728 | snd_gf1_set_default_handlers(gus, SNDRV_GF1_HANDLER_DMA_READ); |
727 | return 0; | 729 | return 0; |
728 | } | 730 | } |
729 | 731 | ||
730 | static int snd_gf1_pcm_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 732 | static int snd_gf1_pcm_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
731 | { | 733 | { |
732 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 734 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
733 | uinfo->count = 2; | 735 | uinfo->count = 2; |
@@ -736,9 +738,9 @@ static int snd_gf1_pcm_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
736 | return 0; | 738 | return 0; |
737 | } | 739 | } |
738 | 740 | ||
739 | static int snd_gf1_pcm_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 741 | static int snd_gf1_pcm_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
740 | { | 742 | { |
741 | snd_gus_card_t *gus = snd_kcontrol_chip(kcontrol); | 743 | struct snd_gus_card *gus = snd_kcontrol_chip(kcontrol); |
742 | unsigned long flags; | 744 | unsigned long flags; |
743 | 745 | ||
744 | spin_lock_irqsave(&gus->pcm_volume_level_lock, flags); | 746 | spin_lock_irqsave(&gus->pcm_volume_level_lock, flags); |
@@ -748,15 +750,15 @@ static int snd_gf1_pcm_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
748 | return 0; | 750 | return 0; |
749 | } | 751 | } |
750 | 752 | ||
751 | static int snd_gf1_pcm_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 753 | static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
752 | { | 754 | { |
753 | snd_gus_card_t *gus = snd_kcontrol_chip(kcontrol); | 755 | struct snd_gus_card *gus = snd_kcontrol_chip(kcontrol); |
754 | unsigned long flags; | 756 | unsigned long flags; |
755 | int change; | 757 | int change; |
756 | unsigned int idx; | 758 | unsigned int idx; |
757 | unsigned short val1, val2, vol; | 759 | unsigned short val1, val2, vol; |
758 | gus_pcm_private_t *pcmp; | 760 | struct gus_pcm_private *pcmp; |
759 | snd_gus_voice_t *pvoice; | 761 | struct snd_gus_voice *pvoice; |
760 | 762 | ||
761 | val1 = ucontrol->value.integer.value[0] & 127; | 763 | val1 = ucontrol->value.integer.value[0] & 127; |
762 | val2 = ucontrol->value.integer.value[1] & 127; | 764 | val2 = ucontrol->value.integer.value[1] & 127; |
@@ -790,7 +792,7 @@ static int snd_gf1_pcm_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
790 | return change; | 792 | return change; |
791 | } | 793 | } |
792 | 794 | ||
793 | static snd_kcontrol_new_t snd_gf1_pcm_volume_control = | 795 | static struct snd_kcontrol_new snd_gf1_pcm_volume_control = |
794 | { | 796 | { |
795 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 797 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
796 | .name = "PCM Playback Volume", | 798 | .name = "PCM Playback Volume", |
@@ -799,7 +801,7 @@ static snd_kcontrol_new_t snd_gf1_pcm_volume_control = | |||
799 | .put = snd_gf1_pcm_volume_put | 801 | .put = snd_gf1_pcm_volume_put |
800 | }; | 802 | }; |
801 | 803 | ||
802 | static snd_kcontrol_new_t snd_gf1_pcm_volume_control1 = | 804 | static struct snd_kcontrol_new snd_gf1_pcm_volume_control1 = |
803 | { | 805 | { |
804 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 806 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
805 | .name = "GPCM Playback Volume", | 807 | .name = "GPCM Playback Volume", |
@@ -808,7 +810,7 @@ static snd_kcontrol_new_t snd_gf1_pcm_volume_control1 = | |||
808 | .put = snd_gf1_pcm_volume_put | 810 | .put = snd_gf1_pcm_volume_put |
809 | }; | 811 | }; |
810 | 812 | ||
811 | static snd_pcm_ops_t snd_gf1_pcm_playback_ops = { | 813 | static struct snd_pcm_ops snd_gf1_pcm_playback_ops = { |
812 | .open = snd_gf1_pcm_playback_open, | 814 | .open = snd_gf1_pcm_playback_open, |
813 | .close = snd_gf1_pcm_playback_close, | 815 | .close = snd_gf1_pcm_playback_close, |
814 | .ioctl = snd_pcm_lib_ioctl, | 816 | .ioctl = snd_pcm_lib_ioctl, |
@@ -821,7 +823,7 @@ static snd_pcm_ops_t snd_gf1_pcm_playback_ops = { | |||
821 | .silence = snd_gf1_pcm_playback_silence, | 823 | .silence = snd_gf1_pcm_playback_silence, |
822 | }; | 824 | }; |
823 | 825 | ||
824 | static snd_pcm_ops_t snd_gf1_pcm_capture_ops = { | 826 | static struct snd_pcm_ops snd_gf1_pcm_capture_ops = { |
825 | .open = snd_gf1_pcm_capture_open, | 827 | .open = snd_gf1_pcm_capture_open, |
826 | .close = snd_gf1_pcm_capture_close, | 828 | .close = snd_gf1_pcm_capture_close, |
827 | .ioctl = snd_pcm_lib_ioctl, | 829 | .ioctl = snd_pcm_lib_ioctl, |
@@ -832,12 +834,12 @@ static snd_pcm_ops_t snd_gf1_pcm_capture_ops = { | |||
832 | .pointer = snd_gf1_pcm_capture_pointer, | 834 | .pointer = snd_gf1_pcm_capture_pointer, |
833 | }; | 835 | }; |
834 | 836 | ||
835 | int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pcm_t ** rpcm) | 837 | int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm) |
836 | { | 838 | { |
837 | snd_card_t *card; | 839 | struct snd_card *card; |
838 | snd_kcontrol_t *kctl; | 840 | struct snd_kcontrol *kctl; |
839 | snd_pcm_t *pcm; | 841 | struct snd_pcm *pcm; |
840 | snd_pcm_substream_t *substream; | 842 | struct snd_pcm_substream *substream; |
841 | int capture, err; | 843 | int capture, err; |
842 | 844 | ||
843 | if (rpcm) | 845 | if (rpcm) |