diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:41:22 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:18:34 -0500 |
commit | 8047c910ff27811060e6983ac446ed5a0fe550c6 (patch) | |
tree | 1a48ae4d0caaa29804cd38bf8398ad3a526ab69a /sound/isa/es18xx.c | |
parent | e3561703723fcc2315f852cb85e80533a2c58e3e (diff) |
[ALSA] Remove xxx_t typedefs: ISA ES18xx
Modules: ES18xx driver
Remove xxx_t typedefs from the ISA ES18xx driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/es18xx.c')
-rw-r--r-- | sound/isa/es18xx.c | 282 |
1 files changed, 140 insertions, 142 deletions
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 7191ff90cc73..06c0e778494e 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -86,7 +86,7 @@ | |||
86 | 86 | ||
87 | #define PFX "es18xx: " | 87 | #define PFX "es18xx: " |
88 | 88 | ||
89 | struct _snd_es18xx { | 89 | struct snd_es18xx { |
90 | unsigned long port; /* port of ESS chip */ | 90 | unsigned long port; /* port of ESS chip */ |
91 | unsigned long mpu_port; /* MPU-401 port of ESS chip */ | 91 | unsigned long mpu_port; /* MPU-401 port of ESS chip */ |
92 | unsigned long fm_port; /* FM port */ | 92 | unsigned long fm_port; /* FM port */ |
@@ -107,18 +107,18 @@ struct _snd_es18xx { | |||
107 | unsigned int dma1_shift; | 107 | unsigned int dma1_shift; |
108 | unsigned int dma2_shift; | 108 | unsigned int dma2_shift; |
109 | 109 | ||
110 | snd_card_t *card; | 110 | struct snd_card *card; |
111 | snd_pcm_t *pcm; | 111 | struct snd_pcm *pcm; |
112 | snd_pcm_substream_t *playback_a_substream; | 112 | struct snd_pcm_substream *playback_a_substream; |
113 | snd_pcm_substream_t *capture_a_substream; | 113 | struct snd_pcm_substream *capture_a_substream; |
114 | snd_pcm_substream_t *playback_b_substream; | 114 | struct snd_pcm_substream *playback_b_substream; |
115 | 115 | ||
116 | snd_rawmidi_t *rmidi; | 116 | struct snd_rawmidi *rmidi; |
117 | 117 | ||
118 | snd_kcontrol_t *hw_volume; | 118 | struct snd_kcontrol *hw_volume; |
119 | snd_kcontrol_t *hw_switch; | 119 | struct snd_kcontrol *hw_switch; |
120 | snd_kcontrol_t *master_volume; | 120 | struct snd_kcontrol *master_volume; |
121 | snd_kcontrol_t *master_switch; | 121 | struct snd_kcontrol *master_switch; |
122 | 122 | ||
123 | spinlock_t reg_lock; | 123 | spinlock_t reg_lock; |
124 | spinlock_t mixer_lock; | 124 | spinlock_t mixer_lock; |
@@ -155,8 +155,6 @@ struct _snd_es18xx { | |||
155 | #define ES18XX_PM_FM 0x020 | 155 | #define ES18XX_PM_FM 0x020 |
156 | #define ES18XX_PM_SUS 0x080 | 156 | #define ES18XX_PM_SUS 0x080 |
157 | 157 | ||
158 | typedef struct _snd_es18xx es18xx_t; | ||
159 | |||
160 | /* Lowlevel */ | 158 | /* Lowlevel */ |
161 | 159 | ||
162 | #define DAC1 0x01 | 160 | #define DAC1 0x01 |
@@ -164,7 +162,7 @@ typedef struct _snd_es18xx es18xx_t; | |||
164 | #define DAC2 0x04 | 162 | #define DAC2 0x04 |
165 | #define MILLISECOND 10000 | 163 | #define MILLISECOND 10000 |
166 | 164 | ||
167 | static int snd_es18xx_dsp_command(es18xx_t *chip, unsigned char val) | 165 | static int snd_es18xx_dsp_command(struct snd_es18xx *chip, unsigned char val) |
168 | { | 166 | { |
169 | int i; | 167 | int i; |
170 | 168 | ||
@@ -177,7 +175,7 @@ static int snd_es18xx_dsp_command(es18xx_t *chip, unsigned char val) | |||
177 | return -EINVAL; | 175 | return -EINVAL; |
178 | } | 176 | } |
179 | 177 | ||
180 | static int snd_es18xx_dsp_get_byte(es18xx_t *chip) | 178 | static int snd_es18xx_dsp_get_byte(struct snd_es18xx *chip) |
181 | { | 179 | { |
182 | int i; | 180 | int i; |
183 | 181 | ||
@@ -191,7 +189,7 @@ static int snd_es18xx_dsp_get_byte(es18xx_t *chip) | |||
191 | 189 | ||
192 | #undef REG_DEBUG | 190 | #undef REG_DEBUG |
193 | 191 | ||
194 | static int snd_es18xx_write(es18xx_t *chip, | 192 | static int snd_es18xx_write(struct snd_es18xx *chip, |
195 | unsigned char reg, unsigned char data) | 193 | unsigned char reg, unsigned char data) |
196 | { | 194 | { |
197 | unsigned long flags; | 195 | unsigned long flags; |
@@ -210,7 +208,7 @@ static int snd_es18xx_write(es18xx_t *chip, | |||
210 | return ret; | 208 | return ret; |
211 | } | 209 | } |
212 | 210 | ||
213 | static int snd_es18xx_read(es18xx_t *chip, unsigned char reg) | 211 | static int snd_es18xx_read(struct snd_es18xx *chip, unsigned char reg) |
214 | { | 212 | { |
215 | unsigned long flags; | 213 | unsigned long flags; |
216 | int ret, data; | 214 | int ret, data; |
@@ -232,7 +230,7 @@ static int snd_es18xx_read(es18xx_t *chip, unsigned char reg) | |||
232 | } | 230 | } |
233 | 231 | ||
234 | /* Return old value */ | 232 | /* Return old value */ |
235 | static int snd_es18xx_bits(es18xx_t *chip, unsigned char reg, | 233 | static int snd_es18xx_bits(struct snd_es18xx *chip, unsigned char reg, |
236 | unsigned char mask, unsigned char val) | 234 | unsigned char mask, unsigned char val) |
237 | { | 235 | { |
238 | int ret; | 236 | int ret; |
@@ -270,7 +268,7 @@ static int snd_es18xx_bits(es18xx_t *chip, unsigned char reg, | |||
270 | return ret; | 268 | return ret; |
271 | } | 269 | } |
272 | 270 | ||
273 | static inline void snd_es18xx_mixer_write(es18xx_t *chip, | 271 | static inline void snd_es18xx_mixer_write(struct snd_es18xx *chip, |
274 | unsigned char reg, unsigned char data) | 272 | unsigned char reg, unsigned char data) |
275 | { | 273 | { |
276 | unsigned long flags; | 274 | unsigned long flags; |
@@ -283,7 +281,7 @@ static inline void snd_es18xx_mixer_write(es18xx_t *chip, | |||
283 | #endif | 281 | #endif |
284 | } | 282 | } |
285 | 283 | ||
286 | static inline int snd_es18xx_mixer_read(es18xx_t *chip, unsigned char reg) | 284 | static inline int snd_es18xx_mixer_read(struct snd_es18xx *chip, unsigned char reg) |
287 | { | 285 | { |
288 | unsigned long flags; | 286 | unsigned long flags; |
289 | int data; | 287 | int data; |
@@ -298,7 +296,7 @@ static inline int snd_es18xx_mixer_read(es18xx_t *chip, unsigned char reg) | |||
298 | } | 296 | } |
299 | 297 | ||
300 | /* Return old value */ | 298 | /* Return old value */ |
301 | static inline int snd_es18xx_mixer_bits(es18xx_t *chip, unsigned char reg, | 299 | static inline int snd_es18xx_mixer_bits(struct snd_es18xx *chip, unsigned char reg, |
302 | unsigned char mask, unsigned char val) | 300 | unsigned char mask, unsigned char val) |
303 | { | 301 | { |
304 | unsigned char old, new, oval; | 302 | unsigned char old, new, oval; |
@@ -319,7 +317,7 @@ static inline int snd_es18xx_mixer_bits(es18xx_t *chip, unsigned char reg, | |||
319 | return oval; | 317 | return oval; |
320 | } | 318 | } |
321 | 319 | ||
322 | static inline int snd_es18xx_mixer_writable(es18xx_t *chip, unsigned char reg, | 320 | static inline int snd_es18xx_mixer_writable(struct snd_es18xx *chip, unsigned char reg, |
323 | unsigned char mask) | 321 | unsigned char mask) |
324 | { | 322 | { |
325 | int old, expected, new; | 323 | int old, expected, new; |
@@ -339,7 +337,7 @@ static inline int snd_es18xx_mixer_writable(es18xx_t *chip, unsigned char reg, | |||
339 | } | 337 | } |
340 | 338 | ||
341 | 339 | ||
342 | static int snd_es18xx_reset(es18xx_t *chip) | 340 | static int snd_es18xx_reset(struct snd_es18xx *chip) |
343 | { | 341 | { |
344 | int i; | 342 | int i; |
345 | outb(0x03, chip->port + 0x06); | 343 | outb(0x03, chip->port + 0x06); |
@@ -351,7 +349,7 @@ static int snd_es18xx_reset(es18xx_t *chip) | |||
351 | return 0; | 349 | return 0; |
352 | } | 350 | } |
353 | 351 | ||
354 | static int snd_es18xx_reset_fifo(es18xx_t *chip) | 352 | static int snd_es18xx_reset_fifo(struct snd_es18xx *chip) |
355 | { | 353 | { |
356 | outb(0x02, chip->port + 0x06); | 354 | outb(0x02, chip->port + 0x06); |
357 | inb(chip->port + 0x06); | 355 | inb(chip->port + 0x06); |
@@ -359,7 +357,7 @@ static int snd_es18xx_reset_fifo(es18xx_t *chip) | |||
359 | return 0; | 357 | return 0; |
360 | } | 358 | } |
361 | 359 | ||
362 | static ratnum_t new_clocks[2] = { | 360 | static struct snd_ratnum new_clocks[2] = { |
363 | { | 361 | { |
364 | .num = 793800, | 362 | .num = 793800, |
365 | .den_min = 1, | 363 | .den_min = 1, |
@@ -374,12 +372,12 @@ static ratnum_t new_clocks[2] = { | |||
374 | } | 372 | } |
375 | }; | 373 | }; |
376 | 374 | ||
377 | static snd_pcm_hw_constraint_ratnums_t new_hw_constraints_clocks = { | 375 | static struct snd_pcm_hw_constraint_ratnums new_hw_constraints_clocks = { |
378 | .nrats = 2, | 376 | .nrats = 2, |
379 | .rats = new_clocks, | 377 | .rats = new_clocks, |
380 | }; | 378 | }; |
381 | 379 | ||
382 | static ratnum_t old_clocks[2] = { | 380 | static struct snd_ratnum old_clocks[2] = { |
383 | { | 381 | { |
384 | .num = 795444, | 382 | .num = 795444, |
385 | .den_min = 1, | 383 | .den_min = 1, |
@@ -394,18 +392,18 @@ static ratnum_t old_clocks[2] = { | |||
394 | } | 392 | } |
395 | }; | 393 | }; |
396 | 394 | ||
397 | static snd_pcm_hw_constraint_ratnums_t old_hw_constraints_clocks = { | 395 | static struct snd_pcm_hw_constraint_ratnums old_hw_constraints_clocks = { |
398 | .nrats = 2, | 396 | .nrats = 2, |
399 | .rats = old_clocks, | 397 | .rats = old_clocks, |
400 | }; | 398 | }; |
401 | 399 | ||
402 | 400 | ||
403 | static void snd_es18xx_rate_set(es18xx_t *chip, | 401 | static void snd_es18xx_rate_set(struct snd_es18xx *chip, |
404 | snd_pcm_substream_t *substream, | 402 | struct snd_pcm_substream *substream, |
405 | int mode) | 403 | int mode) |
406 | { | 404 | { |
407 | unsigned int bits, div0; | 405 | unsigned int bits, div0; |
408 | snd_pcm_runtime_t *runtime = substream->runtime; | 406 | struct snd_pcm_runtime *runtime = substream->runtime; |
409 | if (chip->caps & ES18XX_NEW_RATE) { | 407 | if (chip->caps & ES18XX_NEW_RATE) { |
410 | if (runtime->rate_num == new_clocks[0].num) | 408 | if (runtime->rate_num == new_clocks[0].num) |
411 | bits = 128 - runtime->rate_den; | 409 | bits = 128 - runtime->rate_den; |
@@ -435,10 +433,10 @@ static void snd_es18xx_rate_set(es18xx_t *chip, | |||
435 | } | 433 | } |
436 | } | 434 | } |
437 | 435 | ||
438 | static int snd_es18xx_playback_hw_params(snd_pcm_substream_t * substream, | 436 | static int snd_es18xx_playback_hw_params(struct snd_pcm_substream *substream, |
439 | snd_pcm_hw_params_t * hw_params) | 437 | struct snd_pcm_hw_params *hw_params) |
440 | { | 438 | { |
441 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 439 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
442 | int shift, err; | 440 | int shift, err; |
443 | 441 | ||
444 | shift = 0; | 442 | shift = 0; |
@@ -463,15 +461,15 @@ static int snd_es18xx_playback_hw_params(snd_pcm_substream_t * substream, | |||
463 | return 0; | 461 | return 0; |
464 | } | 462 | } |
465 | 463 | ||
466 | static int snd_es18xx_pcm_hw_free(snd_pcm_substream_t * substream) | 464 | static int snd_es18xx_pcm_hw_free(struct snd_pcm_substream *substream) |
467 | { | 465 | { |
468 | return snd_pcm_lib_free_pages(substream); | 466 | return snd_pcm_lib_free_pages(substream); |
469 | } | 467 | } |
470 | 468 | ||
471 | static int snd_es18xx_playback1_prepare(es18xx_t *chip, | 469 | static int snd_es18xx_playback1_prepare(struct snd_es18xx *chip, |
472 | snd_pcm_substream_t *substream) | 470 | struct snd_pcm_substream *substream) |
473 | { | 471 | { |
474 | snd_pcm_runtime_t *runtime = substream->runtime; | 472 | struct snd_pcm_runtime *runtime = substream->runtime; |
475 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); | 473 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); |
476 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 474 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
477 | 475 | ||
@@ -496,8 +494,8 @@ static int snd_es18xx_playback1_prepare(es18xx_t *chip, | |||
496 | return 0; | 494 | return 0; |
497 | } | 495 | } |
498 | 496 | ||
499 | static int snd_es18xx_playback1_trigger(es18xx_t *chip, | 497 | static int snd_es18xx_playback1_trigger(struct snd_es18xx *chip, |
500 | snd_pcm_substream_t * substream, | 498 | struct snd_pcm_substream *substream, |
501 | int cmd) | 499 | int cmd) |
502 | { | 500 | { |
503 | switch (cmd) { | 501 | switch (cmd) { |
@@ -546,10 +544,10 @@ static int snd_es18xx_playback1_trigger(es18xx_t *chip, | |||
546 | return 0; | 544 | return 0; |
547 | } | 545 | } |
548 | 546 | ||
549 | static int snd_es18xx_capture_hw_params(snd_pcm_substream_t * substream, | 547 | static int snd_es18xx_capture_hw_params(struct snd_pcm_substream *substream, |
550 | snd_pcm_hw_params_t * hw_params) | 548 | struct snd_pcm_hw_params *hw_params) |
551 | { | 549 | { |
552 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 550 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
553 | int shift, err; | 551 | int shift, err; |
554 | 552 | ||
555 | shift = 0; | 553 | shift = 0; |
@@ -569,10 +567,10 @@ static int snd_es18xx_capture_hw_params(snd_pcm_substream_t * substream, | |||
569 | return 0; | 567 | return 0; |
570 | } | 568 | } |
571 | 569 | ||
572 | static int snd_es18xx_capture_prepare(snd_pcm_substream_t *substream) | 570 | static int snd_es18xx_capture_prepare(struct snd_pcm_substream *substream) |
573 | { | 571 | { |
574 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 572 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
575 | snd_pcm_runtime_t *runtime = substream->runtime; | 573 | struct snd_pcm_runtime *runtime = substream->runtime; |
576 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); | 574 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); |
577 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 575 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
578 | 576 | ||
@@ -608,10 +606,10 @@ static int snd_es18xx_capture_prepare(snd_pcm_substream_t *substream) | |||
608 | return 0; | 606 | return 0; |
609 | } | 607 | } |
610 | 608 | ||
611 | static int snd_es18xx_capture_trigger(snd_pcm_substream_t *substream, | 609 | static int snd_es18xx_capture_trigger(struct snd_pcm_substream *substream, |
612 | int cmd) | 610 | int cmd) |
613 | { | 611 | { |
614 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 612 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
615 | 613 | ||
616 | switch (cmd) { | 614 | switch (cmd) { |
617 | case SNDRV_PCM_TRIGGER_START: | 615 | case SNDRV_PCM_TRIGGER_START: |
@@ -637,10 +635,10 @@ static int snd_es18xx_capture_trigger(snd_pcm_substream_t *substream, | |||
637 | return 0; | 635 | return 0; |
638 | } | 636 | } |
639 | 637 | ||
640 | static int snd_es18xx_playback2_prepare(es18xx_t *chip, | 638 | static int snd_es18xx_playback2_prepare(struct snd_es18xx *chip, |
641 | snd_pcm_substream_t *substream) | 639 | struct snd_pcm_substream *substream) |
642 | { | 640 | { |
643 | snd_pcm_runtime_t *runtime = substream->runtime; | 641 | struct snd_pcm_runtime *runtime = substream->runtime; |
644 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); | 642 | unsigned int size = snd_pcm_lib_buffer_bytes(substream); |
645 | unsigned int count = snd_pcm_lib_period_bytes(substream); | 643 | unsigned int count = snd_pcm_lib_period_bytes(substream); |
646 | 644 | ||
@@ -674,8 +672,8 @@ static int snd_es18xx_playback2_prepare(es18xx_t *chip, | |||
674 | return 0; | 672 | return 0; |
675 | } | 673 | } |
676 | 674 | ||
677 | static int snd_es18xx_playback2_trigger(es18xx_t *chip, | 675 | static int snd_es18xx_playback2_trigger(struct snd_es18xx *chip, |
678 | snd_pcm_substream_t *substream, | 676 | struct snd_pcm_substream *substream, |
679 | int cmd) | 677 | int cmd) |
680 | { | 678 | { |
681 | switch (cmd) { | 679 | switch (cmd) { |
@@ -714,19 +712,19 @@ static int snd_es18xx_playback2_trigger(es18xx_t *chip, | |||
714 | return 0; | 712 | return 0; |
715 | } | 713 | } |
716 | 714 | ||
717 | static int snd_es18xx_playback_prepare(snd_pcm_substream_t *substream) | 715 | static int snd_es18xx_playback_prepare(struct snd_pcm_substream *substream) |
718 | { | 716 | { |
719 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 717 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
720 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) | 718 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) |
721 | return snd_es18xx_playback1_prepare(chip, substream); | 719 | return snd_es18xx_playback1_prepare(chip, substream); |
722 | else | 720 | else |
723 | return snd_es18xx_playback2_prepare(chip, substream); | 721 | return snd_es18xx_playback2_prepare(chip, substream); |
724 | } | 722 | } |
725 | 723 | ||
726 | static int snd_es18xx_playback_trigger(snd_pcm_substream_t *substream, | 724 | static int snd_es18xx_playback_trigger(struct snd_pcm_substream *substream, |
727 | int cmd) | 725 | int cmd) |
728 | { | 726 | { |
729 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 727 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
730 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) | 728 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) |
731 | return snd_es18xx_playback1_trigger(chip, substream, cmd); | 729 | return snd_es18xx_playback1_trigger(chip, substream, cmd); |
732 | else | 730 | else |
@@ -735,7 +733,7 @@ static int snd_es18xx_playback_trigger(snd_pcm_substream_t *substream, | |||
735 | 733 | ||
736 | static irqreturn_t snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 734 | static irqreturn_t snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
737 | { | 735 | { |
738 | es18xx_t *chip = dev_id; | 736 | struct snd_es18xx *chip = dev_id; |
739 | unsigned char status; | 737 | unsigned char status; |
740 | 738 | ||
741 | if (chip->caps & ES18XX_CONTROL) { | 739 | if (chip->caps & ES18XX_CONTROL) { |
@@ -795,9 +793,9 @@ static irqreturn_t snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *r | |||
795 | return IRQ_HANDLED; | 793 | return IRQ_HANDLED; |
796 | } | 794 | } |
797 | 795 | ||
798 | static snd_pcm_uframes_t snd_es18xx_playback_pointer(snd_pcm_substream_t * substream) | 796 | static snd_pcm_uframes_t snd_es18xx_playback_pointer(struct snd_pcm_substream *substream) |
799 | { | 797 | { |
800 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 798 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
801 | int pos; | 799 | int pos; |
802 | 800 | ||
803 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { | 801 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { |
@@ -813,9 +811,9 @@ static snd_pcm_uframes_t snd_es18xx_playback_pointer(snd_pcm_substream_t * subst | |||
813 | } | 811 | } |
814 | } | 812 | } |
815 | 813 | ||
816 | static snd_pcm_uframes_t snd_es18xx_capture_pointer(snd_pcm_substream_t * substream) | 814 | static snd_pcm_uframes_t snd_es18xx_capture_pointer(struct snd_pcm_substream *substream) |
817 | { | 815 | { |
818 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 816 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
819 | int pos; | 817 | int pos; |
820 | 818 | ||
821 | if (!(chip->active & ADC1)) | 819 | if (!(chip->active & ADC1)) |
@@ -824,7 +822,7 @@ static snd_pcm_uframes_t snd_es18xx_capture_pointer(snd_pcm_substream_t * substr | |||
824 | return pos >> chip->dma1_shift; | 822 | return pos >> chip->dma1_shift; |
825 | } | 823 | } |
826 | 824 | ||
827 | static snd_pcm_hardware_t snd_es18xx_playback = | 825 | static struct snd_pcm_hardware snd_es18xx_playback = |
828 | { | 826 | { |
829 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 827 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
830 | SNDRV_PCM_INFO_RESUME | | 828 | SNDRV_PCM_INFO_RESUME | |
@@ -844,7 +842,7 @@ static snd_pcm_hardware_t snd_es18xx_playback = | |||
844 | .fifo_size = 0, | 842 | .fifo_size = 0, |
845 | }; | 843 | }; |
846 | 844 | ||
847 | static snd_pcm_hardware_t snd_es18xx_capture = | 845 | static struct snd_pcm_hardware snd_es18xx_capture = |
848 | { | 846 | { |
849 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 847 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
850 | SNDRV_PCM_INFO_RESUME | | 848 | SNDRV_PCM_INFO_RESUME | |
@@ -864,10 +862,10 @@ static snd_pcm_hardware_t snd_es18xx_capture = | |||
864 | .fifo_size = 0, | 862 | .fifo_size = 0, |
865 | }; | 863 | }; |
866 | 864 | ||
867 | static int snd_es18xx_playback_open(snd_pcm_substream_t * substream) | 865 | static int snd_es18xx_playback_open(struct snd_pcm_substream *substream) |
868 | { | 866 | { |
869 | snd_pcm_runtime_t *runtime = substream->runtime; | 867 | struct snd_pcm_runtime *runtime = substream->runtime; |
870 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 868 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
871 | 869 | ||
872 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { | 870 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { |
873 | if ((chip->caps & ES18XX_DUPLEX_MONO) && | 871 | if ((chip->caps & ES18XX_DUPLEX_MONO) && |
@@ -889,10 +887,10 @@ static int snd_es18xx_playback_open(snd_pcm_substream_t * substream) | |||
889 | return 0; | 887 | return 0; |
890 | } | 888 | } |
891 | 889 | ||
892 | static int snd_es18xx_capture_open(snd_pcm_substream_t * substream) | 890 | static int snd_es18xx_capture_open(struct snd_pcm_substream *substream) |
893 | { | 891 | { |
894 | snd_pcm_runtime_t *runtime = substream->runtime; | 892 | struct snd_pcm_runtime *runtime = substream->runtime; |
895 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 893 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
896 | 894 | ||
897 | if (chip->playback_b_substream) | 895 | if (chip->playback_b_substream) |
898 | return -EAGAIN; | 896 | return -EAGAIN; |
@@ -907,9 +905,9 @@ static int snd_es18xx_capture_open(snd_pcm_substream_t * substream) | |||
907 | return 0; | 905 | return 0; |
908 | } | 906 | } |
909 | 907 | ||
910 | static int snd_es18xx_playback_close(snd_pcm_substream_t * substream) | 908 | static int snd_es18xx_playback_close(struct snd_pcm_substream *substream) |
911 | { | 909 | { |
912 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 910 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
913 | 911 | ||
914 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) | 912 | if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) |
915 | chip->playback_a_substream = NULL; | 913 | chip->playback_a_substream = NULL; |
@@ -920,9 +918,9 @@ static int snd_es18xx_playback_close(snd_pcm_substream_t * substream) | |||
920 | return 0; | 918 | return 0; |
921 | } | 919 | } |
922 | 920 | ||
923 | static int snd_es18xx_capture_close(snd_pcm_substream_t * substream) | 921 | static int snd_es18xx_capture_close(struct snd_pcm_substream *substream) |
924 | { | 922 | { |
925 | es18xx_t *chip = snd_pcm_substream_chip(substream); | 923 | struct snd_es18xx *chip = snd_pcm_substream_chip(substream); |
926 | 924 | ||
927 | chip->capture_a_substream = NULL; | 925 | chip->capture_a_substream = NULL; |
928 | snd_pcm_lib_free_pages(substream); | 926 | snd_pcm_lib_free_pages(substream); |
@@ -933,7 +931,7 @@ static int snd_es18xx_capture_close(snd_pcm_substream_t * substream) | |||
933 | * MIXER part | 931 | * MIXER part |
934 | */ | 932 | */ |
935 | 933 | ||
936 | static int snd_es18xx_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 934 | static int snd_es18xx_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
937 | { | 935 | { |
938 | static char *texts[8] = { | 936 | static char *texts[8] = { |
939 | "Mic", "Mic Master", "CD", "AOUT", | 937 | "Mic", "Mic Master", "CD", "AOUT", |
@@ -949,16 +947,16 @@ static int snd_es18xx_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * u | |||
949 | return 0; | 947 | return 0; |
950 | } | 948 | } |
951 | 949 | ||
952 | static int snd_es18xx_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 950 | static int snd_es18xx_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
953 | { | 951 | { |
954 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 952 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
955 | ucontrol->value.enumerated.item[0] = snd_es18xx_mixer_read(chip, 0x1c) & 0x07; | 953 | ucontrol->value.enumerated.item[0] = snd_es18xx_mixer_read(chip, 0x1c) & 0x07; |
956 | return 0; | 954 | return 0; |
957 | } | 955 | } |
958 | 956 | ||
959 | static int snd_es18xx_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 957 | static int snd_es18xx_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
960 | { | 958 | { |
961 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 959 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
962 | unsigned char val = ucontrol->value.enumerated.item[0]; | 960 | unsigned char val = ucontrol->value.enumerated.item[0]; |
963 | 961 | ||
964 | if (val > 7) | 962 | if (val > 7) |
@@ -966,7 +964,7 @@ static int snd_es18xx_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
966 | return snd_es18xx_mixer_bits(chip, 0x1c, 0x07, val) != val; | 964 | return snd_es18xx_mixer_bits(chip, 0x1c, 0x07, val) != val; |
967 | } | 965 | } |
968 | 966 | ||
969 | static int snd_es18xx_info_spatializer_enable(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 967 | static int snd_es18xx_info_spatializer_enable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
970 | { | 968 | { |
971 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 969 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
972 | uinfo->count = 1; | 970 | uinfo->count = 1; |
@@ -975,17 +973,17 @@ static int snd_es18xx_info_spatializer_enable(snd_kcontrol_t *kcontrol, snd_ctl_ | |||
975 | return 0; | 973 | return 0; |
976 | } | 974 | } |
977 | 975 | ||
978 | static int snd_es18xx_get_spatializer_enable(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 976 | static int snd_es18xx_get_spatializer_enable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
979 | { | 977 | { |
980 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 978 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
981 | unsigned char val = snd_es18xx_mixer_read(chip, 0x50); | 979 | unsigned char val = snd_es18xx_mixer_read(chip, 0x50); |
982 | ucontrol->value.integer.value[0] = !!(val & 8); | 980 | ucontrol->value.integer.value[0] = !!(val & 8); |
983 | return 0; | 981 | return 0; |
984 | } | 982 | } |
985 | 983 | ||
986 | static int snd_es18xx_put_spatializer_enable(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 984 | static int snd_es18xx_put_spatializer_enable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
987 | { | 985 | { |
988 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 986 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
989 | unsigned char oval, nval; | 987 | unsigned char oval, nval; |
990 | int change; | 988 | int change; |
991 | nval = ucontrol->value.integer.value[0] ? 0x0c : 0x04; | 989 | nval = ucontrol->value.integer.value[0] ? 0x0c : 0x04; |
@@ -998,7 +996,7 @@ static int snd_es18xx_put_spatializer_enable(snd_kcontrol_t * kcontrol, snd_ctl_ | |||
998 | return change; | 996 | return change; |
999 | } | 997 | } |
1000 | 998 | ||
1001 | static int snd_es18xx_info_hw_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 999 | static int snd_es18xx_info_hw_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1002 | { | 1000 | { |
1003 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 1001 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
1004 | uinfo->count = 2; | 1002 | uinfo->count = 2; |
@@ -1007,15 +1005,15 @@ static int snd_es18xx_info_hw_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info | |||
1007 | return 0; | 1005 | return 0; |
1008 | } | 1006 | } |
1009 | 1007 | ||
1010 | static int snd_es18xx_get_hw_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1008 | static int snd_es18xx_get_hw_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1011 | { | 1009 | { |
1012 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1010 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1013 | ucontrol->value.integer.value[0] = snd_es18xx_mixer_read(chip, 0x61) & 0x3f; | 1011 | ucontrol->value.integer.value[0] = snd_es18xx_mixer_read(chip, 0x61) & 0x3f; |
1014 | ucontrol->value.integer.value[1] = snd_es18xx_mixer_read(chip, 0x63) & 0x3f; | 1012 | ucontrol->value.integer.value[1] = snd_es18xx_mixer_read(chip, 0x63) & 0x3f; |
1015 | return 0; | 1013 | return 0; |
1016 | } | 1014 | } |
1017 | 1015 | ||
1018 | static int snd_es18xx_info_hw_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1016 | static int snd_es18xx_info_hw_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1019 | { | 1017 | { |
1020 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1018 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1021 | uinfo->count = 2; | 1019 | uinfo->count = 2; |
@@ -1024,24 +1022,24 @@ static int snd_es18xx_info_hw_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_info | |||
1024 | return 0; | 1022 | return 0; |
1025 | } | 1023 | } |
1026 | 1024 | ||
1027 | static int snd_es18xx_get_hw_switch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1025 | static int snd_es18xx_get_hw_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1028 | { | 1026 | { |
1029 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1027 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1030 | ucontrol->value.integer.value[0] = !(snd_es18xx_mixer_read(chip, 0x61) & 0x40); | 1028 | ucontrol->value.integer.value[0] = !(snd_es18xx_mixer_read(chip, 0x61) & 0x40); |
1031 | ucontrol->value.integer.value[1] = !(snd_es18xx_mixer_read(chip, 0x63) & 0x40); | 1029 | ucontrol->value.integer.value[1] = !(snd_es18xx_mixer_read(chip, 0x63) & 0x40); |
1032 | return 0; | 1030 | return 0; |
1033 | } | 1031 | } |
1034 | 1032 | ||
1035 | static void snd_es18xx_hwv_free(snd_kcontrol_t *kcontrol) | 1033 | static void snd_es18xx_hwv_free(struct snd_kcontrol *kcontrol) |
1036 | { | 1034 | { |
1037 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1035 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1038 | chip->master_volume = NULL; | 1036 | chip->master_volume = NULL; |
1039 | chip->master_switch = NULL; | 1037 | chip->master_switch = NULL; |
1040 | chip->hw_volume = NULL; | 1038 | chip->hw_volume = NULL; |
1041 | chip->hw_switch = NULL; | 1039 | chip->hw_switch = NULL; |
1042 | } | 1040 | } |
1043 | 1041 | ||
1044 | static int snd_es18xx_reg_bits(es18xx_t *chip, unsigned char reg, | 1042 | static int snd_es18xx_reg_bits(struct snd_es18xx *chip, unsigned char reg, |
1045 | unsigned char mask, unsigned char val) | 1043 | unsigned char mask, unsigned char val) |
1046 | { | 1044 | { |
1047 | if (reg < 0xa0) | 1045 | if (reg < 0xa0) |
@@ -1050,7 +1048,7 @@ static int snd_es18xx_reg_bits(es18xx_t *chip, unsigned char reg, | |||
1050 | return snd_es18xx_bits(chip, reg, mask, val); | 1048 | return snd_es18xx_bits(chip, reg, mask, val); |
1051 | } | 1049 | } |
1052 | 1050 | ||
1053 | static int snd_es18xx_reg_read(es18xx_t *chip, unsigned char reg) | 1051 | static int snd_es18xx_reg_read(struct snd_es18xx *chip, unsigned char reg) |
1054 | { | 1052 | { |
1055 | if (reg < 0xa0) | 1053 | if (reg < 0xa0) |
1056 | return snd_es18xx_mixer_read(chip, reg); | 1054 | return snd_es18xx_mixer_read(chip, reg); |
@@ -1064,7 +1062,7 @@ static int snd_es18xx_reg_read(es18xx_t *chip, unsigned char reg) | |||
1064 | .get = snd_es18xx_get_single, .put = snd_es18xx_put_single, \ | 1062 | .get = snd_es18xx_get_single, .put = snd_es18xx_put_single, \ |
1065 | .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } | 1063 | .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } |
1066 | 1064 | ||
1067 | static int snd_es18xx_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1065 | static int snd_es18xx_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1068 | { | 1066 | { |
1069 | int mask = (kcontrol->private_value >> 16) & 0xff; | 1067 | int mask = (kcontrol->private_value >> 16) & 0xff; |
1070 | 1068 | ||
@@ -1075,9 +1073,9 @@ static int snd_es18xx_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1075 | return 0; | 1073 | return 0; |
1076 | } | 1074 | } |
1077 | 1075 | ||
1078 | static int snd_es18xx_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1076 | static int snd_es18xx_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1079 | { | 1077 | { |
1080 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1078 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1081 | int reg = kcontrol->private_value & 0xff; | 1079 | int reg = kcontrol->private_value & 0xff; |
1082 | int shift = (kcontrol->private_value >> 8) & 0xff; | 1080 | int shift = (kcontrol->private_value >> 8) & 0xff; |
1083 | int mask = (kcontrol->private_value >> 16) & 0xff; | 1081 | int mask = (kcontrol->private_value >> 16) & 0xff; |
@@ -1091,9 +1089,9 @@ static int snd_es18xx_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1091 | return 0; | 1089 | return 0; |
1092 | } | 1090 | } |
1093 | 1091 | ||
1094 | static int snd_es18xx_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1092 | static int snd_es18xx_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1095 | { | 1093 | { |
1096 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1094 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1097 | int reg = kcontrol->private_value & 0xff; | 1095 | int reg = kcontrol->private_value & 0xff; |
1098 | int shift = (kcontrol->private_value >> 8) & 0xff; | 1096 | int shift = (kcontrol->private_value >> 8) & 0xff; |
1099 | int mask = (kcontrol->private_value >> 16) & 0xff; | 1097 | int mask = (kcontrol->private_value >> 16) & 0xff; |
@@ -1114,7 +1112,7 @@ static int snd_es18xx_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1114 | .get = snd_es18xx_get_double, .put = snd_es18xx_put_double, \ | 1112 | .get = snd_es18xx_get_double, .put = snd_es18xx_put_double, \ |
1115 | .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } | 1113 | .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } |
1116 | 1114 | ||
1117 | static int snd_es18xx_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1115 | static int snd_es18xx_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1118 | { | 1116 | { |
1119 | int mask = (kcontrol->private_value >> 24) & 0xff; | 1117 | int mask = (kcontrol->private_value >> 24) & 0xff; |
1120 | 1118 | ||
@@ -1125,9 +1123,9 @@ static int snd_es18xx_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1125 | return 0; | 1123 | return 0; |
1126 | } | 1124 | } |
1127 | 1125 | ||
1128 | static int snd_es18xx_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1126 | static int snd_es18xx_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1129 | { | 1127 | { |
1130 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1128 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1131 | int left_reg = kcontrol->private_value & 0xff; | 1129 | int left_reg = kcontrol->private_value & 0xff; |
1132 | int right_reg = (kcontrol->private_value >> 8) & 0xff; | 1130 | int right_reg = (kcontrol->private_value >> 8) & 0xff; |
1133 | int shift_left = (kcontrol->private_value >> 16) & 0x07; | 1131 | int shift_left = (kcontrol->private_value >> 16) & 0x07; |
@@ -1150,9 +1148,9 @@ static int snd_es18xx_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1150 | return 0; | 1148 | return 0; |
1151 | } | 1149 | } |
1152 | 1150 | ||
1153 | static int snd_es18xx_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1151 | static int snd_es18xx_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1154 | { | 1152 | { |
1155 | es18xx_t *chip = snd_kcontrol_chip(kcontrol); | 1153 | struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); |
1156 | int left_reg = kcontrol->private_value & 0xff; | 1154 | int left_reg = kcontrol->private_value & 0xff; |
1157 | int right_reg = (kcontrol->private_value >> 8) & 0xff; | 1155 | int right_reg = (kcontrol->private_value >> 8) & 0xff; |
1158 | int shift_left = (kcontrol->private_value >> 16) & 0x07; | 1156 | int shift_left = (kcontrol->private_value >> 16) & 0x07; |
@@ -1185,7 +1183,7 @@ static int snd_es18xx_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1185 | return change; | 1183 | return change; |
1186 | } | 1184 | } |
1187 | 1185 | ||
1188 | static snd_kcontrol_new_t snd_es18xx_base_controls[] = { | 1186 | static struct snd_kcontrol_new snd_es18xx_base_controls[] = { |
1189 | ES18XX_DOUBLE("Master Playback Volume", 0, 0x60, 0x62, 0, 0, 63, 0), | 1187 | ES18XX_DOUBLE("Master Playback Volume", 0, 0x60, 0x62, 0, 0, 63, 0), |
1190 | ES18XX_DOUBLE("Master Playback Switch", 0, 0x60, 0x62, 6, 6, 1, 1), | 1188 | ES18XX_DOUBLE("Master Playback Switch", 0, 0x60, 0x62, 6, 6, 1, 1), |
1191 | ES18XX_DOUBLE("Line Playback Volume", 0, 0x3e, 0x3e, 4, 0, 15, 0), | 1189 | ES18XX_DOUBLE("Line Playback Volume", 0, 0x3e, 0x3e, 4, 0, 15, 0), |
@@ -1207,10 +1205,10 @@ ES18XX_SINGLE("Capture Switch", 0, 0x1c, 4, 1, 1), | |||
1207 | } | 1205 | } |
1208 | }; | 1206 | }; |
1209 | 1207 | ||
1210 | static snd_kcontrol_new_t snd_es18xx_mono_in_control = | 1208 | static struct snd_kcontrol_new snd_es18xx_mono_in_control = |
1211 | ES18XX_DOUBLE("Mono Input Playback Volume", 0, 0x6d, 0x6d, 4, 0, 15, 0); | 1209 | ES18XX_DOUBLE("Mono Input Playback Volume", 0, 0x6d, 0x6d, 4, 0, 15, 0); |
1212 | 1210 | ||
1213 | static snd_kcontrol_new_t snd_es18xx_recmix_controls[] = { | 1211 | static struct snd_kcontrol_new snd_es18xx_recmix_controls[] = { |
1214 | ES18XX_DOUBLE("PCM Capture Volume", 0, 0x69, 0x69, 4, 0, 15, 0), | 1212 | ES18XX_DOUBLE("PCM Capture Volume", 0, 0x69, 0x69, 4, 0, 15, 0), |
1215 | ES18XX_DOUBLE("Mic Capture Volume", 0, 0x68, 0x68, 4, 0, 15, 0), | 1213 | ES18XX_DOUBLE("Mic Capture Volume", 0, 0x68, 0x68, 4, 0, 15, 0), |
1216 | ES18XX_DOUBLE("Line Capture Volume", 0, 0x6e, 0x6e, 4, 0, 15, 0), | 1214 | ES18XX_DOUBLE("Line Capture Volume", 0, 0x6e, 0x6e, 4, 0, 15, 0), |
@@ -1220,16 +1218,16 @@ ES18XX_DOUBLE("CD Capture Volume", 0, 0x6a, 0x6a, 4, 0, 15, 0), | |||
1220 | ES18XX_DOUBLE("Aux Capture Volume", 0, 0x6c, 0x6c, 4, 0, 15, 0) | 1218 | ES18XX_DOUBLE("Aux Capture Volume", 0, 0x6c, 0x6c, 4, 0, 15, 0) |
1221 | }; | 1219 | }; |
1222 | 1220 | ||
1223 | static snd_kcontrol_new_t snd_es18xx_pcm1_controls[] = { | 1221 | static struct snd_kcontrol_new snd_es18xx_pcm1_controls[] = { |
1224 | ES18XX_DOUBLE("PCM Playback Volume", 0, 0x14, 0x14, 4, 0, 15, 0), | 1222 | ES18XX_DOUBLE("PCM Playback Volume", 0, 0x14, 0x14, 4, 0, 15, 0), |
1225 | }; | 1223 | }; |
1226 | 1224 | ||
1227 | static snd_kcontrol_new_t snd_es18xx_pcm2_controls[] = { | 1225 | static struct snd_kcontrol_new snd_es18xx_pcm2_controls[] = { |
1228 | ES18XX_DOUBLE("PCM Playback Volume", 0, 0x7c, 0x7c, 4, 0, 15, 0), | 1226 | ES18XX_DOUBLE("PCM Playback Volume", 0, 0x7c, 0x7c, 4, 0, 15, 0), |
1229 | ES18XX_DOUBLE("PCM Playback Volume", 1, 0x14, 0x14, 4, 0, 15, 0) | 1227 | ES18XX_DOUBLE("PCM Playback Volume", 1, 0x14, 0x14, 4, 0, 15, 0) |
1230 | }; | 1228 | }; |
1231 | 1229 | ||
1232 | static snd_kcontrol_new_t snd_es18xx_spatializer_controls[] = { | 1230 | static struct snd_kcontrol_new snd_es18xx_spatializer_controls[] = { |
1233 | ES18XX_SINGLE("3D Control - Level", 0, 0x52, 0, 63, 0), | 1231 | ES18XX_SINGLE("3D Control - Level", 0, 0x52, 0, 63, 0), |
1234 | { | 1232 | { |
1235 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1233 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -1240,13 +1238,13 @@ ES18XX_SINGLE("3D Control - Level", 0, 0x52, 0, 63, 0), | |||
1240 | } | 1238 | } |
1241 | }; | 1239 | }; |
1242 | 1240 | ||
1243 | static snd_kcontrol_new_t snd_es18xx_micpre1_control = | 1241 | static struct snd_kcontrol_new snd_es18xx_micpre1_control = |
1244 | ES18XX_SINGLE("Mic Boost (+26dB)", 0, 0xa9, 2, 1, 0); | 1242 | ES18XX_SINGLE("Mic Boost (+26dB)", 0, 0xa9, 2, 1, 0); |
1245 | 1243 | ||
1246 | static snd_kcontrol_new_t snd_es18xx_micpre2_control = | 1244 | static struct snd_kcontrol_new snd_es18xx_micpre2_control = |
1247 | ES18XX_SINGLE("Mic Boost (+26dB)", 0, 0x7d, 3, 1, 0); | 1245 | ES18XX_SINGLE("Mic Boost (+26dB)", 0, 0x7d, 3, 1, 0); |
1248 | 1246 | ||
1249 | static snd_kcontrol_new_t snd_es18xx_hw_volume_controls[] = { | 1247 | static struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { |
1250 | { | 1248 | { |
1251 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1249 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1252 | .name = "Hardware Master Playback Volume", | 1250 | .name = "Hardware Master Playback Volume", |
@@ -1265,7 +1263,7 @@ ES18XX_SINGLE("Hardware Master Volume Split", 0, 0x64, 7, 1, 0), | |||
1265 | }; | 1263 | }; |
1266 | 1264 | ||
1267 | #if 0 | 1265 | #if 0 |
1268 | static int __devinit snd_es18xx_config_read(es18xx_t *chip, unsigned char reg) | 1266 | static int __devinit snd_es18xx_config_read(struct snd_es18xx *chip, unsigned char reg) |
1269 | { | 1267 | { |
1270 | int data; | 1268 | int data; |
1271 | unsigned long flags; | 1269 | unsigned long flags; |
@@ -1277,7 +1275,7 @@ static int __devinit snd_es18xx_config_read(es18xx_t *chip, unsigned char reg) | |||
1277 | } | 1275 | } |
1278 | #endif | 1276 | #endif |
1279 | 1277 | ||
1280 | static void __devinit snd_es18xx_config_write(es18xx_t *chip, | 1278 | static void __devinit snd_es18xx_config_write(struct snd_es18xx *chip, |
1281 | unsigned char reg, unsigned char data) | 1279 | unsigned char reg, unsigned char data) |
1282 | { | 1280 | { |
1283 | /* No need for spinlocks, this function is used only in | 1281 | /* No need for spinlocks, this function is used only in |
@@ -1289,7 +1287,7 @@ static void __devinit snd_es18xx_config_write(es18xx_t *chip, | |||
1289 | #endif | 1287 | #endif |
1290 | } | 1288 | } |
1291 | 1289 | ||
1292 | static int __devinit snd_es18xx_initialize(es18xx_t *chip) | 1290 | static int __devinit snd_es18xx_initialize(struct snd_es18xx *chip) |
1293 | { | 1291 | { |
1294 | int mask = 0; | 1292 | int mask = 0; |
1295 | 1293 | ||
@@ -1438,7 +1436,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip) | |||
1438 | return 0; | 1436 | return 0; |
1439 | } | 1437 | } |
1440 | 1438 | ||
1441 | static int __devinit snd_es18xx_identify(es18xx_t *chip) | 1439 | static int __devinit snd_es18xx_identify(struct snd_es18xx *chip) |
1442 | { | 1440 | { |
1443 | int hi,lo; | 1441 | int hi,lo; |
1444 | 1442 | ||
@@ -1504,7 +1502,7 @@ static int __devinit snd_es18xx_identify(es18xx_t *chip) | |||
1504 | return 0; | 1502 | return 0; |
1505 | } | 1503 | } |
1506 | 1504 | ||
1507 | static int __devinit snd_es18xx_probe(es18xx_t *chip) | 1505 | static int __devinit snd_es18xx_probe(struct snd_es18xx *chip) |
1508 | { | 1506 | { |
1509 | if (snd_es18xx_identify(chip) < 0) { | 1507 | if (snd_es18xx_identify(chip) < 0) { |
1510 | snd_printk(KERN_ERR PFX "[0x%lx] ESS chip not found\n", chip->port); | 1508 | snd_printk(KERN_ERR PFX "[0x%lx] ESS chip not found\n", chip->port); |
@@ -1544,7 +1542,7 @@ static int __devinit snd_es18xx_probe(es18xx_t *chip) | |||
1544 | return snd_es18xx_initialize(chip); | 1542 | return snd_es18xx_initialize(chip); |
1545 | } | 1543 | } |
1546 | 1544 | ||
1547 | static snd_pcm_ops_t snd_es18xx_playback_ops = { | 1545 | static struct snd_pcm_ops snd_es18xx_playback_ops = { |
1548 | .open = snd_es18xx_playback_open, | 1546 | .open = snd_es18xx_playback_open, |
1549 | .close = snd_es18xx_playback_close, | 1547 | .close = snd_es18xx_playback_close, |
1550 | .ioctl = snd_pcm_lib_ioctl, | 1548 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1555,7 +1553,7 @@ static snd_pcm_ops_t snd_es18xx_playback_ops = { | |||
1555 | .pointer = snd_es18xx_playback_pointer, | 1553 | .pointer = snd_es18xx_playback_pointer, |
1556 | }; | 1554 | }; |
1557 | 1555 | ||
1558 | static snd_pcm_ops_t snd_es18xx_capture_ops = { | 1556 | static struct snd_pcm_ops snd_es18xx_capture_ops = { |
1559 | .open = snd_es18xx_capture_open, | 1557 | .open = snd_es18xx_capture_open, |
1560 | .close = snd_es18xx_capture_close, | 1558 | .close = snd_es18xx_capture_close, |
1561 | .ioctl = snd_pcm_lib_ioctl, | 1559 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1566,9 +1564,9 @@ static snd_pcm_ops_t snd_es18xx_capture_ops = { | |||
1566 | .pointer = snd_es18xx_capture_pointer, | 1564 | .pointer = snd_es18xx_capture_pointer, |
1567 | }; | 1565 | }; |
1568 | 1566 | ||
1569 | static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm) | 1567 | static int __devinit snd_es18xx_pcm(struct snd_es18xx *chip, int device, struct snd_pcm ** rpcm) |
1570 | { | 1568 | { |
1571 | snd_pcm_t *pcm; | 1569 | struct snd_pcm *pcm; |
1572 | char str[16]; | 1570 | char str[16]; |
1573 | int err; | 1571 | int err; |
1574 | 1572 | ||
@@ -1608,9 +1606,9 @@ static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpc | |||
1608 | 1606 | ||
1609 | /* Power Management support functions */ | 1607 | /* Power Management support functions */ |
1610 | #ifdef CONFIG_PM | 1608 | #ifdef CONFIG_PM |
1611 | static int snd_es18xx_suspend(snd_card_t *card, pm_message_t state) | 1609 | static int snd_es18xx_suspend(struct snd_card *card, pm_message_t state) |
1612 | { | 1610 | { |
1613 | es18xx_t *chip = card->pm_private_data; | 1611 | struct snd_es18xx *chip = card->pm_private_data; |
1614 | 1612 | ||
1615 | snd_pcm_suspend_all(chip->pcm); | 1613 | snd_pcm_suspend_all(chip->pcm); |
1616 | 1614 | ||
@@ -1623,9 +1621,9 @@ static int snd_es18xx_suspend(snd_card_t *card, pm_message_t state) | |||
1623 | return 0; | 1621 | return 0; |
1624 | } | 1622 | } |
1625 | 1623 | ||
1626 | static int snd_es18xx_resume(snd_card_t *card) | 1624 | static int snd_es18xx_resume(struct snd_card *card) |
1627 | { | 1625 | { |
1628 | es18xx_t *chip = card->pm_private_data; | 1626 | struct snd_es18xx *chip = card->pm_private_data; |
1629 | 1627 | ||
1630 | /* restore PM register, we won't wake till (not 0x07) i/o activity though */ | 1628 | /* restore PM register, we won't wake till (not 0x07) i/o activity though */ |
1631 | snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_FM); | 1629 | snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_FM); |
@@ -1634,7 +1632,7 @@ static int snd_es18xx_resume(snd_card_t *card) | |||
1634 | } | 1632 | } |
1635 | #endif /* CONFIG_PM */ | 1633 | #endif /* CONFIG_PM */ |
1636 | 1634 | ||
1637 | static int snd_es18xx_free(es18xx_t *chip) | 1635 | static int snd_es18xx_free(struct snd_es18xx *chip) |
1638 | { | 1636 | { |
1639 | release_and_free_resource(chip->res_port); | 1637 | release_and_free_resource(chip->res_port); |
1640 | release_and_free_resource(chip->res_ctrl_port); | 1638 | release_and_free_resource(chip->res_ctrl_port); |
@@ -1653,21 +1651,21 @@ static int snd_es18xx_free(es18xx_t *chip) | |||
1653 | return 0; | 1651 | return 0; |
1654 | } | 1652 | } |
1655 | 1653 | ||
1656 | static int snd_es18xx_dev_free(snd_device_t *device) | 1654 | static int snd_es18xx_dev_free(struct snd_device *device) |
1657 | { | 1655 | { |
1658 | es18xx_t *chip = device->device_data; | 1656 | struct snd_es18xx *chip = device->device_data; |
1659 | return snd_es18xx_free(chip); | 1657 | return snd_es18xx_free(chip); |
1660 | } | 1658 | } |
1661 | 1659 | ||
1662 | static int __devinit snd_es18xx_new_device(snd_card_t * card, | 1660 | static int __devinit snd_es18xx_new_device(struct snd_card *card, |
1663 | unsigned long port, | 1661 | unsigned long port, |
1664 | unsigned long mpu_port, | 1662 | unsigned long mpu_port, |
1665 | unsigned long fm_port, | 1663 | unsigned long fm_port, |
1666 | int irq, int dma1, int dma2, | 1664 | int irq, int dma1, int dma2, |
1667 | es18xx_t ** rchip) | 1665 | struct snd_es18xx ** rchip) |
1668 | { | 1666 | { |
1669 | es18xx_t *chip; | 1667 | struct snd_es18xx *chip; |
1670 | static snd_device_ops_t ops = { | 1668 | static struct snd_device_ops ops = { |
1671 | .dev_free = snd_es18xx_dev_free, | 1669 | .dev_free = snd_es18xx_dev_free, |
1672 | }; | 1670 | }; |
1673 | int err; | 1671 | int err; |
@@ -1728,9 +1726,9 @@ static int __devinit snd_es18xx_new_device(snd_card_t * card, | |||
1728 | return 0; | 1726 | return 0; |
1729 | } | 1727 | } |
1730 | 1728 | ||
1731 | static int __devinit snd_es18xx_mixer(es18xx_t *chip) | 1729 | static int __devinit snd_es18xx_mixer(struct snd_es18xx *chip) |
1732 | { | 1730 | { |
1733 | snd_card_t *card; | 1731 | struct snd_card *card; |
1734 | int err; | 1732 | int err; |
1735 | unsigned int idx; | 1733 | unsigned int idx; |
1736 | 1734 | ||
@@ -1739,7 +1737,7 @@ static int __devinit snd_es18xx_mixer(es18xx_t *chip) | |||
1739 | strcpy(card->mixername, chip->pcm->name); | 1737 | strcpy(card->mixername, chip->pcm->name); |
1740 | 1738 | ||
1741 | for (idx = 0; idx < ARRAY_SIZE(snd_es18xx_base_controls); idx++) { | 1739 | for (idx = 0; idx < ARRAY_SIZE(snd_es18xx_base_controls); idx++) { |
1742 | snd_kcontrol_t *kctl; | 1740 | struct snd_kcontrol *kctl; |
1743 | kctl = snd_ctl_new1(&snd_es18xx_base_controls[idx], chip); | 1741 | kctl = snd_ctl_new1(&snd_es18xx_base_controls[idx], chip); |
1744 | if (chip->caps & ES18XX_HWV) { | 1742 | if (chip->caps & ES18XX_HWV) { |
1745 | switch (idx) { | 1743 | switch (idx) { |
@@ -1797,7 +1795,7 @@ static int __devinit snd_es18xx_mixer(es18xx_t *chip) | |||
1797 | } | 1795 | } |
1798 | if (chip->caps & ES18XX_HWV) { | 1796 | if (chip->caps & ES18XX_HWV) { |
1799 | for (idx = 0; idx < ARRAY_SIZE(snd_es18xx_hw_volume_controls); idx++) { | 1797 | for (idx = 0; idx < ARRAY_SIZE(snd_es18xx_hw_volume_controls); idx++) { |
1800 | snd_kcontrol_t *kctl; | 1798 | struct snd_kcontrol *kctl; |
1801 | kctl = snd_ctl_new1(&snd_es18xx_hw_volume_controls[idx], chip); | 1799 | kctl = snd_ctl_new1(&snd_es18xx_hw_volume_controls[idx], chip); |
1802 | if (idx == 0) | 1800 | if (idx == 0) |
1803 | chip->hw_volume = kctl; | 1801 | chip->hw_volume = kctl; |
@@ -1874,7 +1872,7 @@ struct snd_audiodrive { | |||
1874 | #endif | 1872 | #endif |
1875 | }; | 1873 | }; |
1876 | 1874 | ||
1877 | static snd_card_t *snd_audiodrive_legacy[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | 1875 | static struct snd_card *snd_audiodrive_legacy[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; |
1878 | 1876 | ||
1879 | #ifdef CONFIG_PNP | 1877 | #ifdef CONFIG_PNP |
1880 | 1878 | ||
@@ -1987,10 +1985,10 @@ static int __devinit snd_audiodrive_probe(int dev, struct pnp_card_link *pcard, | |||
1987 | static int possible_irqs[] = {5, 9, 10, 7, 11, 12, -1}; | 1985 | static int possible_irqs[] = {5, 9, 10, 7, 11, 12, -1}; |
1988 | static int possible_dmas[] = {1, 0, 3, 5, -1}; | 1986 | static int possible_dmas[] = {1, 0, 3, 5, -1}; |
1989 | int xirq, xdma1, xdma2; | 1987 | int xirq, xdma1, xdma2; |
1990 | snd_card_t *card; | 1988 | struct snd_card *card; |
1991 | struct snd_audiodrive *acard; | 1989 | struct snd_audiodrive *acard; |
1992 | es18xx_t *chip; | 1990 | struct snd_es18xx *chip; |
1993 | opl3_t *opl3; | 1991 | struct snd_opl3 *opl3; |
1994 | int err; | 1992 | int err; |
1995 | 1993 | ||
1996 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 1994 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, |
@@ -2139,7 +2137,7 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_card_link *card, | |||
2139 | 2137 | ||
2140 | static void __devexit snd_audiodrive_pnp_remove(struct pnp_card_link * pcard) | 2138 | static void __devexit snd_audiodrive_pnp_remove(struct pnp_card_link * pcard) |
2141 | { | 2139 | { |
2142 | snd_card_t *card = (snd_card_t *) pnp_get_card_drvdata(pcard); | 2140 | struct snd_card *card = (struct snd_card *) pnp_get_card_drvdata(pcard); |
2143 | 2141 | ||
2144 | snd_card_disconnect(card); | 2142 | snd_card_disconnect(card); |
2145 | snd_card_free_in_thread(card); | 2143 | snd_card_free_in_thread(card); |