diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:53:41 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:18:58 -0500 |
commit | 208a1b4cb5ad97510aa9cbe51d09e55656691cb4 (patch) | |
tree | 5f3c518582f92d19905451aec1bbb2ddd5cbd759 /sound/pci/ymfpci/ymfpci_main.c | |
parent | bee1a5be8b6210a0a4e27e38d0f76847b0a014ae (diff) |
[ALSA] Remove xxx_t typedefs: PCI YMFPCI
Modules: YMFPCI driver
Remove xxx_t typedefs from the PCI YMFPCI driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ymfpci/ymfpci_main.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 470 |
1 files changed, 237 insertions, 233 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 8229703c80cd..62c9f25e8e71 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -50,39 +50,39 @@ | |||
50 | * common I/O routines | 50 | * common I/O routines |
51 | */ | 51 | */ |
52 | 52 | ||
53 | static void snd_ymfpci_irq_wait(ymfpci_t *chip); | 53 | static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip); |
54 | 54 | ||
55 | static inline u8 snd_ymfpci_readb(ymfpci_t *chip, u32 offset) | 55 | static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset) |
56 | { | 56 | { |
57 | return readb(chip->reg_area_virt + offset); | 57 | return readb(chip->reg_area_virt + offset); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline void snd_ymfpci_writeb(ymfpci_t *chip, u32 offset, u8 val) | 60 | static inline void snd_ymfpci_writeb(struct snd_ymfpci *chip, u32 offset, u8 val) |
61 | { | 61 | { |
62 | writeb(val, chip->reg_area_virt + offset); | 62 | writeb(val, chip->reg_area_virt + offset); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline u16 snd_ymfpci_readw(ymfpci_t *chip, u32 offset) | 65 | static inline u16 snd_ymfpci_readw(struct snd_ymfpci *chip, u32 offset) |
66 | { | 66 | { |
67 | return readw(chip->reg_area_virt + offset); | 67 | return readw(chip->reg_area_virt + offset); |
68 | } | 68 | } |
69 | 69 | ||
70 | static inline void snd_ymfpci_writew(ymfpci_t *chip, u32 offset, u16 val) | 70 | static inline void snd_ymfpci_writew(struct snd_ymfpci *chip, u32 offset, u16 val) |
71 | { | 71 | { |
72 | writew(val, chip->reg_area_virt + offset); | 72 | writew(val, chip->reg_area_virt + offset); |
73 | } | 73 | } |
74 | 74 | ||
75 | static inline u32 snd_ymfpci_readl(ymfpci_t *chip, u32 offset) | 75 | static inline u32 snd_ymfpci_readl(struct snd_ymfpci *chip, u32 offset) |
76 | { | 76 | { |
77 | return readl(chip->reg_area_virt + offset); | 77 | return readl(chip->reg_area_virt + offset); |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void snd_ymfpci_writel(ymfpci_t *chip, u32 offset, u32 val) | 80 | static inline void snd_ymfpci_writel(struct snd_ymfpci *chip, u32 offset, u32 val) |
81 | { | 81 | { |
82 | writel(val, chip->reg_area_virt + offset); | 82 | writel(val, chip->reg_area_virt + offset); |
83 | } | 83 | } |
84 | 84 | ||
85 | static int snd_ymfpci_codec_ready(ymfpci_t *chip, int secondary) | 85 | static int snd_ymfpci_codec_ready(struct snd_ymfpci *chip, int secondary) |
86 | { | 86 | { |
87 | unsigned long end_time; | 87 | unsigned long end_time; |
88 | u32 reg = secondary ? YDSXGR_SECSTATUSADR : YDSXGR_PRISTATUSADR; | 88 | u32 reg = secondary ? YDSXGR_SECSTATUSADR : YDSXGR_PRISTATUSADR; |
@@ -98,9 +98,9 @@ static int snd_ymfpci_codec_ready(ymfpci_t *chip, int secondary) | |||
98 | return -EBUSY; | 98 | return -EBUSY; |
99 | } | 99 | } |
100 | 100 | ||
101 | static void snd_ymfpci_codec_write(ac97_t *ac97, u16 reg, u16 val) | 101 | static void snd_ymfpci_codec_write(struct snd_ac97 *ac97, u16 reg, u16 val) |
102 | { | 102 | { |
103 | ymfpci_t *chip = ac97->private_data; | 103 | struct snd_ymfpci *chip = ac97->private_data; |
104 | u32 cmd; | 104 | u32 cmd; |
105 | 105 | ||
106 | snd_ymfpci_codec_ready(chip, 0); | 106 | snd_ymfpci_codec_ready(chip, 0); |
@@ -108,9 +108,9 @@ static void snd_ymfpci_codec_write(ac97_t *ac97, u16 reg, u16 val) | |||
108 | snd_ymfpci_writel(chip, YDSXGR_AC97CMDDATA, cmd); | 108 | snd_ymfpci_writel(chip, YDSXGR_AC97CMDDATA, cmd); |
109 | } | 109 | } |
110 | 110 | ||
111 | static u16 snd_ymfpci_codec_read(ac97_t *ac97, u16 reg) | 111 | static u16 snd_ymfpci_codec_read(struct snd_ac97 *ac97, u16 reg) |
112 | { | 112 | { |
113 | ymfpci_t *chip = ac97->private_data; | 113 | struct snd_ymfpci *chip = ac97->private_data; |
114 | 114 | ||
115 | if (snd_ymfpci_codec_ready(chip, 0)) | 115 | if (snd_ymfpci_codec_ready(chip, 0)) |
116 | return ~0; | 116 | return ~0; |
@@ -182,7 +182,7 @@ static u32 snd_ymfpci_calc_lpfQ(u32 rate) | |||
182 | * Hardware start management | 182 | * Hardware start management |
183 | */ | 183 | */ |
184 | 184 | ||
185 | static void snd_ymfpci_hw_start(ymfpci_t *chip) | 185 | static void snd_ymfpci_hw_start(struct snd_ymfpci *chip) |
186 | { | 186 | { |
187 | unsigned long flags; | 187 | unsigned long flags; |
188 | 188 | ||
@@ -196,7 +196,7 @@ static void snd_ymfpci_hw_start(ymfpci_t *chip) | |||
196 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 196 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
197 | } | 197 | } |
198 | 198 | ||
199 | static void snd_ymfpci_hw_stop(ymfpci_t *chip) | 199 | static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip) |
200 | { | 200 | { |
201 | unsigned long flags; | 201 | unsigned long flags; |
202 | long timeout = 1000; | 202 | long timeout = 1000; |
@@ -222,9 +222,11 @@ static void snd_ymfpci_hw_stop(ymfpci_t *chip) | |||
222 | * Playback voice management | 222 | * Playback voice management |
223 | */ | 223 | */ |
224 | 224 | ||
225 | static int voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice) | 225 | static int voice_alloc(struct snd_ymfpci *chip, |
226 | enum snd_ymfpci_voice_type type, int pair, | ||
227 | struct snd_ymfpci_voice **rvoice) | ||
226 | { | 228 | { |
227 | ymfpci_voice_t *voice, *voice2; | 229 | struct snd_ymfpci_voice *voice, *voice2; |
228 | int idx; | 230 | int idx; |
229 | 231 | ||
230 | *rvoice = NULL; | 232 | *rvoice = NULL; |
@@ -258,7 +260,9 @@ static int voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpc | |||
258 | return -ENOMEM; | 260 | return -ENOMEM; |
259 | } | 261 | } |
260 | 262 | ||
261 | static int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice) | 263 | static int snd_ymfpci_voice_alloc(struct snd_ymfpci *chip, |
264 | enum snd_ymfpci_voice_type type, int pair, | ||
265 | struct snd_ymfpci_voice **rvoice) | ||
262 | { | 266 | { |
263 | unsigned long flags; | 267 | unsigned long flags; |
264 | int result; | 268 | int result; |
@@ -278,7 +282,7 @@ static int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int | |||
278 | return result; | 282 | return result; |
279 | } | 283 | } |
280 | 284 | ||
281 | static int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice) | 285 | static int snd_ymfpci_voice_free(struct snd_ymfpci *chip, struct snd_ymfpci_voice *pvoice) |
282 | { | 286 | { |
283 | unsigned long flags; | 287 | unsigned long flags; |
284 | 288 | ||
@@ -296,9 +300,9 @@ static int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice) | |||
296 | * PCM part | 300 | * PCM part |
297 | */ | 301 | */ |
298 | 302 | ||
299 | static void snd_ymfpci_pcm_interrupt(ymfpci_t *chip, ymfpci_voice_t *voice) | 303 | static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_voice *voice) |
300 | { | 304 | { |
301 | ymfpci_pcm_t *ypcm; | 305 | struct snd_ymfpci_pcm *ypcm; |
302 | u32 pos, delta; | 306 | u32 pos, delta; |
303 | 307 | ||
304 | if ((ypcm = voice->ypcm) == NULL) | 308 | if ((ypcm = voice->ypcm) == NULL) |
@@ -325,7 +329,7 @@ static void snd_ymfpci_pcm_interrupt(ymfpci_t *chip, ymfpci_voice_t *voice) | |||
325 | if (unlikely(ypcm->update_pcm_vol)) { | 329 | if (unlikely(ypcm->update_pcm_vol)) { |
326 | unsigned int subs = ypcm->substream->number; | 330 | unsigned int subs = ypcm->substream->number; |
327 | unsigned int next_bank = 1 - chip->active_bank; | 331 | unsigned int next_bank = 1 - chip->active_bank; |
328 | snd_ymfpci_playback_bank_t *bank; | 332 | struct snd_ymfpci_playback_bank *bank; |
329 | u32 volume; | 333 | u32 volume; |
330 | 334 | ||
331 | bank = &voice->bank[next_bank]; | 335 | bank = &voice->bank[next_bank]; |
@@ -345,11 +349,11 @@ static void snd_ymfpci_pcm_interrupt(ymfpci_t *chip, ymfpci_voice_t *voice) | |||
345 | spin_unlock(&chip->reg_lock); | 349 | spin_unlock(&chip->reg_lock); |
346 | } | 350 | } |
347 | 351 | ||
348 | static void snd_ymfpci_pcm_capture_interrupt(snd_pcm_substream_t *substream) | 352 | static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream) |
349 | { | 353 | { |
350 | snd_pcm_runtime_t *runtime = substream->runtime; | 354 | struct snd_pcm_runtime *runtime = substream->runtime; |
351 | ymfpci_pcm_t *ypcm = runtime->private_data; | 355 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
352 | ymfpci_t *chip = ypcm->chip; | 356 | struct snd_ymfpci *chip = ypcm->chip; |
353 | u32 pos, delta; | 357 | u32 pos, delta; |
354 | 358 | ||
355 | spin_lock(&chip->reg_lock); | 359 | spin_lock(&chip->reg_lock); |
@@ -372,11 +376,11 @@ static void snd_ymfpci_pcm_capture_interrupt(snd_pcm_substream_t *substream) | |||
372 | spin_unlock(&chip->reg_lock); | 376 | spin_unlock(&chip->reg_lock); |
373 | } | 377 | } |
374 | 378 | ||
375 | static int snd_ymfpci_playback_trigger(snd_pcm_substream_t * substream, | 379 | static int snd_ymfpci_playback_trigger(struct snd_pcm_substream *substream, |
376 | int cmd) | 380 | int cmd) |
377 | { | 381 | { |
378 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 382 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
379 | ymfpci_pcm_t *ypcm = substream->runtime->private_data; | 383 | struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; |
380 | int result = 0; | 384 | int result = 0; |
381 | 385 | ||
382 | spin_lock(&chip->reg_lock); | 386 | spin_lock(&chip->reg_lock); |
@@ -409,11 +413,11 @@ static int snd_ymfpci_playback_trigger(snd_pcm_substream_t * substream, | |||
409 | spin_unlock(&chip->reg_lock); | 413 | spin_unlock(&chip->reg_lock); |
410 | return result; | 414 | return result; |
411 | } | 415 | } |
412 | static int snd_ymfpci_capture_trigger(snd_pcm_substream_t * substream, | 416 | static int snd_ymfpci_capture_trigger(struct snd_pcm_substream *substream, |
413 | int cmd) | 417 | int cmd) |
414 | { | 418 | { |
415 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 419 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
416 | ymfpci_pcm_t *ypcm = substream->runtime->private_data; | 420 | struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; |
417 | int result = 0; | 421 | int result = 0; |
418 | u32 tmp; | 422 | u32 tmp; |
419 | 423 | ||
@@ -441,7 +445,7 @@ static int snd_ymfpci_capture_trigger(snd_pcm_substream_t * substream, | |||
441 | return result; | 445 | return result; |
442 | } | 446 | } |
443 | 447 | ||
444 | static int snd_ymfpci_pcm_voice_alloc(ymfpci_pcm_t *ypcm, int voices) | 448 | static int snd_ymfpci_pcm_voice_alloc(struct snd_ymfpci_pcm *ypcm, int voices) |
445 | { | 449 | { |
446 | int err; | 450 | int err; |
447 | 451 | ||
@@ -471,16 +475,16 @@ static int snd_ymfpci_pcm_voice_alloc(ymfpci_pcm_t *ypcm, int voices) | |||
471 | return 0; | 475 | return 0; |
472 | } | 476 | } |
473 | 477 | ||
474 | static void snd_ymfpci_pcm_init_voice(ymfpci_pcm_t *ypcm, unsigned int voiceidx, | 478 | static void snd_ymfpci_pcm_init_voice(struct snd_ymfpci_pcm *ypcm, unsigned int voiceidx, |
475 | snd_pcm_runtime_t *runtime, | 479 | struct snd_pcm_runtime *runtime, |
476 | int has_pcm_volume) | 480 | int has_pcm_volume) |
477 | { | 481 | { |
478 | ymfpci_voice_t *voice = ypcm->voices[voiceidx]; | 482 | struct snd_ymfpci_voice *voice = ypcm->voices[voiceidx]; |
479 | u32 format; | 483 | u32 format; |
480 | u32 delta = snd_ymfpci_calc_delta(runtime->rate); | 484 | u32 delta = snd_ymfpci_calc_delta(runtime->rate); |
481 | u32 lpfQ = snd_ymfpci_calc_lpfQ(runtime->rate); | 485 | u32 lpfQ = snd_ymfpci_calc_lpfQ(runtime->rate); |
482 | u32 lpfK = snd_ymfpci_calc_lpfK(runtime->rate); | 486 | u32 lpfK = snd_ymfpci_calc_lpfK(runtime->rate); |
483 | snd_ymfpci_playback_bank_t *bank; | 487 | struct snd_ymfpci_playback_bank *bank; |
484 | unsigned int nbank; | 488 | unsigned int nbank; |
485 | u32 vol_left, vol_right; | 489 | u32 vol_left, vol_right; |
486 | u8 use_left, use_right; | 490 | u8 use_left, use_right; |
@@ -544,7 +548,7 @@ static void snd_ymfpci_pcm_init_voice(ymfpci_pcm_t *ypcm, unsigned int voiceidx, | |||
544 | } | 548 | } |
545 | } | 549 | } |
546 | 550 | ||
547 | static int __devinit snd_ymfpci_ac3_init(ymfpci_t *chip) | 551 | static int __devinit snd_ymfpci_ac3_init(struct snd_ymfpci *chip) |
548 | { | 552 | { |
549 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), | 553 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), |
550 | 4096, &chip->ac3_tmp_base) < 0) | 554 | 4096, &chip->ac3_tmp_base) < 0) |
@@ -566,7 +570,7 @@ static int __devinit snd_ymfpci_ac3_init(ymfpci_t *chip) | |||
566 | return 0; | 570 | return 0; |
567 | } | 571 | } |
568 | 572 | ||
569 | static int snd_ymfpci_ac3_done(ymfpci_t *chip) | 573 | static int snd_ymfpci_ac3_done(struct snd_ymfpci *chip) |
570 | { | 574 | { |
571 | spin_lock_irq(&chip->reg_lock); | 575 | spin_lock_irq(&chip->reg_lock); |
572 | snd_ymfpci_writel(chip, YDSXGR_MAPOFEFFECT, | 576 | snd_ymfpci_writel(chip, YDSXGR_MAPOFEFFECT, |
@@ -580,11 +584,11 @@ static int snd_ymfpci_ac3_done(ymfpci_t *chip) | |||
580 | return 0; | 584 | return 0; |
581 | } | 585 | } |
582 | 586 | ||
583 | static int snd_ymfpci_playback_hw_params(snd_pcm_substream_t * substream, | 587 | static int snd_ymfpci_playback_hw_params(struct snd_pcm_substream *substream, |
584 | snd_pcm_hw_params_t * hw_params) | 588 | struct snd_pcm_hw_params *hw_params) |
585 | { | 589 | { |
586 | snd_pcm_runtime_t *runtime = substream->runtime; | 590 | struct snd_pcm_runtime *runtime = substream->runtime; |
587 | ymfpci_pcm_t *ypcm = runtime->private_data; | 591 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
588 | int err; | 592 | int err; |
589 | 593 | ||
590 | if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) | 594 | if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) |
@@ -594,11 +598,11 @@ static int snd_ymfpci_playback_hw_params(snd_pcm_substream_t * substream, | |||
594 | return 0; | 598 | return 0; |
595 | } | 599 | } |
596 | 600 | ||
597 | static int snd_ymfpci_playback_hw_free(snd_pcm_substream_t * substream) | 601 | static int snd_ymfpci_playback_hw_free(struct snd_pcm_substream *substream) |
598 | { | 602 | { |
599 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 603 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
600 | snd_pcm_runtime_t *runtime = substream->runtime; | 604 | struct snd_pcm_runtime *runtime = substream->runtime; |
601 | ymfpci_pcm_t *ypcm; | 605 | struct snd_ymfpci_pcm *ypcm; |
602 | 606 | ||
603 | if (runtime->private_data == NULL) | 607 | if (runtime->private_data == NULL) |
604 | return 0; | 608 | return 0; |
@@ -618,11 +622,11 @@ static int snd_ymfpci_playback_hw_free(snd_pcm_substream_t * substream) | |||
618 | return 0; | 622 | return 0; |
619 | } | 623 | } |
620 | 624 | ||
621 | static int snd_ymfpci_playback_prepare(snd_pcm_substream_t * substream) | 625 | static int snd_ymfpci_playback_prepare(struct snd_pcm_substream *substream) |
622 | { | 626 | { |
623 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 627 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
624 | snd_pcm_runtime_t *runtime = substream->runtime; | 628 | struct snd_pcm_runtime *runtime = substream->runtime; |
625 | ymfpci_pcm_t *ypcm = runtime->private_data; | 629 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
626 | unsigned int nvoice; | 630 | unsigned int nvoice; |
627 | 631 | ||
628 | ypcm->period_size = runtime->period_size; | 632 | ypcm->period_size = runtime->period_size; |
@@ -635,27 +639,27 @@ static int snd_ymfpci_playback_prepare(snd_pcm_substream_t * substream) | |||
635 | return 0; | 639 | return 0; |
636 | } | 640 | } |
637 | 641 | ||
638 | static int snd_ymfpci_capture_hw_params(snd_pcm_substream_t * substream, | 642 | static int snd_ymfpci_capture_hw_params(struct snd_pcm_substream *substream, |
639 | snd_pcm_hw_params_t * hw_params) | 643 | struct snd_pcm_hw_params *hw_params) |
640 | { | 644 | { |
641 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | 645 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
642 | } | 646 | } |
643 | 647 | ||
644 | static int snd_ymfpci_capture_hw_free(snd_pcm_substream_t * substream) | 648 | static int snd_ymfpci_capture_hw_free(struct snd_pcm_substream *substream) |
645 | { | 649 | { |
646 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 650 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
647 | 651 | ||
648 | /* wait, until the PCI operations are not finished */ | 652 | /* wait, until the PCI operations are not finished */ |
649 | snd_ymfpci_irq_wait(chip); | 653 | snd_ymfpci_irq_wait(chip); |
650 | return snd_pcm_lib_free_pages(substream); | 654 | return snd_pcm_lib_free_pages(substream); |
651 | } | 655 | } |
652 | 656 | ||
653 | static int snd_ymfpci_capture_prepare(snd_pcm_substream_t * substream) | 657 | static int snd_ymfpci_capture_prepare(struct snd_pcm_substream *substream) |
654 | { | 658 | { |
655 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 659 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
656 | snd_pcm_runtime_t *runtime = substream->runtime; | 660 | struct snd_pcm_runtime *runtime = substream->runtime; |
657 | ymfpci_pcm_t *ypcm = runtime->private_data; | 661 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
658 | snd_ymfpci_capture_bank_t * bank; | 662 | struct snd_ymfpci_capture_bank * bank; |
659 | int nbank; | 663 | int nbank; |
660 | u32 rate, format; | 664 | u32 rate, format; |
661 | 665 | ||
@@ -694,30 +698,30 @@ static int snd_ymfpci_capture_prepare(snd_pcm_substream_t * substream) | |||
694 | return 0; | 698 | return 0; |
695 | } | 699 | } |
696 | 700 | ||
697 | static snd_pcm_uframes_t snd_ymfpci_playback_pointer(snd_pcm_substream_t * substream) | 701 | static snd_pcm_uframes_t snd_ymfpci_playback_pointer(struct snd_pcm_substream *substream) |
698 | { | 702 | { |
699 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 703 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
700 | snd_pcm_runtime_t *runtime = substream->runtime; | 704 | struct snd_pcm_runtime *runtime = substream->runtime; |
701 | ymfpci_pcm_t *ypcm = runtime->private_data; | 705 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
702 | ymfpci_voice_t *voice = ypcm->voices[0]; | 706 | struct snd_ymfpci_voice *voice = ypcm->voices[0]; |
703 | 707 | ||
704 | if (!(ypcm->running && voice)) | 708 | if (!(ypcm->running && voice)) |
705 | return 0; | 709 | return 0; |
706 | return le32_to_cpu(voice->bank[chip->active_bank].start); | 710 | return le32_to_cpu(voice->bank[chip->active_bank].start); |
707 | } | 711 | } |
708 | 712 | ||
709 | static snd_pcm_uframes_t snd_ymfpci_capture_pointer(snd_pcm_substream_t * substream) | 713 | static snd_pcm_uframes_t snd_ymfpci_capture_pointer(struct snd_pcm_substream *substream) |
710 | { | 714 | { |
711 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 715 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
712 | snd_pcm_runtime_t *runtime = substream->runtime; | 716 | struct snd_pcm_runtime *runtime = substream->runtime; |
713 | ymfpci_pcm_t *ypcm = runtime->private_data; | 717 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
714 | 718 | ||
715 | if (!ypcm->running) | 719 | if (!ypcm->running) |
716 | return 0; | 720 | return 0; |
717 | return le32_to_cpu(chip->bank_capture[ypcm->capture_bank_number][chip->active_bank]->start) >> ypcm->shift; | 721 | return le32_to_cpu(chip->bank_capture[ypcm->capture_bank_number][chip->active_bank]->start) >> ypcm->shift; |
718 | } | 722 | } |
719 | 723 | ||
720 | static void snd_ymfpci_irq_wait(ymfpci_t *chip) | 724 | static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip) |
721 | { | 725 | { |
722 | wait_queue_t wait; | 726 | wait_queue_t wait; |
723 | int loops = 4; | 727 | int loops = 4; |
@@ -735,9 +739,9 @@ static void snd_ymfpci_irq_wait(ymfpci_t *chip) | |||
735 | 739 | ||
736 | static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 740 | static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
737 | { | 741 | { |
738 | ymfpci_t *chip = dev_id; | 742 | struct snd_ymfpci *chip = dev_id; |
739 | u32 status, nvoice, mode; | 743 | u32 status, nvoice, mode; |
740 | ymfpci_voice_t *voice; | 744 | struct snd_ymfpci_voice *voice; |
741 | 745 | ||
742 | status = snd_ymfpci_readl(chip, YDSXGR_STATUS); | 746 | status = snd_ymfpci_readl(chip, YDSXGR_STATUS); |
743 | if (status & 0x80000000) { | 747 | if (status & 0x80000000) { |
@@ -783,7 +787,7 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *r | |||
783 | return IRQ_HANDLED; | 787 | return IRQ_HANDLED; |
784 | } | 788 | } |
785 | 789 | ||
786 | static snd_pcm_hardware_t snd_ymfpci_playback = | 790 | static struct snd_pcm_hardware snd_ymfpci_playback = |
787 | { | 791 | { |
788 | .info = (SNDRV_PCM_INFO_MMAP | | 792 | .info = (SNDRV_PCM_INFO_MMAP | |
789 | SNDRV_PCM_INFO_MMAP_VALID | | 793 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -805,7 +809,7 @@ static snd_pcm_hardware_t snd_ymfpci_playback = | |||
805 | .fifo_size = 0, | 809 | .fifo_size = 0, |
806 | }; | 810 | }; |
807 | 811 | ||
808 | static snd_pcm_hardware_t snd_ymfpci_capture = | 812 | static struct snd_pcm_hardware snd_ymfpci_capture = |
809 | { | 813 | { |
810 | .info = (SNDRV_PCM_INFO_MMAP | | 814 | .info = (SNDRV_PCM_INFO_MMAP | |
811 | SNDRV_PCM_INFO_MMAP_VALID | | 815 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -827,16 +831,16 @@ static snd_pcm_hardware_t snd_ymfpci_capture = | |||
827 | .fifo_size = 0, | 831 | .fifo_size = 0, |
828 | }; | 832 | }; |
829 | 833 | ||
830 | static void snd_ymfpci_pcm_free_substream(snd_pcm_runtime_t *runtime) | 834 | static void snd_ymfpci_pcm_free_substream(struct snd_pcm_runtime *runtime) |
831 | { | 835 | { |
832 | kfree(runtime->private_data); | 836 | kfree(runtime->private_data); |
833 | } | 837 | } |
834 | 838 | ||
835 | static int snd_ymfpci_playback_open_1(snd_pcm_substream_t * substream) | 839 | static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream) |
836 | { | 840 | { |
837 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 841 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
838 | snd_pcm_runtime_t *runtime = substream->runtime; | 842 | struct snd_pcm_runtime *runtime = substream->runtime; |
839 | ymfpci_pcm_t *ypcm; | 843 | struct snd_ymfpci_pcm *ypcm; |
840 | 844 | ||
841 | ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL); | 845 | ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL); |
842 | if (ypcm == NULL) | 846 | if (ypcm == NULL) |
@@ -853,7 +857,7 @@ static int snd_ymfpci_playback_open_1(snd_pcm_substream_t * substream) | |||
853 | } | 857 | } |
854 | 858 | ||
855 | /* call with spinlock held */ | 859 | /* call with spinlock held */ |
856 | static void ymfpci_open_extension(ymfpci_t *chip) | 860 | static void ymfpci_open_extension(struct snd_ymfpci *chip) |
857 | { | 861 | { |
858 | if (! chip->rear_opened) { | 862 | if (! chip->rear_opened) { |
859 | if (! chip->spdif_opened) /* set AC3 */ | 863 | if (! chip->spdif_opened) /* set AC3 */ |
@@ -866,7 +870,7 @@ static void ymfpci_open_extension(ymfpci_t *chip) | |||
866 | } | 870 | } |
867 | 871 | ||
868 | /* call with spinlock held */ | 872 | /* call with spinlock held */ |
869 | static void ymfpci_close_extension(ymfpci_t *chip) | 873 | static void ymfpci_close_extension(struct snd_ymfpci *chip) |
870 | { | 874 | { |
871 | if (! chip->rear_opened) { | 875 | if (! chip->rear_opened) { |
872 | if (! chip->spdif_opened) | 876 | if (! chip->spdif_opened) |
@@ -877,12 +881,12 @@ static void ymfpci_close_extension(ymfpci_t *chip) | |||
877 | } | 881 | } |
878 | } | 882 | } |
879 | 883 | ||
880 | static int snd_ymfpci_playback_open(snd_pcm_substream_t * substream) | 884 | static int snd_ymfpci_playback_open(struct snd_pcm_substream *substream) |
881 | { | 885 | { |
882 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 886 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
883 | snd_pcm_runtime_t *runtime = substream->runtime; | 887 | struct snd_pcm_runtime *runtime = substream->runtime; |
884 | ymfpci_pcm_t *ypcm; | 888 | struct snd_ymfpci_pcm *ypcm; |
885 | snd_kcontrol_t *kctl; | 889 | struct snd_kcontrol *kctl; |
886 | int err; | 890 | int err; |
887 | 891 | ||
888 | if ((err = snd_ymfpci_playback_open_1(substream)) < 0) | 892 | if ((err = snd_ymfpci_playback_open_1(substream)) < 0) |
@@ -903,11 +907,11 @@ static int snd_ymfpci_playback_open(snd_pcm_substream_t * substream) | |||
903 | return 0; | 907 | return 0; |
904 | } | 908 | } |
905 | 909 | ||
906 | static int snd_ymfpci_playback_spdif_open(snd_pcm_substream_t * substream) | 910 | static int snd_ymfpci_playback_spdif_open(struct snd_pcm_substream *substream) |
907 | { | 911 | { |
908 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 912 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
909 | snd_pcm_runtime_t *runtime = substream->runtime; | 913 | struct snd_pcm_runtime *runtime = substream->runtime; |
910 | ymfpci_pcm_t *ypcm; | 914 | struct snd_ymfpci_pcm *ypcm; |
911 | int err; | 915 | int err; |
912 | 916 | ||
913 | if ((err = snd_ymfpci_playback_open_1(substream)) < 0) | 917 | if ((err = snd_ymfpci_playback_open_1(substream)) < 0) |
@@ -930,11 +934,11 @@ static int snd_ymfpci_playback_spdif_open(snd_pcm_substream_t * substream) | |||
930 | return 0; | 934 | return 0; |
931 | } | 935 | } |
932 | 936 | ||
933 | static int snd_ymfpci_playback_4ch_open(snd_pcm_substream_t * substream) | 937 | static int snd_ymfpci_playback_4ch_open(struct snd_pcm_substream *substream) |
934 | { | 938 | { |
935 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 939 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
936 | snd_pcm_runtime_t *runtime = substream->runtime; | 940 | struct snd_pcm_runtime *runtime = substream->runtime; |
937 | ymfpci_pcm_t *ypcm; | 941 | struct snd_ymfpci_pcm *ypcm; |
938 | int err; | 942 | int err; |
939 | 943 | ||
940 | if ((err = snd_ymfpci_playback_open_1(substream)) < 0) | 944 | if ((err = snd_ymfpci_playback_open_1(substream)) < 0) |
@@ -949,12 +953,12 @@ static int snd_ymfpci_playback_4ch_open(snd_pcm_substream_t * substream) | |||
949 | return 0; | 953 | return 0; |
950 | } | 954 | } |
951 | 955 | ||
952 | static int snd_ymfpci_capture_open(snd_pcm_substream_t * substream, | 956 | static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream, |
953 | u32 capture_bank_number) | 957 | u32 capture_bank_number) |
954 | { | 958 | { |
955 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 959 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
956 | snd_pcm_runtime_t *runtime = substream->runtime; | 960 | struct snd_pcm_runtime *runtime = substream->runtime; |
957 | ymfpci_pcm_t *ypcm; | 961 | struct snd_ymfpci_pcm *ypcm; |
958 | 962 | ||
959 | ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL); | 963 | ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL); |
960 | if (ypcm == NULL) | 964 | if (ypcm == NULL) |
@@ -973,26 +977,26 @@ static int snd_ymfpci_capture_open(snd_pcm_substream_t * substream, | |||
973 | return 0; | 977 | return 0; |
974 | } | 978 | } |
975 | 979 | ||
976 | static int snd_ymfpci_capture_rec_open(snd_pcm_substream_t * substream) | 980 | static int snd_ymfpci_capture_rec_open(struct snd_pcm_substream *substream) |
977 | { | 981 | { |
978 | return snd_ymfpci_capture_open(substream, 0); | 982 | return snd_ymfpci_capture_open(substream, 0); |
979 | } | 983 | } |
980 | 984 | ||
981 | static int snd_ymfpci_capture_ac97_open(snd_pcm_substream_t * substream) | 985 | static int snd_ymfpci_capture_ac97_open(struct snd_pcm_substream *substream) |
982 | { | 986 | { |
983 | return snd_ymfpci_capture_open(substream, 1); | 987 | return snd_ymfpci_capture_open(substream, 1); |
984 | } | 988 | } |
985 | 989 | ||
986 | static int snd_ymfpci_playback_close_1(snd_pcm_substream_t * substream) | 990 | static int snd_ymfpci_playback_close_1(struct snd_pcm_substream *substream) |
987 | { | 991 | { |
988 | return 0; | 992 | return 0; |
989 | } | 993 | } |
990 | 994 | ||
991 | static int snd_ymfpci_playback_close(snd_pcm_substream_t * substream) | 995 | static int snd_ymfpci_playback_close(struct snd_pcm_substream *substream) |
992 | { | 996 | { |
993 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 997 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
994 | ymfpci_pcm_t *ypcm = substream->runtime->private_data; | 998 | struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; |
995 | snd_kcontrol_t *kctl; | 999 | struct snd_kcontrol *kctl; |
996 | 1000 | ||
997 | spin_lock_irq(&chip->reg_lock); | 1001 | spin_lock_irq(&chip->reg_lock); |
998 | if (ypcm->output_rear && chip->rear_opened > 0) { | 1002 | if (ypcm->output_rear && chip->rear_opened > 0) { |
@@ -1006,9 +1010,9 @@ static int snd_ymfpci_playback_close(snd_pcm_substream_t * substream) | |||
1006 | return snd_ymfpci_playback_close_1(substream); | 1010 | return snd_ymfpci_playback_close_1(substream); |
1007 | } | 1011 | } |
1008 | 1012 | ||
1009 | static int snd_ymfpci_playback_spdif_close(snd_pcm_substream_t * substream) | 1013 | static int snd_ymfpci_playback_spdif_close(struct snd_pcm_substream *substream) |
1010 | { | 1014 | { |
1011 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 1015 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
1012 | 1016 | ||
1013 | spin_lock_irq(&chip->reg_lock); | 1017 | spin_lock_irq(&chip->reg_lock); |
1014 | chip->spdif_opened = 0; | 1018 | chip->spdif_opened = 0; |
@@ -1023,9 +1027,9 @@ static int snd_ymfpci_playback_spdif_close(snd_pcm_substream_t * substream) | |||
1023 | return snd_ymfpci_playback_close_1(substream); | 1027 | return snd_ymfpci_playback_close_1(substream); |
1024 | } | 1028 | } |
1025 | 1029 | ||
1026 | static int snd_ymfpci_playback_4ch_close(snd_pcm_substream_t * substream) | 1030 | static int snd_ymfpci_playback_4ch_close(struct snd_pcm_substream *substream) |
1027 | { | 1031 | { |
1028 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 1032 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
1029 | 1033 | ||
1030 | spin_lock_irq(&chip->reg_lock); | 1034 | spin_lock_irq(&chip->reg_lock); |
1031 | if (chip->rear_opened > 0) { | 1035 | if (chip->rear_opened > 0) { |
@@ -1036,11 +1040,11 @@ static int snd_ymfpci_playback_4ch_close(snd_pcm_substream_t * substream) | |||
1036 | return snd_ymfpci_playback_close_1(substream); | 1040 | return snd_ymfpci_playback_close_1(substream); |
1037 | } | 1041 | } |
1038 | 1042 | ||
1039 | static int snd_ymfpci_capture_close(snd_pcm_substream_t * substream) | 1043 | static int snd_ymfpci_capture_close(struct snd_pcm_substream *substream) |
1040 | { | 1044 | { |
1041 | ymfpci_t *chip = snd_pcm_substream_chip(substream); | 1045 | struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); |
1042 | snd_pcm_runtime_t *runtime = substream->runtime; | 1046 | struct snd_pcm_runtime *runtime = substream->runtime; |
1043 | ymfpci_pcm_t *ypcm = runtime->private_data; | 1047 | struct snd_ymfpci_pcm *ypcm = runtime->private_data; |
1044 | 1048 | ||
1045 | if (ypcm != NULL) { | 1049 | if (ypcm != NULL) { |
1046 | chip->capture_substream[ypcm->capture_bank_number] = NULL; | 1050 | chip->capture_substream[ypcm->capture_bank_number] = NULL; |
@@ -1049,7 +1053,7 @@ static int snd_ymfpci_capture_close(snd_pcm_substream_t * substream) | |||
1049 | return 0; | 1053 | return 0; |
1050 | } | 1054 | } |
1051 | 1055 | ||
1052 | static snd_pcm_ops_t snd_ymfpci_playback_ops = { | 1056 | static struct snd_pcm_ops snd_ymfpci_playback_ops = { |
1053 | .open = snd_ymfpci_playback_open, | 1057 | .open = snd_ymfpci_playback_open, |
1054 | .close = snd_ymfpci_playback_close, | 1058 | .close = snd_ymfpci_playback_close, |
1055 | .ioctl = snd_pcm_lib_ioctl, | 1059 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1060,7 +1064,7 @@ static snd_pcm_ops_t snd_ymfpci_playback_ops = { | |||
1060 | .pointer = snd_ymfpci_playback_pointer, | 1064 | .pointer = snd_ymfpci_playback_pointer, |
1061 | }; | 1065 | }; |
1062 | 1066 | ||
1063 | static snd_pcm_ops_t snd_ymfpci_capture_rec_ops = { | 1067 | static struct snd_pcm_ops snd_ymfpci_capture_rec_ops = { |
1064 | .open = snd_ymfpci_capture_rec_open, | 1068 | .open = snd_ymfpci_capture_rec_open, |
1065 | .close = snd_ymfpci_capture_close, | 1069 | .close = snd_ymfpci_capture_close, |
1066 | .ioctl = snd_pcm_lib_ioctl, | 1070 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1071,9 +1075,9 @@ static snd_pcm_ops_t snd_ymfpci_capture_rec_ops = { | |||
1071 | .pointer = snd_ymfpci_capture_pointer, | 1075 | .pointer = snd_ymfpci_capture_pointer, |
1072 | }; | 1076 | }; |
1073 | 1077 | ||
1074 | int __devinit snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | 1078 | int __devinit snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) |
1075 | { | 1079 | { |
1076 | snd_pcm_t *pcm; | 1080 | struct snd_pcm *pcm; |
1077 | int err; | 1081 | int err; |
1078 | 1082 | ||
1079 | if (rpcm) | 1083 | if (rpcm) |
@@ -1098,7 +1102,7 @@ int __devinit snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | |||
1098 | return 0; | 1102 | return 0; |
1099 | } | 1103 | } |
1100 | 1104 | ||
1101 | static snd_pcm_ops_t snd_ymfpci_capture_ac97_ops = { | 1105 | static struct snd_pcm_ops snd_ymfpci_capture_ac97_ops = { |
1102 | .open = snd_ymfpci_capture_ac97_open, | 1106 | .open = snd_ymfpci_capture_ac97_open, |
1103 | .close = snd_ymfpci_capture_close, | 1107 | .close = snd_ymfpci_capture_close, |
1104 | .ioctl = snd_pcm_lib_ioctl, | 1108 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1109,9 +1113,9 @@ static snd_pcm_ops_t snd_ymfpci_capture_ac97_ops = { | |||
1109 | .pointer = snd_ymfpci_capture_pointer, | 1113 | .pointer = snd_ymfpci_capture_pointer, |
1110 | }; | 1114 | }; |
1111 | 1115 | ||
1112 | int __devinit snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | 1116 | int __devinit snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) |
1113 | { | 1117 | { |
1114 | snd_pcm_t *pcm; | 1118 | struct snd_pcm *pcm; |
1115 | int err; | 1119 | int err; |
1116 | 1120 | ||
1117 | if (rpcm) | 1121 | if (rpcm) |
@@ -1136,7 +1140,7 @@ int __devinit snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | |||
1136 | return 0; | 1140 | return 0; |
1137 | } | 1141 | } |
1138 | 1142 | ||
1139 | static snd_pcm_ops_t snd_ymfpci_playback_spdif_ops = { | 1143 | static struct snd_pcm_ops snd_ymfpci_playback_spdif_ops = { |
1140 | .open = snd_ymfpci_playback_spdif_open, | 1144 | .open = snd_ymfpci_playback_spdif_open, |
1141 | .close = snd_ymfpci_playback_spdif_close, | 1145 | .close = snd_ymfpci_playback_spdif_close, |
1142 | .ioctl = snd_pcm_lib_ioctl, | 1146 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1147,9 +1151,9 @@ static snd_pcm_ops_t snd_ymfpci_playback_spdif_ops = { | |||
1147 | .pointer = snd_ymfpci_playback_pointer, | 1151 | .pointer = snd_ymfpci_playback_pointer, |
1148 | }; | 1152 | }; |
1149 | 1153 | ||
1150 | int __devinit snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | 1154 | int __devinit snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) |
1151 | { | 1155 | { |
1152 | snd_pcm_t *pcm; | 1156 | struct snd_pcm *pcm; |
1153 | int err; | 1157 | int err; |
1154 | 1158 | ||
1155 | if (rpcm) | 1159 | if (rpcm) |
@@ -1173,7 +1177,7 @@ int __devinit snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t ** rpcm | |||
1173 | return 0; | 1177 | return 0; |
1174 | } | 1178 | } |
1175 | 1179 | ||
1176 | static snd_pcm_ops_t snd_ymfpci_playback_4ch_ops = { | 1180 | static struct snd_pcm_ops snd_ymfpci_playback_4ch_ops = { |
1177 | .open = snd_ymfpci_playback_4ch_open, | 1181 | .open = snd_ymfpci_playback_4ch_open, |
1178 | .close = snd_ymfpci_playback_4ch_close, | 1182 | .close = snd_ymfpci_playback_4ch_close, |
1179 | .ioctl = snd_pcm_lib_ioctl, | 1183 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1184,9 +1188,9 @@ static snd_pcm_ops_t snd_ymfpci_playback_4ch_ops = { | |||
1184 | .pointer = snd_ymfpci_playback_pointer, | 1188 | .pointer = snd_ymfpci_playback_pointer, |
1185 | }; | 1189 | }; |
1186 | 1190 | ||
1187 | int __devinit snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | 1191 | int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) |
1188 | { | 1192 | { |
1189 | snd_pcm_t *pcm; | 1193 | struct snd_pcm *pcm; |
1190 | int err; | 1194 | int err; |
1191 | 1195 | ||
1192 | if (rpcm) | 1196 | if (rpcm) |
@@ -1210,17 +1214,17 @@ int __devinit snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) | |||
1210 | return 0; | 1214 | return 0; |
1211 | } | 1215 | } |
1212 | 1216 | ||
1213 | static int snd_ymfpci_spdif_default_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1217 | static int snd_ymfpci_spdif_default_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1214 | { | 1218 | { |
1215 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1219 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1216 | uinfo->count = 1; | 1220 | uinfo->count = 1; |
1217 | return 0; | 1221 | return 0; |
1218 | } | 1222 | } |
1219 | 1223 | ||
1220 | static int snd_ymfpci_spdif_default_get(snd_kcontrol_t * kcontrol, | 1224 | static int snd_ymfpci_spdif_default_get(struct snd_kcontrol *kcontrol, |
1221 | snd_ctl_elem_value_t * ucontrol) | 1225 | struct snd_ctl_elem_value *ucontrol) |
1222 | { | 1226 | { |
1223 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1227 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1224 | 1228 | ||
1225 | spin_lock_irq(&chip->reg_lock); | 1229 | spin_lock_irq(&chip->reg_lock); |
1226 | ucontrol->value.iec958.status[0] = (chip->spdif_bits >> 0) & 0xff; | 1230 | ucontrol->value.iec958.status[0] = (chip->spdif_bits >> 0) & 0xff; |
@@ -1229,10 +1233,10 @@ static int snd_ymfpci_spdif_default_get(snd_kcontrol_t * kcontrol, | |||
1229 | return 0; | 1233 | return 0; |
1230 | } | 1234 | } |
1231 | 1235 | ||
1232 | static int snd_ymfpci_spdif_default_put(snd_kcontrol_t * kcontrol, | 1236 | static int snd_ymfpci_spdif_default_put(struct snd_kcontrol *kcontrol, |
1233 | snd_ctl_elem_value_t * ucontrol) | 1237 | struct snd_ctl_elem_value *ucontrol) |
1234 | { | 1238 | { |
1235 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1239 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1236 | unsigned int val; | 1240 | unsigned int val; |
1237 | int change; | 1241 | int change; |
1238 | 1242 | ||
@@ -1247,7 +1251,7 @@ static int snd_ymfpci_spdif_default_put(snd_kcontrol_t * kcontrol, | |||
1247 | return change; | 1251 | return change; |
1248 | } | 1252 | } |
1249 | 1253 | ||
1250 | static snd_kcontrol_new_t snd_ymfpci_spdif_default __devinitdata = | 1254 | static struct snd_kcontrol_new snd_ymfpci_spdif_default __devinitdata = |
1251 | { | 1255 | { |
1252 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1256 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1253 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), | 1257 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), |
@@ -1256,17 +1260,17 @@ static snd_kcontrol_new_t snd_ymfpci_spdif_default __devinitdata = | |||
1256 | .put = snd_ymfpci_spdif_default_put | 1260 | .put = snd_ymfpci_spdif_default_put |
1257 | }; | 1261 | }; |
1258 | 1262 | ||
1259 | static int snd_ymfpci_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1263 | static int snd_ymfpci_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1260 | { | 1264 | { |
1261 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1265 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1262 | uinfo->count = 1; | 1266 | uinfo->count = 1; |
1263 | return 0; | 1267 | return 0; |
1264 | } | 1268 | } |
1265 | 1269 | ||
1266 | static int snd_ymfpci_spdif_mask_get(snd_kcontrol_t * kcontrol, | 1270 | static int snd_ymfpci_spdif_mask_get(struct snd_kcontrol *kcontrol, |
1267 | snd_ctl_elem_value_t * ucontrol) | 1271 | struct snd_ctl_elem_value *ucontrol) |
1268 | { | 1272 | { |
1269 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1273 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1270 | 1274 | ||
1271 | spin_lock_irq(&chip->reg_lock); | 1275 | spin_lock_irq(&chip->reg_lock); |
1272 | ucontrol->value.iec958.status[0] = 0x3e; | 1276 | ucontrol->value.iec958.status[0] = 0x3e; |
@@ -1275,7 +1279,7 @@ static int snd_ymfpci_spdif_mask_get(snd_kcontrol_t * kcontrol, | |||
1275 | return 0; | 1279 | return 0; |
1276 | } | 1280 | } |
1277 | 1281 | ||
1278 | static snd_kcontrol_new_t snd_ymfpci_spdif_mask __devinitdata = | 1282 | static struct snd_kcontrol_new snd_ymfpci_spdif_mask __devinitdata = |
1279 | { | 1283 | { |
1280 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1284 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1281 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1285 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1284,17 +1288,17 @@ static snd_kcontrol_new_t snd_ymfpci_spdif_mask __devinitdata = | |||
1284 | .get = snd_ymfpci_spdif_mask_get, | 1288 | .get = snd_ymfpci_spdif_mask_get, |
1285 | }; | 1289 | }; |
1286 | 1290 | ||
1287 | static int snd_ymfpci_spdif_stream_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1291 | static int snd_ymfpci_spdif_stream_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1288 | { | 1292 | { |
1289 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1293 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1290 | uinfo->count = 1; | 1294 | uinfo->count = 1; |
1291 | return 0; | 1295 | return 0; |
1292 | } | 1296 | } |
1293 | 1297 | ||
1294 | static int snd_ymfpci_spdif_stream_get(snd_kcontrol_t * kcontrol, | 1298 | static int snd_ymfpci_spdif_stream_get(struct snd_kcontrol *kcontrol, |
1295 | snd_ctl_elem_value_t * ucontrol) | 1299 | struct snd_ctl_elem_value *ucontrol) |
1296 | { | 1300 | { |
1297 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1301 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1298 | 1302 | ||
1299 | spin_lock_irq(&chip->reg_lock); | 1303 | spin_lock_irq(&chip->reg_lock); |
1300 | ucontrol->value.iec958.status[0] = (chip->spdif_pcm_bits >> 0) & 0xff; | 1304 | ucontrol->value.iec958.status[0] = (chip->spdif_pcm_bits >> 0) & 0xff; |
@@ -1303,10 +1307,10 @@ static int snd_ymfpci_spdif_stream_get(snd_kcontrol_t * kcontrol, | |||
1303 | return 0; | 1307 | return 0; |
1304 | } | 1308 | } |
1305 | 1309 | ||
1306 | static int snd_ymfpci_spdif_stream_put(snd_kcontrol_t * kcontrol, | 1310 | static int snd_ymfpci_spdif_stream_put(struct snd_kcontrol *kcontrol, |
1307 | snd_ctl_elem_value_t * ucontrol) | 1311 | struct snd_ctl_elem_value *ucontrol) |
1308 | { | 1312 | { |
1309 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1313 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1310 | unsigned int val; | 1314 | unsigned int val; |
1311 | int change; | 1315 | int change; |
1312 | 1316 | ||
@@ -1321,7 +1325,7 @@ static int snd_ymfpci_spdif_stream_put(snd_kcontrol_t * kcontrol, | |||
1321 | return change; | 1325 | return change; |
1322 | } | 1326 | } |
1323 | 1327 | ||
1324 | static snd_kcontrol_new_t snd_ymfpci_spdif_stream __devinitdata = | 1328 | static struct snd_kcontrol_new snd_ymfpci_spdif_stream __devinitdata = |
1325 | { | 1329 | { |
1326 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, | 1330 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, |
1327 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1331 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1331,7 +1335,7 @@ static snd_kcontrol_new_t snd_ymfpci_spdif_stream __devinitdata = | |||
1331 | .put = snd_ymfpci_spdif_stream_put | 1335 | .put = snd_ymfpci_spdif_stream_put |
1332 | }; | 1336 | }; |
1333 | 1337 | ||
1334 | static int snd_ymfpci_drec_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *info) | 1338 | static int snd_ymfpci_drec_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *info) |
1335 | { | 1339 | { |
1336 | static char *texts[3] = {"AC'97", "IEC958", "ZV Port"}; | 1340 | static char *texts[3] = {"AC'97", "IEC958", "ZV Port"}; |
1337 | 1341 | ||
@@ -1344,9 +1348,9 @@ static int snd_ymfpci_drec_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_in | |||
1344 | return 0; | 1348 | return 0; |
1345 | } | 1349 | } |
1346 | 1350 | ||
1347 | static int snd_ymfpci_drec_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value) | 1351 | static int snd_ymfpci_drec_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *value) |
1348 | { | 1352 | { |
1349 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1353 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1350 | u16 reg; | 1354 | u16 reg; |
1351 | 1355 | ||
1352 | spin_lock_irq(&chip->reg_lock); | 1356 | spin_lock_irq(&chip->reg_lock); |
@@ -1359,9 +1363,9 @@ static int snd_ymfpci_drec_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_val | |||
1359 | return 0; | 1363 | return 0; |
1360 | } | 1364 | } |
1361 | 1365 | ||
1362 | static int snd_ymfpci_drec_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value) | 1366 | static int snd_ymfpci_drec_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *value) |
1363 | { | 1367 | { |
1364 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1368 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1365 | u16 reg, old_reg; | 1369 | u16 reg, old_reg; |
1366 | 1370 | ||
1367 | spin_lock_irq(&chip->reg_lock); | 1371 | spin_lock_irq(&chip->reg_lock); |
@@ -1375,7 +1379,7 @@ static int snd_ymfpci_drec_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_val | |||
1375 | return reg != old_reg; | 1379 | return reg != old_reg; |
1376 | } | 1380 | } |
1377 | 1381 | ||
1378 | static snd_kcontrol_new_t snd_ymfpci_drec_source __devinitdata = { | 1382 | static struct snd_kcontrol_new snd_ymfpci_drec_source __devinitdata = { |
1379 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, | 1383 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
1380 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1384 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1381 | .name = "Direct Recording Source", | 1385 | .name = "Direct Recording Source", |
@@ -1394,8 +1398,8 @@ static snd_kcontrol_new_t snd_ymfpci_drec_source __devinitdata = { | |||
1394 | .get = snd_ymfpci_get_single, .put = snd_ymfpci_put_single, \ | 1398 | .get = snd_ymfpci_get_single, .put = snd_ymfpci_put_single, \ |
1395 | .private_value = ((reg) | ((shift) << 16)) } | 1399 | .private_value = ((reg) | ((shift) << 16)) } |
1396 | 1400 | ||
1397 | static int snd_ymfpci_info_single(snd_kcontrol_t *kcontrol, | 1401 | static int snd_ymfpci_info_single(struct snd_kcontrol *kcontrol, |
1398 | snd_ctl_elem_info_t *uinfo) | 1402 | struct snd_ctl_elem_info *uinfo) |
1399 | { | 1403 | { |
1400 | int reg = kcontrol->private_value & 0xffff; | 1404 | int reg = kcontrol->private_value & 0xffff; |
1401 | 1405 | ||
@@ -1411,10 +1415,10 @@ static int snd_ymfpci_info_single(snd_kcontrol_t *kcontrol, | |||
1411 | return 0; | 1415 | return 0; |
1412 | } | 1416 | } |
1413 | 1417 | ||
1414 | static int snd_ymfpci_get_single(snd_kcontrol_t *kcontrol, | 1418 | static int snd_ymfpci_get_single(struct snd_kcontrol *kcontrol, |
1415 | snd_ctl_elem_value_t *ucontrol) | 1419 | struct snd_ctl_elem_value *ucontrol) |
1416 | { | 1420 | { |
1417 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1421 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1418 | int reg = kcontrol->private_value & 0xffff; | 1422 | int reg = kcontrol->private_value & 0xffff; |
1419 | unsigned int shift = (kcontrol->private_value >> 16) & 0xff; | 1423 | unsigned int shift = (kcontrol->private_value >> 16) & 0xff; |
1420 | unsigned int mask = 1; | 1424 | unsigned int mask = 1; |
@@ -1429,10 +1433,10 @@ static int snd_ymfpci_get_single(snd_kcontrol_t *kcontrol, | |||
1429 | return 0; | 1433 | return 0; |
1430 | } | 1434 | } |
1431 | 1435 | ||
1432 | static int snd_ymfpci_put_single(snd_kcontrol_t *kcontrol, | 1436 | static int snd_ymfpci_put_single(struct snd_kcontrol *kcontrol, |
1433 | snd_ctl_elem_value_t *ucontrol) | 1437 | struct snd_ctl_elem_value *ucontrol) |
1434 | { | 1438 | { |
1435 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1439 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1436 | int reg = kcontrol->private_value & 0xffff; | 1440 | int reg = kcontrol->private_value & 0xffff; |
1437 | unsigned int shift = (kcontrol->private_value >> 16) & 0xff; | 1441 | unsigned int shift = (kcontrol->private_value >> 16) & 0xff; |
1438 | unsigned int mask = 1; | 1442 | unsigned int mask = 1; |
@@ -1461,7 +1465,7 @@ static int snd_ymfpci_put_single(snd_kcontrol_t *kcontrol, | |||
1461 | .get = snd_ymfpci_get_double, .put = snd_ymfpci_put_double, \ | 1465 | .get = snd_ymfpci_get_double, .put = snd_ymfpci_put_double, \ |
1462 | .private_value = reg } | 1466 | .private_value = reg } |
1463 | 1467 | ||
1464 | static int snd_ymfpci_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1468 | static int snd_ymfpci_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1465 | { | 1469 | { |
1466 | unsigned int reg = kcontrol->private_value; | 1470 | unsigned int reg = kcontrol->private_value; |
1467 | 1471 | ||
@@ -1474,9 +1478,9 @@ static int snd_ymfpci_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1474 | return 0; | 1478 | return 0; |
1475 | } | 1479 | } |
1476 | 1480 | ||
1477 | static int snd_ymfpci_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1481 | static int snd_ymfpci_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1478 | { | 1482 | { |
1479 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1483 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1480 | unsigned int reg = kcontrol->private_value; | 1484 | unsigned int reg = kcontrol->private_value; |
1481 | unsigned int shift_left = 0, shift_right = 16, mask = 16383; | 1485 | unsigned int shift_left = 0, shift_right = 16, mask = 16383; |
1482 | unsigned int val; | 1486 | unsigned int val; |
@@ -1491,9 +1495,9 @@ static int snd_ymfpci_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1491 | return 0; | 1495 | return 0; |
1492 | } | 1496 | } |
1493 | 1497 | ||
1494 | static int snd_ymfpci_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1498 | static int snd_ymfpci_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1495 | { | 1499 | { |
1496 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1500 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1497 | unsigned int reg = kcontrol->private_value; | 1501 | unsigned int reg = kcontrol->private_value; |
1498 | unsigned int shift_left = 0, shift_right = 16, mask = 16383; | 1502 | unsigned int shift_left = 0, shift_right = 16, mask = 16383; |
1499 | int change; | 1503 | int change; |
@@ -1517,7 +1521,7 @@ static int snd_ymfpci_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1517 | /* | 1521 | /* |
1518 | * 4ch duplication | 1522 | * 4ch duplication |
1519 | */ | 1523 | */ |
1520 | static int snd_ymfpci_info_dup4ch(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1524 | static int snd_ymfpci_info_dup4ch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1521 | { | 1525 | { |
1522 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1526 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1523 | uinfo->count = 1; | 1527 | uinfo->count = 1; |
@@ -1526,16 +1530,16 @@ static int snd_ymfpci_info_dup4ch(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1526 | return 0; | 1530 | return 0; |
1527 | } | 1531 | } |
1528 | 1532 | ||
1529 | static int snd_ymfpci_get_dup4ch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1533 | static int snd_ymfpci_get_dup4ch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1530 | { | 1534 | { |
1531 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1535 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1532 | ucontrol->value.integer.value[0] = chip->mode_dup4ch; | 1536 | ucontrol->value.integer.value[0] = chip->mode_dup4ch; |
1533 | return 0; | 1537 | return 0; |
1534 | } | 1538 | } |
1535 | 1539 | ||
1536 | static int snd_ymfpci_put_dup4ch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1540 | static int snd_ymfpci_put_dup4ch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1537 | { | 1541 | { |
1538 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1542 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1539 | int change; | 1543 | int change; |
1540 | change = (ucontrol->value.integer.value[0] != chip->mode_dup4ch); | 1544 | change = (ucontrol->value.integer.value[0] != chip->mode_dup4ch); |
1541 | if (change) | 1545 | if (change) |
@@ -1544,7 +1548,7 @@ static int snd_ymfpci_put_dup4ch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1544 | } | 1548 | } |
1545 | 1549 | ||
1546 | 1550 | ||
1547 | static snd_kcontrol_new_t snd_ymfpci_controls[] __devinitdata = { | 1551 | static struct snd_kcontrol_new snd_ymfpci_controls[] __devinitdata = { |
1548 | YMFPCI_DOUBLE("Wave Playback Volume", 0, YDSXGR_NATIVEDACOUTVOL), | 1552 | YMFPCI_DOUBLE("Wave Playback Volume", 0, YDSXGR_NATIVEDACOUTVOL), |
1549 | YMFPCI_DOUBLE("Wave Capture Volume", 0, YDSXGR_NATIVEDACLOOPVOL), | 1553 | YMFPCI_DOUBLE("Wave Capture Volume", 0, YDSXGR_NATIVEDACLOOPVOL), |
1550 | YMFPCI_DOUBLE("Digital Capture Volume", 0, YDSXGR_NATIVEDACINVOL), | 1554 | YMFPCI_DOUBLE("Digital Capture Volume", 0, YDSXGR_NATIVEDACINVOL), |
@@ -1575,7 +1579,7 @@ YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("Loop",NONE,NONE), 0, YDSXGR_SPDIFINCTRL, 4) | |||
1575 | * GPIO | 1579 | * GPIO |
1576 | */ | 1580 | */ |
1577 | 1581 | ||
1578 | static int snd_ymfpci_get_gpio_out(ymfpci_t *chip, int pin) | 1582 | static int snd_ymfpci_get_gpio_out(struct snd_ymfpci *chip, int pin) |
1579 | { | 1583 | { |
1580 | u16 reg, mode; | 1584 | u16 reg, mode; |
1581 | unsigned long flags; | 1585 | unsigned long flags; |
@@ -1595,7 +1599,7 @@ static int snd_ymfpci_get_gpio_out(ymfpci_t *chip, int pin) | |||
1595 | return (mode >> pin) & 1; | 1599 | return (mode >> pin) & 1; |
1596 | } | 1600 | } |
1597 | 1601 | ||
1598 | static int snd_ymfpci_set_gpio_out(ymfpci_t *chip, int pin, int enable) | 1602 | static int snd_ymfpci_set_gpio_out(struct snd_ymfpci *chip, int pin, int enable) |
1599 | { | 1603 | { |
1600 | u16 reg; | 1604 | u16 reg; |
1601 | unsigned long flags; | 1605 | unsigned long flags; |
@@ -1612,7 +1616,7 @@ static int snd_ymfpci_set_gpio_out(ymfpci_t *chip, int pin, int enable) | |||
1612 | return 0; | 1616 | return 0; |
1613 | } | 1617 | } |
1614 | 1618 | ||
1615 | static int snd_ymfpci_gpio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1619 | static int snd_ymfpci_gpio_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1616 | { | 1620 | { |
1617 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1621 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1618 | uinfo->count = 1; | 1622 | uinfo->count = 1; |
@@ -1621,17 +1625,17 @@ static int snd_ymfpci_gpio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1621 | return 0; | 1625 | return 0; |
1622 | } | 1626 | } |
1623 | 1627 | ||
1624 | static int snd_ymfpci_gpio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1628 | static int snd_ymfpci_gpio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1625 | { | 1629 | { |
1626 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1630 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1627 | int pin = (int)kcontrol->private_value; | 1631 | int pin = (int)kcontrol->private_value; |
1628 | ucontrol->value.integer.value[0] = snd_ymfpci_get_gpio_out(chip, pin); | 1632 | ucontrol->value.integer.value[0] = snd_ymfpci_get_gpio_out(chip, pin); |
1629 | return 0; | 1633 | return 0; |
1630 | } | 1634 | } |
1631 | 1635 | ||
1632 | static int snd_ymfpci_gpio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1636 | static int snd_ymfpci_gpio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1633 | { | 1637 | { |
1634 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1638 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1635 | int pin = (int)kcontrol->private_value; | 1639 | int pin = (int)kcontrol->private_value; |
1636 | 1640 | ||
1637 | if (snd_ymfpci_get_gpio_out(chip, pin) != ucontrol->value.integer.value[0]) { | 1641 | if (snd_ymfpci_get_gpio_out(chip, pin) != ucontrol->value.integer.value[0]) { |
@@ -1642,7 +1646,7 @@ static int snd_ymfpci_gpio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1642 | return 0; | 1646 | return 0; |
1643 | } | 1647 | } |
1644 | 1648 | ||
1645 | static snd_kcontrol_new_t snd_ymfpci_rear_shared __devinitdata = { | 1649 | static struct snd_kcontrol_new snd_ymfpci_rear_shared __devinitdata = { |
1646 | .name = "Shared Rear/Line-In Switch", | 1650 | .name = "Shared Rear/Line-In Switch", |
1647 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1651 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1648 | .info = snd_ymfpci_gpio_sw_info, | 1652 | .info = snd_ymfpci_gpio_sw_info, |
@@ -1655,8 +1659,8 @@ static snd_kcontrol_new_t snd_ymfpci_rear_shared __devinitdata = { | |||
1655 | * PCM voice volume | 1659 | * PCM voice volume |
1656 | */ | 1660 | */ |
1657 | 1661 | ||
1658 | static int snd_ymfpci_pcm_vol_info(snd_kcontrol_t *kcontrol, | 1662 | static int snd_ymfpci_pcm_vol_info(struct snd_kcontrol *kcontrol, |
1659 | snd_ctl_elem_info_t *uinfo) | 1663 | struct snd_ctl_elem_info *uinfo) |
1660 | { | 1664 | { |
1661 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 1665 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
1662 | uinfo->count = 2; | 1666 | uinfo->count = 2; |
@@ -1665,10 +1669,10 @@ static int snd_ymfpci_pcm_vol_info(snd_kcontrol_t *kcontrol, | |||
1665 | return 0; | 1669 | return 0; |
1666 | } | 1670 | } |
1667 | 1671 | ||
1668 | static int snd_ymfpci_pcm_vol_get(snd_kcontrol_t *kcontrol, | 1672 | static int snd_ymfpci_pcm_vol_get(struct snd_kcontrol *kcontrol, |
1669 | snd_ctl_elem_value_t *ucontrol) | 1673 | struct snd_ctl_elem_value *ucontrol) |
1670 | { | 1674 | { |
1671 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1675 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1672 | unsigned int subs = kcontrol->id.subdevice; | 1676 | unsigned int subs = kcontrol->id.subdevice; |
1673 | 1677 | ||
1674 | ucontrol->value.integer.value[0] = chip->pcm_mixer[subs].left; | 1678 | ucontrol->value.integer.value[0] = chip->pcm_mixer[subs].left; |
@@ -1676,12 +1680,12 @@ static int snd_ymfpci_pcm_vol_get(snd_kcontrol_t *kcontrol, | |||
1676 | return 0; | 1680 | return 0; |
1677 | } | 1681 | } |
1678 | 1682 | ||
1679 | static int snd_ymfpci_pcm_vol_put(snd_kcontrol_t *kcontrol, | 1683 | static int snd_ymfpci_pcm_vol_put(struct snd_kcontrol *kcontrol, |
1680 | snd_ctl_elem_value_t *ucontrol) | 1684 | struct snd_ctl_elem_value *ucontrol) |
1681 | { | 1685 | { |
1682 | ymfpci_t *chip = snd_kcontrol_chip(kcontrol); | 1686 | struct snd_ymfpci *chip = snd_kcontrol_chip(kcontrol); |
1683 | unsigned int subs = kcontrol->id.subdevice; | 1687 | unsigned int subs = kcontrol->id.subdevice; |
1684 | snd_pcm_substream_t *substream; | 1688 | struct snd_pcm_substream *substream; |
1685 | unsigned long flags; | 1689 | unsigned long flags; |
1686 | 1690 | ||
1687 | if (ucontrol->value.integer.value[0] != chip->pcm_mixer[subs].left || | 1691 | if (ucontrol->value.integer.value[0] != chip->pcm_mixer[subs].left || |
@@ -1689,10 +1693,10 @@ static int snd_ymfpci_pcm_vol_put(snd_kcontrol_t *kcontrol, | |||
1689 | chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; | 1693 | chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; |
1690 | chip->pcm_mixer[subs].right = ucontrol->value.integer.value[1]; | 1694 | chip->pcm_mixer[subs].right = ucontrol->value.integer.value[1]; |
1691 | 1695 | ||
1692 | substream = (snd_pcm_substream_t *)kcontrol->private_value; | 1696 | substream = (struct snd_pcm_substream *)kcontrol->private_value; |
1693 | spin_lock_irqsave(&chip->voice_lock, flags); | 1697 | spin_lock_irqsave(&chip->voice_lock, flags); |
1694 | if (substream->runtime && substream->runtime->private_data) { | 1698 | if (substream->runtime && substream->runtime->private_data) { |
1695 | ymfpci_pcm_t *ypcm = substream->runtime->private_data; | 1699 | struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; |
1696 | ypcm->update_pcm_vol = 2; | 1700 | ypcm->update_pcm_vol = 2; |
1697 | } | 1701 | } |
1698 | spin_unlock_irqrestore(&chip->voice_lock, flags); | 1702 | spin_unlock_irqrestore(&chip->voice_lock, flags); |
@@ -1701,7 +1705,7 @@ static int snd_ymfpci_pcm_vol_put(snd_kcontrol_t *kcontrol, | |||
1701 | return 0; | 1705 | return 0; |
1702 | } | 1706 | } |
1703 | 1707 | ||
1704 | static snd_kcontrol_new_t snd_ymfpci_pcm_volume __devinitdata = { | 1708 | static struct snd_kcontrol_new snd_ymfpci_pcm_volume __devinitdata = { |
1705 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1709 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1706 | .name = "PCM Playback Volume", | 1710 | .name = "PCM Playback Volume", |
1707 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | | 1711 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | |
@@ -1716,26 +1720,26 @@ static snd_kcontrol_new_t snd_ymfpci_pcm_volume __devinitdata = { | |||
1716 | * Mixer routines | 1720 | * Mixer routines |
1717 | */ | 1721 | */ |
1718 | 1722 | ||
1719 | static void snd_ymfpci_mixer_free_ac97_bus(ac97_bus_t *bus) | 1723 | static void snd_ymfpci_mixer_free_ac97_bus(struct snd_ac97_bus *bus) |
1720 | { | 1724 | { |
1721 | ymfpci_t *chip = bus->private_data; | 1725 | struct snd_ymfpci *chip = bus->private_data; |
1722 | chip->ac97_bus = NULL; | 1726 | chip->ac97_bus = NULL; |
1723 | } | 1727 | } |
1724 | 1728 | ||
1725 | static void snd_ymfpci_mixer_free_ac97(ac97_t *ac97) | 1729 | static void snd_ymfpci_mixer_free_ac97(struct snd_ac97 *ac97) |
1726 | { | 1730 | { |
1727 | ymfpci_t *chip = ac97->private_data; | 1731 | struct snd_ymfpci *chip = ac97->private_data; |
1728 | chip->ac97 = NULL; | 1732 | chip->ac97 = NULL; |
1729 | } | 1733 | } |
1730 | 1734 | ||
1731 | int __devinit snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch) | 1735 | int __devinit snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch) |
1732 | { | 1736 | { |
1733 | ac97_template_t ac97; | 1737 | struct snd_ac97_template ac97; |
1734 | snd_kcontrol_t *kctl; | 1738 | struct snd_kcontrol *kctl; |
1735 | snd_pcm_substream_t *substream; | 1739 | struct snd_pcm_substream *substream; |
1736 | unsigned int idx; | 1740 | unsigned int idx; |
1737 | int err; | 1741 | int err; |
1738 | static ac97_bus_ops_t ops = { | 1742 | static struct snd_ac97_bus_ops ops = { |
1739 | .write = snd_ymfpci_codec_write, | 1743 | .write = snd_ymfpci_codec_write, |
1740 | .read = snd_ymfpci_codec_read, | 1744 | .read = snd_ymfpci_codec_read, |
1741 | }; | 1745 | }; |
@@ -1811,9 +1815,9 @@ int __devinit snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch) | |||
1811 | * timer | 1815 | * timer |
1812 | */ | 1816 | */ |
1813 | 1817 | ||
1814 | static int snd_ymfpci_timer_start(snd_timer_t *timer) | 1818 | static int snd_ymfpci_timer_start(struct snd_timer *timer) |
1815 | { | 1819 | { |
1816 | ymfpci_t *chip; | 1820 | struct snd_ymfpci *chip; |
1817 | unsigned long flags; | 1821 | unsigned long flags; |
1818 | unsigned int count; | 1822 | unsigned int count; |
1819 | 1823 | ||
@@ -1826,9 +1830,9 @@ static int snd_ymfpci_timer_start(snd_timer_t *timer) | |||
1826 | return 0; | 1830 | return 0; |
1827 | } | 1831 | } |
1828 | 1832 | ||
1829 | static int snd_ymfpci_timer_stop(snd_timer_t *timer) | 1833 | static int snd_ymfpci_timer_stop(struct snd_timer *timer) |
1830 | { | 1834 | { |
1831 | ymfpci_t *chip; | 1835 | struct snd_ymfpci *chip; |
1832 | unsigned long flags; | 1836 | unsigned long flags; |
1833 | 1837 | ||
1834 | chip = snd_timer_chip(timer); | 1838 | chip = snd_timer_chip(timer); |
@@ -1838,7 +1842,7 @@ static int snd_ymfpci_timer_stop(snd_timer_t *timer) | |||
1838 | return 0; | 1842 | return 0; |
1839 | } | 1843 | } |
1840 | 1844 | ||
1841 | static int snd_ymfpci_timer_precise_resolution(snd_timer_t *timer, | 1845 | static int snd_ymfpci_timer_precise_resolution(struct snd_timer *timer, |
1842 | unsigned long *num, unsigned long *den) | 1846 | unsigned long *num, unsigned long *den) |
1843 | { | 1847 | { |
1844 | *num = 1; | 1848 | *num = 1; |
@@ -1846,7 +1850,7 @@ static int snd_ymfpci_timer_precise_resolution(snd_timer_t *timer, | |||
1846 | return 0; | 1850 | return 0; |
1847 | } | 1851 | } |
1848 | 1852 | ||
1849 | static struct _snd_timer_hardware snd_ymfpci_timer_hw = { | 1853 | static struct snd_timer_hardware snd_ymfpci_timer_hw = { |
1850 | .flags = SNDRV_TIMER_HW_AUTO, | 1854 | .flags = SNDRV_TIMER_HW_AUTO, |
1851 | .resolution = 20833, /* 1/fs = 20.8333...us */ | 1855 | .resolution = 20833, /* 1/fs = 20.8333...us */ |
1852 | .ticks = 0x8000, | 1856 | .ticks = 0x8000, |
@@ -1855,10 +1859,10 @@ static struct _snd_timer_hardware snd_ymfpci_timer_hw = { | |||
1855 | .precise_resolution = snd_ymfpci_timer_precise_resolution, | 1859 | .precise_resolution = snd_ymfpci_timer_precise_resolution, |
1856 | }; | 1860 | }; |
1857 | 1861 | ||
1858 | int __devinit snd_ymfpci_timer(ymfpci_t *chip, int device) | 1862 | int __devinit snd_ymfpci_timer(struct snd_ymfpci *chip, int device) |
1859 | { | 1863 | { |
1860 | snd_timer_t *timer = NULL; | 1864 | struct snd_timer *timer = NULL; |
1861 | snd_timer_id_t tid; | 1865 | struct snd_timer_id tid; |
1862 | int err; | 1866 | int err; |
1863 | 1867 | ||
1864 | tid.dev_class = SNDRV_TIMER_CLASS_CARD; | 1868 | tid.dev_class = SNDRV_TIMER_CLASS_CARD; |
@@ -1880,10 +1884,10 @@ int __devinit snd_ymfpci_timer(ymfpci_t *chip, int device) | |||
1880 | * proc interface | 1884 | * proc interface |
1881 | */ | 1885 | */ |
1882 | 1886 | ||
1883 | static void snd_ymfpci_proc_read(snd_info_entry_t *entry, | 1887 | static void snd_ymfpci_proc_read(struct snd_info_entry *entry, |
1884 | snd_info_buffer_t * buffer) | 1888 | struct snd_info_buffer *buffer) |
1885 | { | 1889 | { |
1886 | ymfpci_t *chip = entry->private_data; | 1890 | struct snd_ymfpci *chip = entry->private_data; |
1887 | int i; | 1891 | int i; |
1888 | 1892 | ||
1889 | snd_iprintf(buffer, "YMFPCI\n\n"); | 1893 | snd_iprintf(buffer, "YMFPCI\n\n"); |
@@ -1891,9 +1895,9 @@ static void snd_ymfpci_proc_read(snd_info_entry_t *entry, | |||
1891 | snd_iprintf(buffer, "%04x: %04x\n", i, snd_ymfpci_readl(chip, i)); | 1895 | snd_iprintf(buffer, "%04x: %04x\n", i, snd_ymfpci_readl(chip, i)); |
1892 | } | 1896 | } |
1893 | 1897 | ||
1894 | static int __devinit snd_ymfpci_proc_init(snd_card_t * card, ymfpci_t *chip) | 1898 | static int __devinit snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip) |
1895 | { | 1899 | { |
1896 | snd_info_entry_t *entry; | 1900 | struct snd_info_entry *entry; |
1897 | 1901 | ||
1898 | if (! snd_card_proc_new(card, "ymfpci", &entry)) | 1902 | if (! snd_card_proc_new(card, "ymfpci", &entry)) |
1899 | snd_info_set_text_ops(entry, chip, 1024, snd_ymfpci_proc_read); | 1903 | snd_info_set_text_ops(entry, chip, 1024, snd_ymfpci_proc_read); |
@@ -1922,12 +1926,12 @@ static void snd_ymfpci_aclink_reset(struct pci_dev * pci) | |||
1922 | #endif | 1926 | #endif |
1923 | } | 1927 | } |
1924 | 1928 | ||
1925 | static void snd_ymfpci_enable_dsp(ymfpci_t *chip) | 1929 | static void snd_ymfpci_enable_dsp(struct snd_ymfpci *chip) |
1926 | { | 1930 | { |
1927 | snd_ymfpci_writel(chip, YDSXGR_CONFIG, 0x00000001); | 1931 | snd_ymfpci_writel(chip, YDSXGR_CONFIG, 0x00000001); |
1928 | } | 1932 | } |
1929 | 1933 | ||
1930 | static void snd_ymfpci_disable_dsp(ymfpci_t *chip) | 1934 | static void snd_ymfpci_disable_dsp(struct snd_ymfpci *chip) |
1931 | { | 1935 | { |
1932 | u32 val; | 1936 | u32 val; |
1933 | int timeout = 1000; | 1937 | int timeout = 1000; |
@@ -1944,7 +1948,7 @@ static void snd_ymfpci_disable_dsp(ymfpci_t *chip) | |||
1944 | 1948 | ||
1945 | #include "ymfpci_image.h" | 1949 | #include "ymfpci_image.h" |
1946 | 1950 | ||
1947 | static void snd_ymfpci_download_image(ymfpci_t *chip) | 1951 | static void snd_ymfpci_download_image(struct snd_ymfpci *chip) |
1948 | { | 1952 | { |
1949 | int i; | 1953 | int i; |
1950 | u16 ctrl; | 1954 | u16 ctrl; |
@@ -1984,7 +1988,7 @@ static void snd_ymfpci_download_image(ymfpci_t *chip) | |||
1984 | snd_ymfpci_enable_dsp(chip); | 1988 | snd_ymfpci_enable_dsp(chip); |
1985 | } | 1989 | } |
1986 | 1990 | ||
1987 | static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip) | 1991 | static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) |
1988 | { | 1992 | { |
1989 | long size, playback_ctrl_size; | 1993 | long size, playback_ctrl_size; |
1990 | int voice, bank, reg; | 1994 | int voice, bank, reg; |
@@ -2019,10 +2023,10 @@ static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip) | |||
2019 | ptr_addr += (playback_ctrl_size + 0x00ff) & ~0x00ff; | 2023 | ptr_addr += (playback_ctrl_size + 0x00ff) & ~0x00ff; |
2020 | for (voice = 0; voice < YDSXG_PLAYBACK_VOICES; voice++) { | 2024 | for (voice = 0; voice < YDSXG_PLAYBACK_VOICES; voice++) { |
2021 | chip->voices[voice].number = voice; | 2025 | chip->voices[voice].number = voice; |
2022 | chip->voices[voice].bank = (snd_ymfpci_playback_bank_t *)ptr; | 2026 | chip->voices[voice].bank = (struct snd_ymfpci_playback_bank *)ptr; |
2023 | chip->voices[voice].bank_addr = ptr_addr; | 2027 | chip->voices[voice].bank_addr = ptr_addr; |
2024 | for (bank = 0; bank < 2; bank++) { | 2028 | for (bank = 0; bank < 2; bank++) { |
2025 | chip->bank_playback[voice][bank] = (snd_ymfpci_playback_bank_t *)ptr; | 2029 | chip->bank_playback[voice][bank] = (struct snd_ymfpci_playback_bank *)ptr; |
2026 | ptr += chip->bank_size_playback; | 2030 | ptr += chip->bank_size_playback; |
2027 | ptr_addr += chip->bank_size_playback; | 2031 | ptr_addr += chip->bank_size_playback; |
2028 | } | 2032 | } |
@@ -2033,7 +2037,7 @@ static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip) | |||
2033 | chip->bank_base_capture_addr = ptr_addr; | 2037 | chip->bank_base_capture_addr = ptr_addr; |
2034 | for (voice = 0; voice < YDSXG_CAPTURE_VOICES; voice++) | 2038 | for (voice = 0; voice < YDSXG_CAPTURE_VOICES; voice++) |
2035 | for (bank = 0; bank < 2; bank++) { | 2039 | for (bank = 0; bank < 2; bank++) { |
2036 | chip->bank_capture[voice][bank] = (snd_ymfpci_capture_bank_t *)ptr; | 2040 | chip->bank_capture[voice][bank] = (struct snd_ymfpci_capture_bank *)ptr; |
2037 | ptr += chip->bank_size_capture; | 2041 | ptr += chip->bank_size_capture; |
2038 | ptr_addr += chip->bank_size_capture; | 2042 | ptr_addr += chip->bank_size_capture; |
2039 | } | 2043 | } |
@@ -2043,7 +2047,7 @@ static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip) | |||
2043 | chip->bank_base_effect_addr = ptr_addr; | 2047 | chip->bank_base_effect_addr = ptr_addr; |
2044 | for (voice = 0; voice < YDSXG_EFFECT_VOICES; voice++) | 2048 | for (voice = 0; voice < YDSXG_EFFECT_VOICES; voice++) |
2045 | for (bank = 0; bank < 2; bank++) { | 2049 | for (bank = 0; bank < 2; bank++) { |
2046 | chip->bank_effect[voice][bank] = (snd_ymfpci_effect_bank_t *)ptr; | 2050 | chip->bank_effect[voice][bank] = (struct snd_ymfpci_effect_bank *)ptr; |
2047 | ptr += chip->bank_size_effect; | 2051 | ptr += chip->bank_size_effect; |
2048 | ptr_addr += chip->bank_size_effect; | 2052 | ptr_addr += chip->bank_size_effect; |
2049 | } | 2053 | } |
@@ -2082,7 +2086,7 @@ static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip) | |||
2082 | return 0; | 2086 | return 0; |
2083 | } | 2087 | } |
2084 | 2088 | ||
2085 | static int snd_ymfpci_free(ymfpci_t *chip) | 2089 | static int snd_ymfpci_free(struct snd_ymfpci *chip) |
2086 | { | 2090 | { |
2087 | u16 ctrl; | 2091 | u16 ctrl; |
2088 | 2092 | ||
@@ -2135,9 +2139,9 @@ static int snd_ymfpci_free(ymfpci_t *chip) | |||
2135 | return 0; | 2139 | return 0; |
2136 | } | 2140 | } |
2137 | 2141 | ||
2138 | static int snd_ymfpci_dev_free(snd_device_t *device) | 2142 | static int snd_ymfpci_dev_free(struct snd_device *device) |
2139 | { | 2143 | { |
2140 | ymfpci_t *chip = device->device_data; | 2144 | struct snd_ymfpci *chip = device->device_data; |
2141 | return snd_ymfpci_free(chip); | 2145 | return snd_ymfpci_free(chip); |
2142 | } | 2146 | } |
2143 | 2147 | ||
@@ -2171,9 +2175,9 @@ static int saved_regs_index[] = { | |||
2171 | }; | 2175 | }; |
2172 | #define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index) | 2176 | #define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index) |
2173 | 2177 | ||
2174 | static int snd_ymfpci_suspend(snd_card_t *card, pm_message_t state) | 2178 | static int snd_ymfpci_suspend(struct snd_card *card, pm_message_t state) |
2175 | { | 2179 | { |
2176 | ymfpci_t *chip = card->pm_private_data; | 2180 | struct snd_ymfpci *chip = card->pm_private_data; |
2177 | unsigned int i; | 2181 | unsigned int i; |
2178 | 2182 | ||
2179 | snd_pcm_suspend_all(chip->pcm); | 2183 | snd_pcm_suspend_all(chip->pcm); |
@@ -2190,9 +2194,9 @@ static int snd_ymfpci_suspend(snd_card_t *card, pm_message_t state) | |||
2190 | return 0; | 2194 | return 0; |
2191 | } | 2195 | } |
2192 | 2196 | ||
2193 | static int snd_ymfpci_resume(snd_card_t *card) | 2197 | static int snd_ymfpci_resume(struct snd_card *card) |
2194 | { | 2198 | { |
2195 | ymfpci_t *chip = card->pm_private_data; | 2199 | struct snd_ymfpci *chip = card->pm_private_data; |
2196 | unsigned int i; | 2200 | unsigned int i; |
2197 | 2201 | ||
2198 | pci_enable_device(chip->pci); | 2202 | pci_enable_device(chip->pci); |
@@ -2218,14 +2222,14 @@ static int snd_ymfpci_resume(snd_card_t *card) | |||
2218 | } | 2222 | } |
2219 | #endif /* CONFIG_PM */ | 2223 | #endif /* CONFIG_PM */ |
2220 | 2224 | ||
2221 | int __devinit snd_ymfpci_create(snd_card_t * card, | 2225 | int __devinit snd_ymfpci_create(struct snd_card *card, |
2222 | struct pci_dev * pci, | 2226 | struct pci_dev * pci, |
2223 | unsigned short old_legacy_ctrl, | 2227 | unsigned short old_legacy_ctrl, |
2224 | ymfpci_t ** rchip) | 2228 | struct snd_ymfpci ** rchip) |
2225 | { | 2229 | { |
2226 | ymfpci_t *chip; | 2230 | struct snd_ymfpci *chip; |
2227 | int err; | 2231 | int err; |
2228 | static snd_device_ops_t ops = { | 2232 | static struct snd_device_ops ops = { |
2229 | .dev_free = snd_ymfpci_dev_free, | 2233 | .dev_free = snd_ymfpci_dev_free, |
2230 | }; | 2234 | }; |
2231 | 2235 | ||