aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:21:36 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:18:12 -0500
commitee42381e71c56328db9e9d64d19a4de7a2f09a93 (patch)
tree641cdecfa64347efb7d402c707412e0a45fe7ced /sound/pci
parentdc4cafbadad1ae2322e598f2cb72720ef4095fee (diff)
[ALSA] Remove xxx_t typedefs: AC97
Modules: AC97 Codec Remove xxx_t typedefs from the AC97 codec support. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/ac97/ac97_bus.c2
-rw-r--r--sound/pci/ac97/ac97_codec.c313
-rw-r--r--sound/pci/ac97/ac97_local.h45
-rw-r--r--sound/pci/ac97/ac97_patch.c408
-rw-r--r--sound/pci/ac97/ac97_patch.h74
-rw-r--r--sound/pci/ac97/ac97_pcm.c38
-rw-r--r--sound/pci/ac97/ac97_proc.c33
7 files changed, 457 insertions, 456 deletions
diff --git a/sound/pci/ac97/ac97_bus.c b/sound/pci/ac97/ac97_bus.c
index ec70fadde7d9..66de2c2f1554 100644
--- a/sound/pci/ac97/ac97_bus.c
+++ b/sound/pci/ac97/ac97_bus.c
@@ -18,7 +18,7 @@
18 18
19/* 19/*
20 * Let drivers decide whether they want to support given codec from their 20 * Let drivers decide whether they want to support given codec from their
21 * probe method. Drivers have direct access to the ac97_t structure and may 21 * probe method. Drivers have direct access to the struct snd_ac97 structure and may
22 * decide based on the id field amongst other things. 22 * decide based on the id field amongst other things.
23 */ 23 */
24static int ac97_bus_match(struct device *dev, struct device_driver *drv) 24static int ac97_bus_match(struct device *dev, struct device_driver *drv)
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 9bde76c4c6a2..bdb6a8cc0ae6 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -50,16 +50,16 @@ MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
50 50
51 */ 51 */
52 52
53typedef struct { 53struct ac97_codec_id {
54 unsigned int id; 54 unsigned int id;
55 unsigned int mask; 55 unsigned int mask;
56 const char *name; 56 const char *name;
57 int (*patch)(ac97_t *ac97); 57 int (*patch)(struct snd_ac97 *ac97);
58 int (*mpatch)(ac97_t *ac97); 58 int (*mpatch)(struct snd_ac97 *ac97);
59 unsigned int flags; 59 unsigned int flags;
60} ac97_codec_id_t; 60};
61 61
62static const ac97_codec_id_t snd_ac97_codec_id_vendors[] = { 62static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {
63{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL }, 63{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },
64{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL }, 64{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL },
65{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL }, 65{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL },
@@ -86,7 +86,7 @@ static const ac97_codec_id_t snd_ac97_codec_id_vendors[] = {
86{ 0, 0, NULL, NULL, NULL } 86{ 0, 0, NULL, NULL, NULL }
87}; 87};
88 88
89static const ac97_codec_id_t snd_ac97_codec_ids[] = { 89static const struct ac97_codec_id snd_ac97_codec_ids[] = {
90{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL }, 90{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },
91{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL }, 91{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },
92{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL }, 92{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },
@@ -225,7 +225,7 @@ const char *snd_ac97_stereo_enhancements[] =
225 * I/O routines 225 * I/O routines
226 */ 226 */
227 227
228static int snd_ac97_valid_reg(ac97_t *ac97, unsigned short reg) 228static int snd_ac97_valid_reg(struct snd_ac97 *ac97, unsigned short reg)
229{ 229{
230 if (ac97->limited_regs && ! test_bit(reg, ac97->reg_accessed)) 230 if (ac97->limited_regs && ! test_bit(reg, ac97->reg_accessed))
231 return 0; 231 return 0;
@@ -278,7 +278,7 @@ static int snd_ac97_valid_reg(ac97_t *ac97, unsigned short reg)
278 * #snd_ca97_write_cache(), so use this only when you don't want to 278 * #snd_ca97_write_cache(), so use this only when you don't want to
279 * reflect the change to the suspend/resume state. 279 * reflect the change to the suspend/resume state.
280 */ 280 */
281void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value) 281void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
282{ 282{
283 if (!snd_ac97_valid_reg(ac97, reg)) 283 if (!snd_ac97_valid_reg(ac97, reg))
284 return; 284 return;
@@ -301,7 +301,7 @@ void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value)
301 * 301 *
302 * Returns the read value. 302 * Returns the read value.
303 */ 303 */
304unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg) 304unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
305{ 305{
306 if (!snd_ac97_valid_reg(ac97, reg)) 306 if (!snd_ac97_valid_reg(ac97, reg))
307 return 0; 307 return 0;
@@ -309,7 +309,7 @@ unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg)
309} 309}
310 310
311/* read a register - return the cached value if already read */ 311/* read a register - return the cached value if already read */
312static inline unsigned short snd_ac97_read_cache(ac97_t *ac97, unsigned short reg) 312static inline unsigned short snd_ac97_read_cache(struct snd_ac97 *ac97, unsigned short reg)
313{ 313{
314 if (! test_bit(reg, ac97->reg_accessed)) { 314 if (! test_bit(reg, ac97->reg_accessed)) {
315 ac97->regs[reg] = ac97->bus->ops->read(ac97, reg); 315 ac97->regs[reg] = ac97->bus->ops->read(ac97, reg);
@@ -328,7 +328,7 @@ static inline unsigned short snd_ac97_read_cache(ac97_t *ac97, unsigned short re
328 * cache. The cached values are used for the cached-read and the 328 * cache. The cached values are used for the cached-read and the
329 * suspend/resume. 329 * suspend/resume.
330 */ 330 */
331void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value) 331void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
332{ 332{
333 if (!snd_ac97_valid_reg(ac97, reg)) 333 if (!snd_ac97_valid_reg(ac97, reg))
334 return; 334 return;
@@ -351,7 +351,7 @@ void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value
351 * Returns 1 if the value is changed, 0 if no change, or a negative 351 * Returns 1 if the value is changed, 0 if no change, or a negative
352 * code on failure. 352 * code on failure.
353 */ 353 */
354int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value) 354int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
355{ 355{
356 int change; 356 int change;
357 357
@@ -381,7 +381,7 @@ int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value)
381 * Returns 1 if the bits are changed, 0 if no change, or a negative 381 * Returns 1 if the bits are changed, 0 if no change, or a negative
382 * code on failure. 382 * code on failure.
383 */ 383 */
384int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value) 384int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value)
385{ 385{
386 int change; 386 int change;
387 387
@@ -394,7 +394,7 @@ int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask,
394} 394}
395 395
396/* no lock version - see snd_ac97_updat_bits() */ 396/* no lock version - see snd_ac97_updat_bits() */
397int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg, 397int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg,
398 unsigned short mask, unsigned short value) 398 unsigned short mask, unsigned short value)
399{ 399{
400 int change; 400 int change;
@@ -411,7 +411,7 @@ int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg,
411 return change; 411 return change;
412} 412}
413 413
414static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned short mask, unsigned short value) 414static int snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 *ac97, int codec, unsigned short mask, unsigned short value)
415{ 415{
416 int change; 416 int change;
417 unsigned short old, new, cfg; 417 unsigned short old, new, cfg;
@@ -443,7 +443,7 @@ static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned sho
443 * Controls 443 * Controls
444 */ 444 */
445 445
446int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 446int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
447{ 447{
448 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; 448 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
449 449
@@ -457,9 +457,9 @@ int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * ui
457 return 0; 457 return 0;
458} 458}
459 459
460int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 460int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
461{ 461{
462 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 462 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
463 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; 463 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
464 unsigned short val, bitmask; 464 unsigned short val, bitmask;
465 465
@@ -473,9 +473,9 @@ int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * u
473 return 0; 473 return 0;
474} 474}
475 475
476int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 476int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
477{ 477{
478 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 478 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
479 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; 479 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
480 unsigned short val; 480 unsigned short val;
481 unsigned short mask, bitmask; 481 unsigned short mask, bitmask;
@@ -496,7 +496,7 @@ int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * u
496} 496}
497 497
498/* save/restore ac97 v2.3 paging */ 498/* save/restore ac97 v2.3 paging */
499static int snd_ac97_page_save(ac97_t *ac97, int reg, snd_kcontrol_t *kcontrol) 499static int snd_ac97_page_save(struct snd_ac97 *ac97, int reg, struct snd_kcontrol *kcontrol)
500{ 500{
501 int page_save = -1; 501 int page_save = -1;
502 if ((kcontrol->private_value & (1<<25)) && 502 if ((kcontrol->private_value & (1<<25)) &&
@@ -510,7 +510,7 @@ static int snd_ac97_page_save(ac97_t *ac97, int reg, snd_kcontrol_t *kcontrol)
510 return page_save; 510 return page_save;
511} 511}
512 512
513static void snd_ac97_page_restore(ac97_t *ac97, int page_save) 513static void snd_ac97_page_restore(struct snd_ac97 *ac97, int page_save)
514{ 514{
515 if (page_save >= 0) { 515 if (page_save >= 0) {
516 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save); 516 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save);
@@ -519,7 +519,7 @@ static void snd_ac97_page_restore(ac97_t *ac97, int page_save)
519} 519}
520 520
521/* volume and switch controls */ 521/* volume and switch controls */
522int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 522int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
523{ 523{
524 int mask = (kcontrol->private_value >> 16) & 0xff; 524 int mask = (kcontrol->private_value >> 16) & 0xff;
525 int shift = (kcontrol->private_value >> 8) & 0x0f; 525 int shift = (kcontrol->private_value >> 8) & 0x0f;
@@ -532,9 +532,9 @@ int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
532 return 0; 532 return 0;
533} 533}
534 534
535int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 535int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
536{ 536{
537 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 537 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
538 int reg = kcontrol->private_value & 0xff; 538 int reg = kcontrol->private_value & 0xff;
539 int shift = (kcontrol->private_value >> 8) & 0x0f; 539 int shift = (kcontrol->private_value >> 8) & 0x0f;
540 int rshift = (kcontrol->private_value >> 12) & 0x0f; 540 int rshift = (kcontrol->private_value >> 12) & 0x0f;
@@ -555,9 +555,9 @@ int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontro
555 return 0; 555 return 0;
556} 556}
557 557
558int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 558int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
559{ 559{
560 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 560 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
561 int reg = kcontrol->private_value & 0xff; 561 int reg = kcontrol->private_value & 0xff;
562 int shift = (kcontrol->private_value >> 8) & 0x0f; 562 int shift = (kcontrol->private_value >> 8) & 0x0f;
563 int rshift = (kcontrol->private_value >> 12) & 0x0f; 563 int rshift = (kcontrol->private_value >> 12) & 0x0f;
@@ -584,22 +584,22 @@ int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontro
584 return err; 584 return err;
585} 585}
586 586
587static const snd_kcontrol_new_t snd_ac97_controls_master_mono[2] = { 587static const struct snd_kcontrol_new snd_ac97_controls_master_mono[2] = {
588AC97_SINGLE("Master Mono Playback Switch", AC97_MASTER_MONO, 15, 1, 1), 588AC97_SINGLE("Master Mono Playback Switch", AC97_MASTER_MONO, 15, 1, 1),
589AC97_SINGLE("Master Mono Playback Volume", AC97_MASTER_MONO, 0, 31, 1) 589AC97_SINGLE("Master Mono Playback Volume", AC97_MASTER_MONO, 0, 31, 1)
590}; 590};
591 591
592static const snd_kcontrol_new_t snd_ac97_controls_tone[2] = { 592static const struct snd_kcontrol_new snd_ac97_controls_tone[2] = {
593AC97_SINGLE("Tone Control - Bass", AC97_MASTER_TONE, 8, 15, 1), 593AC97_SINGLE("Tone Control - Bass", AC97_MASTER_TONE, 8, 15, 1),
594AC97_SINGLE("Tone Control - Treble", AC97_MASTER_TONE, 0, 15, 1) 594AC97_SINGLE("Tone Control - Treble", AC97_MASTER_TONE, 0, 15, 1)
595}; 595};
596 596
597static const snd_kcontrol_new_t snd_ac97_controls_pc_beep[2] = { 597static const struct snd_kcontrol_new snd_ac97_controls_pc_beep[2] = {
598AC97_SINGLE("PC Speaker Playback Switch", AC97_PC_BEEP, 15, 1, 1), 598AC97_SINGLE("PC Speaker Playback Switch", AC97_PC_BEEP, 15, 1, 1),
599AC97_SINGLE("PC Speaker Playback Volume", AC97_PC_BEEP, 1, 15, 1) 599AC97_SINGLE("PC Speaker Playback Volume", AC97_PC_BEEP, 1, 15, 1)
600}; 600};
601 601
602static const snd_kcontrol_new_t snd_ac97_controls_mic_boost = 602static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
603 AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0); 603 AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
604 604
605 605
@@ -615,18 +615,18 @@ AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 9, 2, std_mix),
615AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, std_mic), 615AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, std_mic),
616}; 616};
617 617
618static const snd_kcontrol_new_t snd_ac97_control_capture_src = 618static const struct snd_kcontrol_new snd_ac97_control_capture_src =
619AC97_ENUM("Capture Source", std_enum[0]); 619AC97_ENUM("Capture Source", std_enum[0]);
620 620
621static const snd_kcontrol_new_t snd_ac97_control_capture_vol = 621static const struct snd_kcontrol_new snd_ac97_control_capture_vol =
622AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0); 622AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0);
623 623
624static const snd_kcontrol_new_t snd_ac97_controls_mic_capture[2] = { 624static const struct snd_kcontrol_new snd_ac97_controls_mic_capture[2] = {
625AC97_SINGLE("Mic Capture Switch", AC97_REC_GAIN_MIC, 15, 1, 1), 625AC97_SINGLE("Mic Capture Switch", AC97_REC_GAIN_MIC, 15, 1, 1),
626AC97_SINGLE("Mic Capture Volume", AC97_REC_GAIN_MIC, 0, 15, 0) 626AC97_SINGLE("Mic Capture Volume", AC97_REC_GAIN_MIC, 0, 15, 0)
627}; 627};
628 628
629typedef enum { 629enum {
630 AC97_GENERAL_PCM_OUT = 0, 630 AC97_GENERAL_PCM_OUT = 0,
631 AC97_GENERAL_STEREO_ENHANCEMENT, 631 AC97_GENERAL_STEREO_ENHANCEMENT,
632 AC97_GENERAL_3D, 632 AC97_GENERAL_3D,
@@ -634,9 +634,9 @@ typedef enum {
634 AC97_GENERAL_MONO, 634 AC97_GENERAL_MONO,
635 AC97_GENERAL_MIC, 635 AC97_GENERAL_MIC,
636 AC97_GENERAL_LOOPBACK 636 AC97_GENERAL_LOOPBACK
637} ac97_general_index_t; 637};
638 638
639static const snd_kcontrol_new_t snd_ac97_controls_general[7] = { 639static const struct snd_kcontrol_new snd_ac97_controls_general[7] = {
640AC97_ENUM("PCM Out Path & Mute", std_enum[1]), 640AC97_ENUM("PCM Out Path & Mute", std_enum[1]),
641AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0), 641AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0),
642AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0), 642AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0),
@@ -646,45 +646,45 @@ AC97_ENUM("Mic Select", std_enum[3]),
646AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0) 646AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0)
647}; 647};
648 648
649const snd_kcontrol_new_t snd_ac97_controls_3d[2] = { 649const struct snd_kcontrol_new snd_ac97_controls_3d[2] = {
650AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0), 650AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0),
651AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0) 651AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0)
652}; 652};
653 653
654static const snd_kcontrol_new_t snd_ac97_controls_center[2] = { 654static const struct snd_kcontrol_new snd_ac97_controls_center[2] = {
655AC97_SINGLE("Center Playback Switch", AC97_CENTER_LFE_MASTER, 7, 1, 1), 655AC97_SINGLE("Center Playback Switch", AC97_CENTER_LFE_MASTER, 7, 1, 1),
656AC97_SINGLE("Center Playback Volume", AC97_CENTER_LFE_MASTER, 0, 31, 1) 656AC97_SINGLE("Center Playback Volume", AC97_CENTER_LFE_MASTER, 0, 31, 1)
657}; 657};
658 658
659static const snd_kcontrol_new_t snd_ac97_controls_lfe[2] = { 659static const struct snd_kcontrol_new snd_ac97_controls_lfe[2] = {
660AC97_SINGLE("LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 1, 1), 660AC97_SINGLE("LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 1, 1),
661AC97_SINGLE("LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 31, 1) 661AC97_SINGLE("LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 31, 1)
662}; 662};
663 663
664static const snd_kcontrol_new_t snd_ac97_control_eapd = 664static const struct snd_kcontrol_new snd_ac97_control_eapd =
665AC97_SINGLE("External Amplifier", AC97_POWERDOWN, 15, 1, 1); 665AC97_SINGLE("External Amplifier", AC97_POWERDOWN, 15, 1, 1);
666 666
667static const snd_kcontrol_new_t snd_ac97_controls_modem_switches[2] = { 667static const struct snd_kcontrol_new snd_ac97_controls_modem_switches[2] = {
668AC97_SINGLE("Off-hook Switch", AC97_GPIO_STATUS, 0, 1, 0), 668AC97_SINGLE("Off-hook Switch", AC97_GPIO_STATUS, 0, 1, 0),
669AC97_SINGLE("Caller ID Switch", AC97_GPIO_STATUS, 2, 1, 0) 669AC97_SINGLE("Caller ID Switch", AC97_GPIO_STATUS, 2, 1, 0)
670}; 670};
671 671
672/* change the existing EAPD control as inverted */ 672/* change the existing EAPD control as inverted */
673static void set_inv_eapd(ac97_t *ac97, snd_kcontrol_t *kctl) 673static void set_inv_eapd(struct snd_ac97 *ac97, struct snd_kcontrol *kctl)
674{ 674{
675 kctl->private_value = AC97_SINGLE_VALUE(AC97_POWERDOWN, 15, 1, 0); 675 kctl->private_value = AC97_SINGLE_VALUE(AC97_POWERDOWN, 15, 1, 0);
676 snd_ac97_update_bits(ac97, AC97_POWERDOWN, (1<<15), (1<<15)); /* EAPD up */ 676 snd_ac97_update_bits(ac97, AC97_POWERDOWN, (1<<15), (1<<15)); /* EAPD up */
677 ac97->scaps |= AC97_SCAP_INV_EAPD; 677 ac97->scaps |= AC97_SCAP_INV_EAPD;
678} 678}
679 679
680static int snd_ac97_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 680static int snd_ac97_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
681{ 681{
682 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 682 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
683 uinfo->count = 1; 683 uinfo->count = 1;
684 return 0; 684 return 0;
685} 685}
686 686
687static int snd_ac97_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol) 687static int snd_ac97_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
688{ 688{
689 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL | 689 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
690 IEC958_AES0_NONAUDIO | 690 IEC958_AES0_NONAUDIO |
@@ -696,7 +696,7 @@ static int snd_ac97_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value
696 return 0; 696 return 0;
697} 697}
698 698
699static int snd_ac97_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol) 699static int snd_ac97_spdif_pmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
700{ 700{
701 /* FIXME: AC'97 spec doesn't say which bits are used for what */ 701 /* FIXME: AC'97 spec doesn't say which bits are used for what */
702 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL | 702 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
@@ -706,9 +706,9 @@ static int snd_ac97_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value
706 return 0; 706 return 0;
707} 707}
708 708
709static int snd_ac97_spdif_default_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol) 709static int snd_ac97_spdif_default_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
710{ 710{
711 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 711 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
712 712
713 down(&ac97->reg_mutex); 713 down(&ac97->reg_mutex);
714 ucontrol->value.iec958.status[0] = ac97->spdif_status & 0xff; 714 ucontrol->value.iec958.status[0] = ac97->spdif_status & 0xff;
@@ -719,9 +719,9 @@ static int snd_ac97_spdif_default_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
719 return 0; 719 return 0;
720} 720}
721 721
722static int snd_ac97_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol) 722static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
723{ 723{
724 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 724 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
725 unsigned int new = 0; 725 unsigned int new = 0;
726 unsigned short val = 0; 726 unsigned short val = 0;
727 int change; 727 int change;
@@ -787,9 +787,9 @@ static int snd_ac97_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
787 return change; 787 return change;
788} 788}
789 789
790static int snd_ac97_put_spsa(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 790static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
791{ 791{
792 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 792 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
793 int reg = kcontrol->private_value & 0xff; 793 int reg = kcontrol->private_value & 0xff;
794 int shift = (kcontrol->private_value >> 8) & 0xff; 794 int shift = (kcontrol->private_value >> 8) & 0xff;
795 int mask = (kcontrol->private_value >> 16) & 0xff; 795 int mask = (kcontrol->private_value >> 16) & 0xff;
@@ -817,7 +817,7 @@ static int snd_ac97_put_spsa(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
817 return change; 817 return change;
818} 818}
819 819
820const snd_kcontrol_new_t snd_ac97_controls_spdif[5] = { 820const struct snd_kcontrol_new snd_ac97_controls_spdif[5] = {
821 { 821 {
822 .access = SNDRV_CTL_ELEM_ACCESS_READ, 822 .access = SNDRV_CTL_ELEM_ACCESS_READ,
823 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 823 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -856,9 +856,9 @@ const snd_kcontrol_new_t snd_ac97_controls_spdif[5] = {
856 .get = snd_ac97_ad18xx_pcm_get_bits, .put = snd_ac97_ad18xx_pcm_put_bits, \ 856 .get = snd_ac97_ad18xx_pcm_get_bits, .put = snd_ac97_ad18xx_pcm_put_bits, \
857 .private_value = (codec) | ((lshift) << 8) | ((rshift) << 12) | ((mask) << 16) } 857 .private_value = (codec) | ((lshift) << 8) | ((rshift) << 12) | ((mask) << 16) }
858 858
859static int snd_ac97_ad18xx_pcm_info_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 859static int snd_ac97_ad18xx_pcm_info_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
860{ 860{
861 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 861 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
862 int mask = (kcontrol->private_value >> 16) & 0x0f; 862 int mask = (kcontrol->private_value >> 16) & 0x0f;
863 int lshift = (kcontrol->private_value >> 8) & 0x0f; 863 int lshift = (kcontrol->private_value >> 8) & 0x0f;
864 int rshift = (kcontrol->private_value >> 12) & 0x0f; 864 int rshift = (kcontrol->private_value >> 12) & 0x0f;
@@ -873,9 +873,9 @@ static int snd_ac97_ad18xx_pcm_info_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_
873 return 0; 873 return 0;
874} 874}
875 875
876static int snd_ac97_ad18xx_pcm_get_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 876static int snd_ac97_ad18xx_pcm_get_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
877{ 877{
878 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 878 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
879 int codec = kcontrol->private_value & 3; 879 int codec = kcontrol->private_value & 3;
880 int lshift = (kcontrol->private_value >> 8) & 0x0f; 880 int lshift = (kcontrol->private_value >> 8) & 0x0f;
881 int rshift = (kcontrol->private_value >> 12) & 0x0f; 881 int rshift = (kcontrol->private_value >> 12) & 0x0f;
@@ -887,9 +887,9 @@ static int snd_ac97_ad18xx_pcm_get_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_
887 return 0; 887 return 0;
888} 888}
889 889
890static int snd_ac97_ad18xx_pcm_put_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 890static int snd_ac97_ad18xx_pcm_put_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
891{ 891{
892 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 892 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
893 int codec = kcontrol->private_value & 3; 893 int codec = kcontrol->private_value & 3;
894 int lshift = (kcontrol->private_value >> 8) & 0x0f; 894 int lshift = (kcontrol->private_value >> 8) & 0x0f;
895 int rshift = (kcontrol->private_value >> 12) & 0x0f; 895 int rshift = (kcontrol->private_value >> 12) & 0x0f;
@@ -910,7 +910,7 @@ static int snd_ac97_ad18xx_pcm_put_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_
910 .get = snd_ac97_ad18xx_pcm_get_volume, .put = snd_ac97_ad18xx_pcm_put_volume, \ 910 .get = snd_ac97_ad18xx_pcm_get_volume, .put = snd_ac97_ad18xx_pcm_put_volume, \
911 .private_value = codec } 911 .private_value = codec }
912 912
913static int snd_ac97_ad18xx_pcm_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 913static int snd_ac97_ad18xx_pcm_info_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
914{ 914{
915 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 915 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
916 uinfo->count = 2; 916 uinfo->count = 2;
@@ -919,9 +919,9 @@ static int snd_ac97_ad18xx_pcm_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_ele
919 return 0; 919 return 0;
920} 920}
921 921
922static int snd_ac97_ad18xx_pcm_get_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 922static int snd_ac97_ad18xx_pcm_get_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
923{ 923{
924 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 924 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
925 int codec = kcontrol->private_value & 3; 925 int codec = kcontrol->private_value & 3;
926 926
927 down(&ac97->page_mutex); 927 down(&ac97->page_mutex);
@@ -931,9 +931,9 @@ static int snd_ac97_ad18xx_pcm_get_volume(snd_kcontrol_t * kcontrol, snd_ctl_ele
931 return 0; 931 return 0;
932} 932}
933 933
934static int snd_ac97_ad18xx_pcm_put_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 934static int snd_ac97_ad18xx_pcm_put_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
935{ 935{
936 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 936 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
937 int codec = kcontrol->private_value & 3; 937 int codec = kcontrol->private_value & 3;
938 unsigned short val1, val2; 938 unsigned short val1, val2;
939 939
@@ -942,22 +942,22 @@ static int snd_ac97_ad18xx_pcm_put_volume(snd_kcontrol_t * kcontrol, snd_ctl_ele
942 return snd_ac97_ad18xx_update_pcm_bits(ac97, codec, 0x1f1f, (val1 << 8) | val2); 942 return snd_ac97_ad18xx_update_pcm_bits(ac97, codec, 0x1f1f, (val1 << 8) | val2);
943} 943}
944 944
945static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_pcm[2] = { 945static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_pcm[2] = {
946AD18XX_PCM_BITS("PCM Playback Switch", 0, 15, 7, 1), 946AD18XX_PCM_BITS("PCM Playback Switch", 0, 15, 7, 1),
947AD18XX_PCM_VOLUME("PCM Playback Volume", 0) 947AD18XX_PCM_VOLUME("PCM Playback Volume", 0)
948}; 948};
949 949
950static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_surround[2] = { 950static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_surround[2] = {
951AD18XX_PCM_BITS("Surround Playback Switch", 1, 15, 7, 1), 951AD18XX_PCM_BITS("Surround Playback Switch", 1, 15, 7, 1),
952AD18XX_PCM_VOLUME("Surround Playback Volume", 1) 952AD18XX_PCM_VOLUME("Surround Playback Volume", 1)
953}; 953};
954 954
955static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_center[2] = { 955static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_center[2] = {
956AD18XX_PCM_BITS("Center Playback Switch", 2, 15, 15, 1), 956AD18XX_PCM_BITS("Center Playback Switch", 2, 15, 15, 1),
957AD18XX_PCM_BITS("Center Playback Volume", 2, 8, 8, 31) 957AD18XX_PCM_BITS("Center Playback Volume", 2, 8, 8, 31)
958}; 958};
959 959
960static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_lfe[2] = { 960static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_lfe[2] = {
961AD18XX_PCM_BITS("LFE Playback Switch", 2, 7, 7, 1), 961AD18XX_PCM_BITS("LFE Playback Switch", 2, 7, 7, 1),
962AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31) 962AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)
963}; 963};
@@ -966,9 +966,9 @@ AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)
966 * 966 *
967 */ 967 */
968 968
969static void snd_ac97_powerdown(ac97_t *ac97); 969static void snd_ac97_powerdown(struct snd_ac97 *ac97);
970 970
971static int snd_ac97_bus_free(ac97_bus_t *bus) 971static int snd_ac97_bus_free(struct snd_ac97_bus *bus)
972{ 972{
973 if (bus) { 973 if (bus) {
974 snd_ac97_bus_proc_done(bus); 974 snd_ac97_bus_proc_done(bus);
@@ -980,13 +980,13 @@ static int snd_ac97_bus_free(ac97_bus_t *bus)
980 return 0; 980 return 0;
981} 981}
982 982
983static int snd_ac97_bus_dev_free(snd_device_t *device) 983static int snd_ac97_bus_dev_free(struct snd_device *device)
984{ 984{
985 ac97_bus_t *bus = device->device_data; 985 struct snd_ac97_bus *bus = device->device_data;
986 return snd_ac97_bus_free(bus); 986 return snd_ac97_bus_free(bus);
987} 987}
988 988
989static int snd_ac97_free(ac97_t *ac97) 989static int snd_ac97_free(struct snd_ac97 *ac97)
990{ 990{
991 if (ac97) { 991 if (ac97) {
992 snd_ac97_proc_done(ac97); 992 snd_ac97_proc_done(ac97);
@@ -999,14 +999,14 @@ static int snd_ac97_free(ac97_t *ac97)
999 return 0; 999 return 0;
1000} 1000}
1001 1001
1002static int snd_ac97_dev_free(snd_device_t *device) 1002static int snd_ac97_dev_free(struct snd_device *device)
1003{ 1003{
1004 ac97_t *ac97 = device->device_data; 1004 struct snd_ac97 *ac97 = device->device_data;
1005 snd_ac97_powerdown(ac97); /* for avoiding click noises during shut down */ 1005 snd_ac97_powerdown(ac97); /* for avoiding click noises during shut down */
1006 return snd_ac97_free(ac97); 1006 return snd_ac97_free(ac97);
1007} 1007}
1008 1008
1009static int snd_ac97_try_volume_mix(ac97_t * ac97, int reg) 1009static int snd_ac97_try_volume_mix(struct snd_ac97 * ac97, int reg)
1010{ 1010{
1011 unsigned short val, mask = 0x8000; 1011 unsigned short val, mask = 0x8000;
1012 1012
@@ -1052,13 +1052,14 @@ static int snd_ac97_try_volume_mix(ac97_t * ac97, int reg)
1052 /* try another test */ 1052 /* try another test */
1053 snd_ac97_write_cache(ac97, reg, val | mask); 1053 snd_ac97_write_cache(ac97, reg, val | mask);
1054 val = snd_ac97_read(ac97, reg); 1054 val = snd_ac97_read(ac97, reg);
1055 val = snd_ac97_read(ac97, reg);
1055 if (!(val & mask)) 1056 if (!(val & mask))
1056 return 0; /* nothing here */ 1057 return 0; /* nothing here */
1057 } 1058 }
1058 return 1; /* success, useable */ 1059 return 1; /* success, useable */
1059} 1060}
1060 1061
1061static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max, unsigned char *hi_max) 1062static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned char *lo_max, unsigned char *hi_max)
1062{ 1063{
1063 unsigned short cbit[3] = { 0x20, 0x10, 0x01 }; 1064 unsigned short cbit[3] = { 0x20, 0x10, 0x01 };
1064 unsigned char max[3] = { 63, 31, 15 }; 1065 unsigned char max[3] = { 63, 31, 15 };
@@ -1083,7 +1084,7 @@ static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max
1083 } 1084 }
1084} 1085}
1085 1086
1086int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit) 1087int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit)
1087{ 1088{
1088 unsigned short mask, val, orig, res; 1089 unsigned short mask, val, orig, res;
1089 1090
@@ -1097,7 +1098,7 @@ int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit)
1097} 1098}
1098 1099
1099/* check the volume resolution of center/lfe */ 1100/* check the volume resolution of center/lfe */
1100static void snd_ac97_change_volume_params2(ac97_t * ac97, int reg, int shift, unsigned char *max) 1101static void snd_ac97_change_volume_params2(struct snd_ac97 * ac97, int reg, int shift, unsigned char *max)
1101{ 1102{
1102 unsigned short val, val1; 1103 unsigned short val, val1;
1103 1104
@@ -1123,9 +1124,9 @@ static inline int printable(unsigned int x)
1123 return x; 1124 return x;
1124} 1125}
1125 1126
1126snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97) 1127struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97)
1127{ 1128{
1128 snd_kcontrol_new_t template; 1129 struct snd_kcontrol_new template;
1129 memcpy(&template, _template, sizeof(template)); 1130 memcpy(&template, _template, sizeof(template));
1130 template.index = ac97->num; 1131 template.index = ac97->num;
1131 return snd_ctl_new1(&template, ac97); 1132 return snd_ctl_new1(&template, ac97);
@@ -1134,9 +1135,9 @@ snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97
1134/* 1135/*
1135 * create mute switch(es) for normal stereo controls 1136 * create mute switch(es) for normal stereo controls
1136 */ 1137 */
1137static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int check_stereo, ac97_t *ac97) 1138static int snd_ac97_cmute_new_stereo(struct snd_card *card, char *name, int reg, int check_stereo, struct snd_ac97 *ac97)
1138{ 1139{
1139 snd_kcontrol_t *kctl; 1140 struct snd_kcontrol *kctl;
1140 int err; 1141 int err;
1141 unsigned short val, val1, mute_mask; 1142 unsigned short val, val1, mute_mask;
1142 1143
@@ -1153,11 +1154,11 @@ static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int
1153 mute_mask = 0x8080; 1154 mute_mask = 0x8080;
1154 } 1155 }
1155 if (mute_mask == 0x8080) { 1156 if (mute_mask == 0x8080) {
1156 snd_kcontrol_new_t tmp = AC97_DOUBLE(name, reg, 15, 7, 1, 1); 1157 struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 15, 7, 1, 1);
1157 tmp.index = ac97->num; 1158 tmp.index = ac97->num;
1158 kctl = snd_ctl_new1(&tmp, ac97); 1159 kctl = snd_ctl_new1(&tmp, ac97);
1159 } else { 1160 } else {
1160 snd_kcontrol_new_t tmp = AC97_SINGLE(name, reg, 15, 1, 1); 1161 struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 15, 1, 1);
1161 tmp.index = ac97->num; 1162 tmp.index = ac97->num;
1162 kctl = snd_ctl_new1(&tmp, ac97); 1163 kctl = snd_ctl_new1(&tmp, ac97);
1163 } 1164 }
@@ -1172,22 +1173,22 @@ static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int
1172/* 1173/*
1173 * create a volume for normal stereo/mono controls 1174 * create a volume for normal stereo/mono controls
1174 */ 1175 */
1175static int snd_ac97_cvol_new(snd_card_t *card, char *name, int reg, unsigned int lo_max, 1176static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigned int lo_max,
1176 unsigned int hi_max, ac97_t *ac97) 1177 unsigned int hi_max, struct snd_ac97 *ac97)
1177{ 1178{
1178 int err; 1179 int err;
1179 snd_kcontrol_t *kctl; 1180 struct snd_kcontrol *kctl;
1180 1181
1181 if (! snd_ac97_valid_reg(ac97, reg)) 1182 if (! snd_ac97_valid_reg(ac97, reg))
1182 return 0; 1183 return 0;
1183 if (hi_max) { 1184 if (hi_max) {
1184 /* invert */ 1185 /* invert */
1185 snd_kcontrol_new_t tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1); 1186 struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1);
1186 tmp.index = ac97->num; 1187 tmp.index = ac97->num;
1187 kctl = snd_ctl_new1(&tmp, ac97); 1188 kctl = snd_ctl_new1(&tmp, ac97);
1188 } else { 1189 } else {
1189 /* invert */ 1190 /* invert */
1190 snd_kcontrol_new_t tmp = AC97_SINGLE(name, reg, 0, lo_max, 1); 1191 struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 0, lo_max, 1);
1191 tmp.index = ac97->num; 1192 tmp.index = ac97->num;
1192 kctl = snd_ctl_new1(&tmp, ac97); 1193 kctl = snd_ctl_new1(&tmp, ac97);
1193 } 1194 }
@@ -1203,7 +1204,7 @@ static int snd_ac97_cvol_new(snd_card_t *card, char *name, int reg, unsigned int
1203/* 1204/*
1204 * create a mute-switch and a volume for normal stereo/mono controls 1205 * create a mute-switch and a volume for normal stereo/mono controls
1205 */ 1206 */
1206static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int reg, int check_stereo, ac97_t *ac97) 1207static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx, int reg, int check_stereo, struct snd_ac97 *ac97)
1207{ 1208{
1208 int err; 1209 int err;
1209 char name[44]; 1210 char name[44];
@@ -1229,12 +1230,12 @@ static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int reg,
1229#define snd_ac97_cmix_new(card, pfx, reg, ac97) snd_ac97_cmix_new_stereo(card, pfx, reg, 0, ac97) 1230#define snd_ac97_cmix_new(card, pfx, reg, ac97) snd_ac97_cmix_new_stereo(card, pfx, reg, 0, ac97)
1230#define snd_ac97_cmute_new(card, name, reg, ac97) snd_ac97_cmute_new_stereo(card, name, reg, 0, ac97) 1231#define snd_ac97_cmute_new(card, name, reg, ac97) snd_ac97_cmute_new_stereo(card, name, reg, 0, ac97)
1231 1232
1232static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97); 1233static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97);
1233 1234
1234static int snd_ac97_mixer_build(ac97_t * ac97) 1235static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
1235{ 1236{
1236 snd_card_t *card = ac97->bus->card; 1237 struct snd_card *card = ac97->bus->card;
1237 snd_kcontrol_t *kctl; 1238 struct snd_kcontrol *kctl;
1238 int err; 1239 int err;
1239 unsigned int idx; 1240 unsigned int idx;
1240 unsigned char max; 1241 unsigned char max;
@@ -1531,7 +1532,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
1531 return 0; 1532 return 0;
1532} 1533}
1533 1534
1534static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97) 1535static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 * ac97)
1535{ 1536{
1536 int err, idx; 1537 int err, idx;
1537 1538
@@ -1555,7 +1556,7 @@ static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)
1555 return 0; 1556 return 0;
1556} 1557}
1557 1558
1558static int snd_ac97_test_rate(ac97_t *ac97, int reg, int shadow_reg, int rate) 1559static int snd_ac97_test_rate(struct snd_ac97 *ac97, int reg, int shadow_reg, int rate)
1559{ 1560{
1560 unsigned short val; 1561 unsigned short val;
1561 unsigned int tmp; 1562 unsigned int tmp;
@@ -1568,7 +1569,7 @@ static int snd_ac97_test_rate(ac97_t *ac97, int reg, int shadow_reg, int rate)
1568 return val == (tmp & 0xffff); 1569 return val == (tmp & 0xffff);
1569} 1570}
1570 1571
1571static void snd_ac97_determine_rates(ac97_t *ac97, int reg, int shadow_reg, unsigned int *r_result) 1572static void snd_ac97_determine_rates(struct snd_ac97 *ac97, int reg, int shadow_reg, unsigned int *r_result)
1572{ 1573{
1573 unsigned int result = 0; 1574 unsigned int result = 0;
1574 unsigned short saved; 1575 unsigned short saved;
@@ -1628,7 +1629,7 @@ static void snd_ac97_determine_rates(ac97_t *ac97, int reg, int shadow_reg, unsi
1628} 1629}
1629 1630
1630/* check AC97_SPDIF register to accept which sample rates */ 1631/* check AC97_SPDIF register to accept which sample rates */
1631static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97) 1632static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97)
1632{ 1633{
1633 unsigned int result = 0; 1634 unsigned int result = 0;
1634 int i; 1635 int i;
@@ -1648,10 +1649,10 @@ static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97)
1648} 1649}
1649 1650
1650/* look for the codec id table matching with the given id */ 1651/* look for the codec id table matching with the given id */
1651static const ac97_codec_id_t *look_for_codec_id(const ac97_codec_id_t *table, 1652static const struct ac97_codec_id *look_for_codec_id(const struct ac97_codec_id *table,
1652 unsigned int id) 1653 unsigned int id)
1653{ 1654{
1654 const ac97_codec_id_t *pid; 1655 const struct ac97_codec_id *pid;
1655 1656
1656 for (pid = table; pid->id; pid++) 1657 for (pid = table; pid->id; pid++)
1657 if (pid->id == (id & pid->mask)) 1658 if (pid->id == (id & pid->mask))
@@ -1659,9 +1660,9 @@ static const ac97_codec_id_t *look_for_codec_id(const ac97_codec_id_t *table,
1659 return NULL; 1660 return NULL;
1660} 1661}
1661 1662
1662void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem) 1663void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int modem)
1663{ 1664{
1664 const ac97_codec_id_t *pid; 1665 const struct ac97_codec_id *pid;
1665 1666
1666 sprintf(name, "0x%x %c%c%c", id, 1667 sprintf(name, "0x%x %c%c%c", id,
1667 printable(id >> 24), 1668 printable(id >> 24),
@@ -1699,9 +1700,9 @@ void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem)
1699 * 1700 *
1700 * Returns the short identifying name of the codec. 1701 * Returns the short identifying name of the codec.
1701 */ 1702 */
1702const char *snd_ac97_get_short_name(ac97_t *ac97) 1703const char *snd_ac97_get_short_name(struct snd_ac97 *ac97)
1703{ 1704{
1704 const ac97_codec_id_t *pid; 1705 const struct ac97_codec_id *pid;
1705 1706
1706 for (pid = snd_ac97_codec_ids; pid->id; pid++) 1707 for (pid = snd_ac97_codec_ids; pid->id; pid++)
1707 if (pid->id == (ac97->id & pid->mask)) 1708 if (pid->id == (ac97->id & pid->mask))
@@ -1713,7 +1714,7 @@ const char *snd_ac97_get_short_name(ac97_t *ac97)
1713/* wait for a while until registers are accessible after RESET 1714/* wait for a while until registers are accessible after RESET
1714 * return 0 if ok, negative not ready 1715 * return 0 if ok, negative not ready
1715 */ 1716 */
1716static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem) 1717static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem)
1717{ 1718{
1718 unsigned long end_time; 1719 unsigned long end_time;
1719 unsigned short val; 1720 unsigned short val;
@@ -1758,7 +1759,7 @@ static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem)
1758 * @private_data: private data pointer for the new instance 1759 * @private_data: private data pointer for the new instance
1759 * @rbus: the pointer to store the new AC97 bus instance. 1760 * @rbus: the pointer to store the new AC97 bus instance.
1760 * 1761 *
1761 * Creates an AC97 bus component. An ac97_bus_t instance is newly 1762 * Creates an AC97 bus component. An struct snd_ac97_bus instance is newly
1762 * allocated and initialized. 1763 * allocated and initialized.
1763 * 1764 *
1764 * The ops table must include valid callbacks (at least read and 1765 * The ops table must include valid callbacks (at least read and
@@ -1772,12 +1773,12 @@ static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem)
1772 * 1773 *
1773 * Returns zero if successful, or a negative error code on failure. 1774 * Returns zero if successful, or a negative error code on failure.
1774 */ 1775 */
1775int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops, 1776int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
1776 void *private_data, ac97_bus_t **rbus) 1777 void *private_data, struct snd_ac97_bus **rbus)
1777{ 1778{
1778 int err; 1779 int err;
1779 ac97_bus_t *bus; 1780 struct snd_ac97_bus *bus;
1780 static snd_device_ops_t dev_ops = { 1781 static struct snd_device_ops dev_ops = {
1781 .dev_free = snd_ac97_bus_dev_free, 1782 .dev_free = snd_ac97_bus_dev_free,
1782 }; 1783 };
1783 1784
@@ -1807,9 +1808,9 @@ static void ac97_device_release(struct device * dev)
1807} 1808}
1808 1809
1809/* register ac97 codec to bus */ 1810/* register ac97 codec to bus */
1810static int snd_ac97_dev_register(snd_device_t *device) 1811static int snd_ac97_dev_register(struct snd_device *device)
1811{ 1812{
1812 ac97_t *ac97 = device->device_data; 1813 struct snd_ac97 *ac97 = device->device_data;
1813 int err; 1814 int err;
1814 1815
1815 ac97->dev.bus = &ac97_bus_type; 1816 ac97->dev.bus = &ac97_bus_type;
@@ -1825,9 +1826,9 @@ static int snd_ac97_dev_register(snd_device_t *device)
1825} 1826}
1826 1827
1827/* unregister ac97 codec */ 1828/* unregister ac97 codec */
1828static int snd_ac97_dev_unregister(snd_device_t *device) 1829static int snd_ac97_dev_unregister(struct snd_device *device)
1829{ 1830{
1830 ac97_t *ac97 = device->device_data; 1831 struct snd_ac97 *ac97 = device->device_data;
1831 if (ac97->dev.bus) 1832 if (ac97->dev.bus)
1832 device_unregister(&ac97->dev); 1833 device_unregister(&ac97->dev);
1833 return snd_ac97_free(ac97); 1834 return snd_ac97_free(ac97);
@@ -1843,7 +1844,7 @@ static struct snd_ac97_build_ops null_build_ops;
1843 * the private data. 1844 * the private data.
1844 * @rac97: the pointer to store the new ac97 instance. 1845 * @rac97: the pointer to store the new ac97 instance.
1845 * 1846 *
1846 * Creates an Codec97 component. An ac97_t instance is newly 1847 * Creates an Codec97 component. An struct snd_ac97 instance is newly
1847 * allocated and initialized from the template. The codec 1848 * allocated and initialized from the template. The codec
1848 * is then initialized by the standard procedure. 1849 * is then initialized by the standard procedure.
1849 * 1850 *
@@ -1855,16 +1856,16 @@ static struct snd_ac97_build_ops null_build_ops;
1855 * 1856 *
1856 * Returns zero if successful, or a negative error code on failure. 1857 * Returns zero if successful, or a negative error code on failure.
1857 */ 1858 */
1858int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97) 1859int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, struct snd_ac97 **rac97)
1859{ 1860{
1860 int err; 1861 int err;
1861 ac97_t *ac97; 1862 struct snd_ac97 *ac97;
1862 snd_card_t *card; 1863 struct snd_card *card;
1863 char name[64]; 1864 char name[64];
1864 unsigned long end_time; 1865 unsigned long end_time;
1865 unsigned int reg; 1866 unsigned int reg;
1866 const ac97_codec_id_t *pid; 1867 const struct ac97_codec_id *pid;
1867 static snd_device_ops_t ops = { 1868 static struct snd_device_ops ops = {
1868 .dev_free = snd_ac97_dev_free, 1869 .dev_free = snd_ac97_dev_free,
1869 .dev_register = snd_ac97_dev_register, 1870 .dev_register = snd_ac97_dev_register,
1870 .dev_unregister = snd_ac97_dev_unregister, 1871 .dev_unregister = snd_ac97_dev_unregister,
@@ -2148,7 +2149,7 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)
2148 * MASTER and HEADPHONE registers are muted but the register cache values 2149 * MASTER and HEADPHONE registers are muted but the register cache values
2149 * are not changed, so that the values can be restored in snd_ac97_resume(). 2150 * are not changed, so that the values can be restored in snd_ac97_resume().
2150 */ 2151 */
2151static void snd_ac97_powerdown(ac97_t *ac97) 2152static void snd_ac97_powerdown(struct snd_ac97 *ac97)
2152{ 2153{
2153 unsigned short power; 2154 unsigned short power;
2154 2155
@@ -2181,7 +2182,7 @@ static void snd_ac97_powerdown(ac97_t *ac97)
2181 * 2182 *
2182 * Suspends the codec, power down the chip. 2183 * Suspends the codec, power down the chip.
2183 */ 2184 */
2184void snd_ac97_suspend(ac97_t *ac97) 2185void snd_ac97_suspend(struct snd_ac97 *ac97)
2185{ 2186{
2186 if (ac97->build_ops->suspend) 2187 if (ac97->build_ops->suspend)
2187 ac97->build_ops->suspend(ac97); 2188 ac97->build_ops->suspend(ac97);
@@ -2191,7 +2192,7 @@ void snd_ac97_suspend(ac97_t *ac97)
2191/* 2192/*
2192 * restore ac97 status 2193 * restore ac97 status
2193 */ 2194 */
2194void snd_ac97_restore_status(ac97_t *ac97) 2195void snd_ac97_restore_status(struct snd_ac97 *ac97)
2195{ 2196{
2196 int i; 2197 int i;
2197 2198
@@ -2212,7 +2213,7 @@ void snd_ac97_restore_status(ac97_t *ac97)
2212/* 2213/*
2213 * restore IEC958 status 2214 * restore IEC958 status
2214 */ 2215 */
2215void snd_ac97_restore_iec958(ac97_t *ac97) 2216void snd_ac97_restore_iec958(struct snd_ac97 *ac97)
2216{ 2217{
2217 if (ac97->ext_id & AC97_EI_SPDIF) { 2218 if (ac97->ext_id & AC97_EI_SPDIF) {
2218 if (ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_SPDIF) { 2219 if (ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_SPDIF) {
@@ -2235,7 +2236,7 @@ void snd_ac97_restore_iec958(ac97_t *ac97)
2235 * Do the standard resume procedure, power up and restoring the 2236 * Do the standard resume procedure, power up and restoring the
2236 * old register values. 2237 * old register values.
2237 */ 2238 */
2238void snd_ac97_resume(ac97_t *ac97) 2239void snd_ac97_resume(struct snd_ac97 *ac97)
2239{ 2240{
2240 unsigned long end_time; 2241 unsigned long end_time;
2241 2242
@@ -2301,18 +2302,18 @@ static void set_ctl_name(char *dst, const char *src, const char *suffix)
2301} 2302}
2302 2303
2303/* remove the control with the given name and optional suffix */ 2304/* remove the control with the given name and optional suffix */
2304int snd_ac97_remove_ctl(ac97_t *ac97, const char *name, const char *suffix) 2305int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, const char *suffix)
2305{ 2306{
2306 snd_ctl_elem_id_t id; 2307 struct snd_ctl_elem_id id;
2307 memset(&id, 0, sizeof(id)); 2308 memset(&id, 0, sizeof(id));
2308 set_ctl_name(id.name, name, suffix); 2309 set_ctl_name(id.name, name, suffix);
2309 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 2310 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
2310 return snd_ctl_remove_id(ac97->bus->card, &id); 2311 return snd_ctl_remove_id(ac97->bus->card, &id);
2311} 2312}
2312 2313
2313static snd_kcontrol_t *ctl_find(ac97_t *ac97, const char *name, const char *suffix) 2314static struct snd_kcontrol *ctl_find(struct snd_ac97 *ac97, const char *name, const char *suffix)
2314{ 2315{
2315 snd_ctl_elem_id_t sid; 2316 struct snd_ctl_elem_id sid;
2316 memset(&sid, 0, sizeof(sid)); 2317 memset(&sid, 0, sizeof(sid));
2317 set_ctl_name(sid.name, name, suffix); 2318 set_ctl_name(sid.name, name, suffix);
2318 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 2319 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
@@ -2320,9 +2321,9 @@ static snd_kcontrol_t *ctl_find(ac97_t *ac97, const char *name, const char *suff
2320} 2321}
2321 2322
2322/* rename the control with the given name and optional suffix */ 2323/* rename the control with the given name and optional suffix */
2323int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const char *suffix) 2324int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, const char *suffix)
2324{ 2325{
2325 snd_kcontrol_t *kctl = ctl_find(ac97, src, suffix); 2326 struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix);
2326 if (kctl) { 2327 if (kctl) {
2327 set_ctl_name(kctl->id.name, dst, suffix); 2328 set_ctl_name(kctl->id.name, dst, suffix);
2328 return 0; 2329 return 0;
@@ -2331,16 +2332,16 @@ int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const ch
2331} 2332}
2332 2333
2333/* rename both Volume and Switch controls - don't check the return value */ 2334/* rename both Volume and Switch controls - don't check the return value */
2334void snd_ac97_rename_vol_ctl(ac97_t *ac97, const char *src, const char *dst) 2335void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, const char *dst)
2335{ 2336{
2336 snd_ac97_rename_ctl(ac97, src, dst, "Switch"); 2337 snd_ac97_rename_ctl(ac97, src, dst, "Switch");
2337 snd_ac97_rename_ctl(ac97, src, dst, "Volume"); 2338 snd_ac97_rename_ctl(ac97, src, dst, "Volume");
2338} 2339}
2339 2340
2340/* swap controls */ 2341/* swap controls */
2341int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *suffix) 2342int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, const char *s2, const char *suffix)
2342{ 2343{
2343 snd_kcontrol_t *kctl1, *kctl2; 2344 struct snd_kcontrol *kctl1, *kctl2;
2344 kctl1 = ctl_find(ac97, s1, suffix); 2345 kctl1 = ctl_find(ac97, s1, suffix);
2345 kctl2 = ctl_find(ac97, s2, suffix); 2346 kctl2 = ctl_find(ac97, s2, suffix);
2346 if (kctl1 && kctl2) { 2347 if (kctl1 && kctl2) {
@@ -2353,7 +2354,7 @@ int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *
2353 2354
2354#if 1 2355#if 1
2355/* bind hp and master controls instead of using only hp control */ 2356/* bind hp and master controls instead of using only hp control */
2356static int bind_hp_volsw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 2357static int bind_hp_volsw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2357{ 2358{
2358 int err = snd_ac97_put_volsw(kcontrol, ucontrol); 2359 int err = snd_ac97_put_volsw(kcontrol, ucontrol);
2359 if (err > 0) { 2360 if (err > 0) {
@@ -2366,10 +2367,10 @@ static int bind_hp_volsw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
2366} 2367}
2367 2368
2368/* ac97 tune: bind Master and Headphone controls */ 2369/* ac97 tune: bind Master and Headphone controls */
2369static int tune_hp_only(ac97_t *ac97) 2370static int tune_hp_only(struct snd_ac97 *ac97)
2370{ 2371{
2371 snd_kcontrol_t *msw = ctl_find(ac97, "Master Playback Switch", NULL); 2372 struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
2372 snd_kcontrol_t *mvol = ctl_find(ac97, "Master Playback Volume", NULL); 2373 struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL);
2373 if (! msw || ! mvol) 2374 if (! msw || ! mvol)
2374 return -ENOENT; 2375 return -ENOENT;
2375 msw->put = bind_hp_volsw_put; 2376 msw->put = bind_hp_volsw_put;
@@ -2381,7 +2382,7 @@ static int tune_hp_only(ac97_t *ac97)
2381 2382
2382#else 2383#else
2383/* ac97 tune: use Headphone control as master */ 2384/* ac97 tune: use Headphone control as master */
2384static int tune_hp_only(ac97_t *ac97) 2385static int tune_hp_only(struct snd_ac97 *ac97)
2385{ 2386{
2386 if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL) 2387 if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL)
2387 return -ENOENT; 2388 return -ENOENT;
@@ -2393,7 +2394,7 @@ static int tune_hp_only(ac97_t *ac97)
2393#endif 2394#endif
2394 2395
2395/* ac97 tune: swap Headphone and Master controls */ 2396/* ac97 tune: swap Headphone and Master controls */
2396static int tune_swap_hp(ac97_t *ac97) 2397static int tune_swap_hp(struct snd_ac97 *ac97)
2397{ 2398{
2398 if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL) 2399 if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL)
2399 return -ENOENT; 2400 return -ENOENT;
@@ -2403,7 +2404,7 @@ static int tune_swap_hp(ac97_t *ac97)
2403} 2404}
2404 2405
2405/* ac97 tune: swap Surround and Master controls */ 2406/* ac97 tune: swap Surround and Master controls */
2406static int tune_swap_surround(ac97_t *ac97) 2407static int tune_swap_surround(struct snd_ac97 *ac97)
2407{ 2408{
2408 if (snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Switch") || 2409 if (snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Switch") ||
2409 snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Volume")) 2410 snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Volume"))
@@ -2412,7 +2413,7 @@ static int tune_swap_surround(ac97_t *ac97)
2412} 2413}
2413 2414
2414/* ac97 tune: set up mic sharing for AD codecs */ 2415/* ac97 tune: set up mic sharing for AD codecs */
2415static int tune_ad_sharing(ac97_t *ac97) 2416static int tune_ad_sharing(struct snd_ac97 *ac97)
2416{ 2417{
2417 unsigned short scfg; 2418 unsigned short scfg;
2418 if ((ac97->id & 0xffffff00) != 0x41445300) { 2419 if ((ac97->id & 0xffffff00) != 0x41445300) {
@@ -2425,11 +2426,11 @@ static int tune_ad_sharing(ac97_t *ac97)
2425 return 0; 2426 return 0;
2426} 2427}
2427 2428
2428static const snd_kcontrol_new_t snd_ac97_alc_jack_detect = 2429static const struct snd_kcontrol_new snd_ac97_alc_jack_detect =
2429AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0); 2430AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);
2430 2431
2431/* ac97 tune: set up ALC jack-select */ 2432/* ac97 tune: set up ALC jack-select */
2432static int tune_alc_jack(ac97_t *ac97) 2433static int tune_alc_jack(struct snd_ac97 *ac97)
2433{ 2434{
2434 if ((ac97->id & 0xffffff00) != 0x414c4700) { 2435 if ((ac97->id & 0xffffff00) != 0x414c4700) {
2435 snd_printk(KERN_ERR "ac97_quirk ALC_JACK is only for Realtek codecs\n"); 2436 snd_printk(KERN_ERR "ac97_quirk ALC_JACK is only for Realtek codecs\n");
@@ -2441,20 +2442,20 @@ static int tune_alc_jack(ac97_t *ac97)
2441} 2442}
2442 2443
2443/* ac97 tune: inversed EAPD bit */ 2444/* ac97 tune: inversed EAPD bit */
2444static int tune_inv_eapd(ac97_t *ac97) 2445static int tune_inv_eapd(struct snd_ac97 *ac97)
2445{ 2446{
2446 snd_kcontrol_t *kctl = ctl_find(ac97, "External Amplifier", NULL); 2447 struct snd_kcontrol *kctl = ctl_find(ac97, "External Amplifier", NULL);
2447 if (! kctl) 2448 if (! kctl)
2448 return -ENOENT; 2449 return -ENOENT;
2449 set_inv_eapd(ac97, kctl); 2450 set_inv_eapd(ac97, kctl);
2450 return 0; 2451 return 0;
2451} 2452}
2452 2453
2453static int master_mute_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 2454static int master_mute_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2454{ 2455{
2455 int err = snd_ac97_put_volsw(kcontrol, ucontrol); 2456 int err = snd_ac97_put_volsw(kcontrol, ucontrol);
2456 if (err > 0) { 2457 if (err > 0) {
2457 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2458 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2458 int shift = (kcontrol->private_value >> 8) & 0x0f; 2459 int shift = (kcontrol->private_value >> 8) & 0x0f;
2459 int rshift = (kcontrol->private_value >> 12) & 0x0f; 2460 int rshift = (kcontrol->private_value >> 12) & 0x0f;
2460 unsigned short mask; 2461 unsigned short mask;
@@ -2470,9 +2471,9 @@ static int master_mute_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc
2470} 2471}
2471 2472
2472/* ac97 tune: EAPD controls mute LED bound with the master mute */ 2473/* ac97 tune: EAPD controls mute LED bound with the master mute */
2473static int tune_mute_led(ac97_t *ac97) 2474static int tune_mute_led(struct snd_ac97 *ac97)
2474{ 2475{
2475 snd_kcontrol_t *msw = ctl_find(ac97, "Master Playback Switch", NULL); 2476 struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
2476 if (! msw) 2477 if (! msw)
2477 return -ENOENT; 2478 return -ENOENT;
2478 msw->put = master_mute_sw_put; 2479 msw->put = master_mute_sw_put;
@@ -2483,7 +2484,7 @@ static int tune_mute_led(ac97_t *ac97)
2483 2484
2484struct quirk_table { 2485struct quirk_table {
2485 const char *name; 2486 const char *name;
2486 int (*func)(ac97_t *); 2487 int (*func)(struct snd_ac97 *);
2487}; 2488};
2488 2489
2489static struct quirk_table applicable_quirks[] = { 2490static struct quirk_table applicable_quirks[] = {
@@ -2498,7 +2499,7 @@ static struct quirk_table applicable_quirks[] = {
2498}; 2499};
2499 2500
2500/* apply the quirk with the given type */ 2501/* apply the quirk with the given type */
2501static int apply_quirk(ac97_t *ac97, int type) 2502static int apply_quirk(struct snd_ac97 *ac97, int type)
2502{ 2503{
2503 if (type <= 0) 2504 if (type <= 0)
2504 return 0; 2505 return 0;
@@ -2510,7 +2511,7 @@ static int apply_quirk(ac97_t *ac97, int type)
2510} 2511}
2511 2512
2512/* apply the quirk with the given name */ 2513/* apply the quirk with the given name */
2513static int apply_quirk_str(ac97_t *ac97, const char *typestr) 2514static int apply_quirk_str(struct snd_ac97 *ac97, const char *typestr)
2514{ 2515{
2515 int i; 2516 int i;
2516 struct quirk_table *q; 2517 struct quirk_table *q;
@@ -2539,7 +2540,7 @@ static int apply_quirk_str(ac97_t *ac97, const char *typestr)
2539 * Returns zero if successful, or a negative error code on failure. 2540 * Returns zero if successful, or a negative error code on failure.
2540 */ 2541 */
2541 2542
2542int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override) 2543int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override)
2543{ 2544{
2544 int result; 2545 int result;
2545 2546
diff --git a/sound/pci/ac97/ac97_local.h b/sound/pci/ac97/ac97_local.h
index 5ff3ef2cae3e..e98587e027d4 100644
--- a/sound/pci/ac97/ac97_local.h
+++ b/sound/pci/ac97/ac97_local.h
@@ -37,6 +37,7 @@
37 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \ 37 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
38 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) } 38 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
39 39
40/* enum control */
40struct ac97_enum { 41struct ac97_enum {
41 unsigned char reg; 42 unsigned char reg;
42 unsigned char shift_l; 43 unsigned char shift_l;
@@ -57,33 +58,33 @@ struct ac97_enum {
57 58
58/* ac97_codec.c */ 59/* ac97_codec.c */
59extern const char *snd_ac97_stereo_enhancements[]; 60extern const char *snd_ac97_stereo_enhancements[];
60extern const snd_kcontrol_new_t snd_ac97_controls_3d[]; 61extern const struct snd_kcontrol_new snd_ac97_controls_3d[];
61extern const snd_kcontrol_new_t snd_ac97_controls_spdif[]; 62extern const struct snd_kcontrol_new snd_ac97_controls_spdif[];
62snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97); 63struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97);
63void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem); 64void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int modem);
64int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); 65int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
65int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 66int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
66int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 67int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
67int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit); 68int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit);
68int snd_ac97_remove_ctl(ac97_t *ac97, const char *name, const char *suffix); 69int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, const char *suffix);
69int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const char *suffix); 70int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, const char *suffix);
70int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *suffix); 71int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, const char *s2, const char *suffix);
71void snd_ac97_rename_vol_ctl(ac97_t *ac97, const char *src, const char *dst); 72void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, const char *dst);
72void snd_ac97_restore_status(ac97_t *ac97); 73void snd_ac97_restore_status(struct snd_ac97 *ac97);
73void snd_ac97_restore_iec958(ac97_t *ac97); 74void snd_ac97_restore_iec958(struct snd_ac97 *ac97);
74int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); 75int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
75int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 76int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
76int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 77int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
77 78
78int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg, 79int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg,
79 unsigned short mask, unsigned short value); 80 unsigned short mask, unsigned short value);
80 81
81/* ac97_proc.c */ 82/* ac97_proc.c */
82#ifdef CONFIG_PROC_FS 83#ifdef CONFIG_PROC_FS
83void snd_ac97_bus_proc_init(ac97_bus_t * ac97); 84void snd_ac97_bus_proc_init(struct snd_ac97_bus * ac97);
84void snd_ac97_bus_proc_done(ac97_bus_t * ac97); 85void snd_ac97_bus_proc_done(struct snd_ac97_bus * ac97);
85void snd_ac97_proc_init(ac97_t * ac97); 86void snd_ac97_proc_init(struct snd_ac97 * ac97);
86void snd_ac97_proc_done(ac97_t * ac97); 87void snd_ac97_proc_done(struct snd_ac97 * ac97);
87#else 88#else
88#define snd_ac97_bus_proc_init(ac97_bus_t) do { } while (0) 89#define snd_ac97_bus_proc_init(ac97_bus_t) do { } while (0)
89#define snd_ac97_bus_proc_done(ac97_bus_t) do { } while (0) 90#define snd_ac97_bus_proc_done(ac97_bus_t) do { } while (0)
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index de1c72ad2c6b..c68ee0f3e72a 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -39,7 +39,7 @@
39 * Chip specific initialization 39 * Chip specific initialization
40 */ 40 */
41 41
42static int patch_build_controls(ac97_t * ac97, const snd_kcontrol_new_t *controls, int count) 42static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontrol_new *controls, int count)
43{ 43{
44 int idx, err; 44 int idx, err;
45 45
@@ -50,7 +50,7 @@ static int patch_build_controls(ac97_t * ac97, const snd_kcontrol_new_t *control
50} 50}
51 51
52/* set to the page, update bits and restore the page */ 52/* set to the page, update bits and restore the page */
53static int ac97_update_bits_page(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value, unsigned short page) 53static int ac97_update_bits_page(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value, unsigned short page)
54{ 54{
55 unsigned short page_save; 55 unsigned short page_save;
56 int ret; 56 int ret;
@@ -67,7 +67,7 @@ static int ac97_update_bits_page(ac97_t *ac97, unsigned short reg, unsigned shor
67/* 67/*
68 * shared line-in/mic controls 68 * shared line-in/mic controls
69 */ 69 */
70static int ac97_enum_text_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo, 70static int ac97_enum_text_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo,
71 const char **texts, unsigned int nums) 71 const char **texts, unsigned int nums)
72{ 72{
73 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 73 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
@@ -79,23 +79,23 @@ static int ac97_enum_text_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui
79 return 0; 79 return 0;
80} 80}
81 81
82static int ac97_surround_jack_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 82static int ac97_surround_jack_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
83{ 83{
84 static const char *texts[] = { "Shared", "Independent" }; 84 static const char *texts[] = { "Shared", "Independent" };
85 return ac97_enum_text_info(kcontrol, uinfo, texts, 2); 85 return ac97_enum_text_info(kcontrol, uinfo, texts, 2);
86} 86}
87 87
88static int ac97_surround_jack_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 88static int ac97_surround_jack_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
89{ 89{
90 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 90 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
91 91
92 ucontrol->value.enumerated.item[0] = ac97->indep_surround; 92 ucontrol->value.enumerated.item[0] = ac97->indep_surround;
93 return 0; 93 return 0;
94} 94}
95 95
96static int ac97_surround_jack_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 96static int ac97_surround_jack_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
97{ 97{
98 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 98 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
99 unsigned char indep = !!ucontrol->value.enumerated.item[0]; 99 unsigned char indep = !!ucontrol->value.enumerated.item[0];
100 100
101 if (indep != ac97->indep_surround) { 101 if (indep != ac97->indep_surround) {
@@ -107,7 +107,7 @@ static int ac97_surround_jack_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
107 return 0; 107 return 0;
108} 108}
109 109
110static int ac97_channel_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 110static int ac97_channel_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
111{ 111{
112 static const char *texts[] = { "2ch", "4ch", "6ch" }; 112 static const char *texts[] = { "2ch", "4ch", "6ch" };
113 if (kcontrol->private_value) 113 if (kcontrol->private_value)
@@ -115,17 +115,17 @@ static int ac97_channel_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
115 return ac97_enum_text_info(kcontrol, uinfo, texts, 3); 115 return ac97_enum_text_info(kcontrol, uinfo, texts, 3);
116} 116}
117 117
118static int ac97_channel_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 118static int ac97_channel_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
119{ 119{
120 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 120 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
121 121
122 ucontrol->value.enumerated.item[0] = ac97->channel_mode; 122 ucontrol->value.enumerated.item[0] = ac97->channel_mode;
123 return 0; 123 return 0;
124} 124}
125 125
126static int ac97_channel_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 126static int ac97_channel_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
127{ 127{
128 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 128 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
129 unsigned char mode = ucontrol->value.enumerated.item[0]; 129 unsigned char mode = ucontrol->value.enumerated.item[0];
130 130
131 if (mode != ac97->channel_mode) { 131 if (mode != ac97->channel_mode) {
@@ -163,22 +163,22 @@ static int ac97_channel_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
163 .private_value = 1, \ 163 .private_value = 1, \
164 } 164 }
165 165
166static inline int is_surround_on(ac97_t *ac97) 166static inline int is_surround_on(struct snd_ac97 *ac97)
167{ 167{
168 return ac97->channel_mode >= 1; 168 return ac97->channel_mode >= 1;
169} 169}
170 170
171static inline int is_clfe_on(ac97_t *ac97) 171static inline int is_clfe_on(struct snd_ac97 *ac97)
172{ 172{
173 return ac97->channel_mode >= 2; 173 return ac97->channel_mode >= 2;
174} 174}
175 175
176static inline int is_shared_linein(ac97_t *ac97) 176static inline int is_shared_linein(struct snd_ac97 *ac97)
177{ 177{
178 return ! ac97->indep_surround && is_surround_on(ac97); 178 return ! ac97->indep_surround && is_surround_on(ac97);
179} 179}
180 180
181static inline int is_shared_micin(ac97_t *ac97) 181static inline int is_shared_micin(struct snd_ac97 *ac97)
182{ 182{
183 return ! ac97->indep_surround && is_clfe_on(ac97); 183 return ! ac97->indep_surround && is_clfe_on(ac97);
184} 184}
@@ -187,7 +187,7 @@ static inline int is_shared_micin(ac97_t *ac97)
187/* The following snd_ac97_ymf753_... items added by David Shust (dshust@shustring.com) */ 187/* The following snd_ac97_ymf753_... items added by David Shust (dshust@shustring.com) */
188 188
189/* It is possible to indicate to the Yamaha YMF753 the type of speakers being used. */ 189/* It is possible to indicate to the Yamaha YMF753 the type of speakers being used. */
190static int snd_ac97_ymf753_info_speaker(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 190static int snd_ac97_ymf753_info_speaker(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
191{ 191{
192 static char *texts[3] = { 192 static char *texts[3] = {
193 "Standard", "Small", "Smaller" 193 "Standard", "Small", "Smaller"
@@ -202,9 +202,9 @@ static int snd_ac97_ymf753_info_speaker(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
202 return 0; 202 return 0;
203} 203}
204 204
205static int snd_ac97_ymf753_get_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 205static int snd_ac97_ymf753_get_speaker(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
206{ 206{
207 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 207 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
208 unsigned short val; 208 unsigned short val;
209 209
210 val = ac97->regs[AC97_YMF753_3D_MODE_SEL]; 210 val = ac97->regs[AC97_YMF753_3D_MODE_SEL];
@@ -215,9 +215,9 @@ static int snd_ac97_ymf753_get_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_v
215 return 0; 215 return 0;
216} 216}
217 217
218static int snd_ac97_ymf753_put_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 218static int snd_ac97_ymf753_put_speaker(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
219{ 219{
220 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 220 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
221 unsigned short val; 221 unsigned short val;
222 222
223 if (ucontrol->value.enumerated.item[0] > 2) 223 if (ucontrol->value.enumerated.item[0] > 2)
@@ -226,7 +226,7 @@ static int snd_ac97_ymf753_put_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_v
226 return snd_ac97_update(ac97, AC97_YMF753_3D_MODE_SEL, val); 226 return snd_ac97_update(ac97, AC97_YMF753_3D_MODE_SEL, val);
227} 227}
228 228
229static const snd_kcontrol_new_t snd_ac97_ymf753_controls_speaker = 229static const struct snd_kcontrol_new snd_ac97_ymf753_controls_speaker =
230{ 230{
231 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 231 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
232 .name = "3D Control - Speaker", 232 .name = "3D Control - Speaker",
@@ -236,7 +236,7 @@ static const snd_kcontrol_new_t snd_ac97_ymf753_controls_speaker =
236}; 236};
237 237
238/* It is possible to indicate to the Yamaha YMF753 the source to direct to the S/PDIF output. */ 238/* It is possible to indicate to the Yamaha YMF753 the source to direct to the S/PDIF output. */
239static int snd_ac97_ymf753_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 239static int snd_ac97_ymf753_spdif_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
240{ 240{
241 static char *texts[2] = { "AC-Link", "A/D Converter" }; 241 static char *texts[2] = { "AC-Link", "A/D Converter" };
242 242
@@ -249,9 +249,9 @@ static int snd_ac97_ymf753_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_e
249 return 0; 249 return 0;
250} 250}
251 251
252static int snd_ac97_ymf753_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 252static int snd_ac97_ymf753_spdif_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
253{ 253{
254 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 254 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
255 unsigned short val; 255 unsigned short val;
256 256
257 val = ac97->regs[AC97_YMF753_DIT_CTRL2]; 257 val = ac97->regs[AC97_YMF753_DIT_CTRL2];
@@ -259,9 +259,9 @@ static int snd_ac97_ymf753_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_e
259 return 0; 259 return 0;
260} 260}
261 261
262static int snd_ac97_ymf753_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 262static int snd_ac97_ymf753_spdif_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
263{ 263{
264 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 264 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
265 unsigned short val; 265 unsigned short val;
266 266
267 if (ucontrol->value.enumerated.item[0] > 1) 267 if (ucontrol->value.enumerated.item[0] > 1)
@@ -274,7 +274,7 @@ static int snd_ac97_ymf753_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_e
274 The YMF753 will output the S/PDIF signal to pin 43, 47 (EAPD), or 48. 274 The YMF753 will output the S/PDIF signal to pin 43, 47 (EAPD), or 48.
275 By default, no output pin is selected, and the S/PDIF signal is not output. 275 By default, no output pin is selected, and the S/PDIF signal is not output.
276 There is also a bit to mute S/PDIF output in a vendor-specific register. */ 276 There is also a bit to mute S/PDIF output in a vendor-specific register. */
277static int snd_ac97_ymf753_spdif_output_pin_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 277static int snd_ac97_ymf753_spdif_output_pin_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
278{ 278{
279 static char *texts[3] = { "Disabled", "Pin 43", "Pin 48" }; 279 static char *texts[3] = { "Disabled", "Pin 43", "Pin 48" };
280 280
@@ -287,9 +287,9 @@ static int snd_ac97_ymf753_spdif_output_pin_info(snd_kcontrol_t *kcontrol, snd_c
287 return 0; 287 return 0;
288} 288}
289 289
290static int snd_ac97_ymf753_spdif_output_pin_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 290static int snd_ac97_ymf753_spdif_output_pin_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
291{ 291{
292 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 292 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
293 unsigned short val; 293 unsigned short val;
294 294
295 val = ac97->regs[AC97_YMF753_DIT_CTRL2]; 295 val = ac97->regs[AC97_YMF753_DIT_CTRL2];
@@ -297,9 +297,9 @@ static int snd_ac97_ymf753_spdif_output_pin_get(snd_kcontrol_t * kcontrol, snd_c
297 return 0; 297 return 0;
298} 298}
299 299
300static int snd_ac97_ymf753_spdif_output_pin_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 300static int snd_ac97_ymf753_spdif_output_pin_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
301{ 301{
302 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 302 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
303 unsigned short val; 303 unsigned short val;
304 304
305 if (ucontrol->value.enumerated.item[0] > 2) 305 if (ucontrol->value.enumerated.item[0] > 2)
@@ -311,7 +311,7 @@ static int snd_ac97_ymf753_spdif_output_pin_put(snd_kcontrol_t * kcontrol, snd_c
311 snd_ac97_write_cache(ac97, 0x62, snd_ac97_read(ac97, 0x62) | 0x0008); */ 311 snd_ac97_write_cache(ac97, 0x62, snd_ac97_read(ac97, 0x62) | 0x0008); */
312} 312}
313 313
314static const snd_kcontrol_new_t snd_ac97_ymf753_controls_spdif[3] = { 314static const struct snd_kcontrol_new snd_ac97_ymf753_controls_spdif[3] = {
315 { 315 {
316 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 316 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
317 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", 317 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
@@ -329,9 +329,9 @@ static const snd_kcontrol_new_t snd_ac97_ymf753_controls_spdif[3] = {
329 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",NONE,NONE) "Mute", AC97_YMF753_DIT_CTRL2, 2, 1, 1) 329 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",NONE,NONE) "Mute", AC97_YMF753_DIT_CTRL2, 2, 1, 1)
330}; 330};
331 331
332static int patch_yamaha_ymf753_3d(ac97_t * ac97) 332static int patch_yamaha_ymf753_3d(struct snd_ac97 * ac97)
333{ 333{
334 snd_kcontrol_t *kctl; 334 struct snd_kcontrol *kctl;
335 int err; 335 int err;
336 336
337 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 337 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
@@ -345,7 +345,7 @@ static int patch_yamaha_ymf753_3d(ac97_t * ac97)
345 return 0; 345 return 0;
346} 346}
347 347
348static int patch_yamaha_ymf753_post_spdif(ac97_t * ac97) 348static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97)
349{ 349{
350 int err; 350 int err;
351 351
@@ -359,7 +359,7 @@ static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
359 .build_post_spdif = patch_yamaha_ymf753_post_spdif 359 .build_post_spdif = patch_yamaha_ymf753_post_spdif
360}; 360};
361 361
362int patch_yamaha_ymf753(ac97_t * ac97) 362int patch_yamaha_ymf753(struct snd_ac97 * ac97)
363{ 363{
364 /* Patch for Yamaha YMF753, Copyright (c) by David Shust, dshust@shustring.com. 364 /* Patch for Yamaha YMF753, Copyright (c) by David Shust, dshust@shustring.com.
365 This chip has nonstandard and extended behaviour with regard to its S/PDIF output. 365 This chip has nonstandard and extended behaviour with regard to its S/PDIF output.
@@ -380,12 +380,12 @@ int patch_yamaha_ymf753(ac97_t * ac97)
380 * added support for WM9705,WM9708,WM9709,WM9710,WM9711,WM9712 and WM9717. 380 * added support for WM9705,WM9708,WM9709,WM9710,WM9711,WM9712 and WM9717.
381 */ 381 */
382 382
383static const snd_kcontrol_new_t wm97xx_snd_ac97_controls[] = { 383static const struct snd_kcontrol_new wm97xx_snd_ac97_controls[] = {
384AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1), 384AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1),
385AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1), 385AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1),
386}; 386};
387 387
388static int patch_wolfson_wm9703_specific(ac97_t * ac97) 388static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97)
389{ 389{
390 /* This is known to work for the ViewSonic ViewPad 1000 390 /* This is known to work for the ViewSonic ViewPad 1000
391 * Randolph Bentson <bentson@holmsjoen.com> 391 * Randolph Bentson <bentson@holmsjoen.com>
@@ -405,13 +405,13 @@ static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
405 .build_specific = patch_wolfson_wm9703_specific, 405 .build_specific = patch_wolfson_wm9703_specific,
406}; 406};
407 407
408int patch_wolfson03(ac97_t * ac97) 408int patch_wolfson03(struct snd_ac97 * ac97)
409{ 409{
410 ac97->build_ops = &patch_wolfson_wm9703_ops; 410 ac97->build_ops = &patch_wolfson_wm9703_ops;
411 return 0; 411 return 0;
412} 412}
413 413
414static const snd_kcontrol_new_t wm9704_snd_ac97_controls[] = { 414static const struct snd_kcontrol_new wm9704_snd_ac97_controls[] = {
415AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1), 415AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1),
416AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1), 416AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1),
417AC97_DOUBLE("Rear Playback Volume", AC97_WM9704_RMIXER_VOL, 8, 0, 31, 1), 417AC97_DOUBLE("Rear Playback Volume", AC97_WM9704_RMIXER_VOL, 8, 0, 31, 1),
@@ -420,7 +420,7 @@ AC97_DOUBLE("Rear DAC Volume", AC97_WM9704_RPCM_VOL, 8, 0, 31, 1),
420AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1), 420AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
421}; 421};
422 422
423static int patch_wolfson_wm9704_specific(ac97_t * ac97) 423static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97)
424{ 424{
425 int err, i; 425 int err, i;
426 for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) { 426 for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) {
@@ -436,14 +436,14 @@ static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
436 .build_specific = patch_wolfson_wm9704_specific, 436 .build_specific = patch_wolfson_wm9704_specific,
437}; 437};
438 438
439int patch_wolfson04(ac97_t * ac97) 439int patch_wolfson04(struct snd_ac97 * ac97)
440{ 440{
441 /* WM9704M/9704Q */ 441 /* WM9704M/9704Q */
442 ac97->build_ops = &patch_wolfson_wm9704_ops; 442 ac97->build_ops = &patch_wolfson_wm9704_ops;
443 return 0; 443 return 0;
444} 444}
445 445
446static int patch_wolfson_wm9705_specific(ac97_t * ac97) 446static int patch_wolfson_wm9705_specific(struct snd_ac97 * ac97)
447{ 447{
448 int err, i; 448 int err, i;
449 for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) { 449 for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) {
@@ -458,7 +458,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9705_ops = {
458 .build_specific = patch_wolfson_wm9705_specific, 458 .build_specific = patch_wolfson_wm9705_specific,
459}; 459};
460 460
461int patch_wolfson05(ac97_t * ac97) 461int patch_wolfson05(struct snd_ac97 * ac97)
462{ 462{
463 /* WM9705, WM9710 */ 463 /* WM9705, WM9710 */
464 ac97->build_ops = &patch_wolfson_wm9705_ops; 464 ac97->build_ops = &patch_wolfson_wm9705_ops;
@@ -490,7 +490,7 @@ AC97_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 8, wm9711_rec_sel),
490AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9711_ng_type), 490AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9711_ng_type),
491}; 491};
492 492
493static const snd_kcontrol_new_t wm9711_snd_ac97_controls[] = { 493static const struct snd_kcontrol_new wm9711_snd_ac97_controls[] = {
494AC97_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), 494AC97_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0),
495AC97_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), 495AC97_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0),
496AC97_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0), 496AC97_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0),
@@ -568,7 +568,7 @@ AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0),
568AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0), 568AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0),
569}; 569};
570 570
571static int patch_wolfson_wm9711_specific(ac97_t * ac97) 571static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97)
572{ 572{
573 int err, i; 573 int err, i;
574 574
@@ -589,7 +589,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
589 .build_specific = patch_wolfson_wm9711_specific, 589 .build_specific = patch_wolfson_wm9711_specific,
590}; 590};
591 591
592int patch_wolfson11(ac97_t * ac97) 592int patch_wolfson11(struct snd_ac97 * ac97)
593{ 593{
594 /* WM9711, WM9712 */ 594 /* WM9711, WM9712 */
595 ac97->build_ops = &patch_wolfson_wm9711_ops; 595 ac97->build_ops = &patch_wolfson_wm9711_ops;
@@ -636,7 +636,7 @@ AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 15, 2, wm9713_base),
636AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9713_ng_type), 636AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9713_ng_type),
637}; 637};
638 638
639static const snd_kcontrol_new_t wm13_snd_ac97_controls[] = { 639static const struct snd_kcontrol_new wm13_snd_ac97_controls[] = {
640AC97_DOUBLE("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1), 640AC97_DOUBLE("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1),
641AC97_SINGLE("Line In to Headphone Switch", AC97_PC_BEEP, 15, 1, 1), 641AC97_SINGLE("Line In to Headphone Switch", AC97_PC_BEEP, 15, 1, 1),
642AC97_SINGLE("Line In to Master Switch", AC97_PC_BEEP, 14, 1, 1), 642AC97_SINGLE("Line In to Master Switch", AC97_PC_BEEP, 14, 1, 1),
@@ -728,14 +728,14 @@ AC97_SINGLE("Bass Volume", AC97_GENERAL_PURPOSE, 8, 15, 1),
728AC97_SINGLE("Tone Volume", AC97_GENERAL_PURPOSE, 0, 15, 1), 728AC97_SINGLE("Tone Volume", AC97_GENERAL_PURPOSE, 0, 15, 1),
729}; 729};
730 730
731static const snd_kcontrol_new_t wm13_snd_ac97_controls_3d[] = { 731static const struct snd_kcontrol_new wm13_snd_ac97_controls_3d[] = {
732AC97_ENUM("Inv Input Mux", wm9713_enum[11]), 732AC97_ENUM("Inv Input Mux", wm9713_enum[11]),
733AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0), 733AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
734AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0), 734AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
735AC97_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1), 735AC97_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1),
736}; 736};
737 737
738static int patch_wolfson_wm9713_3d (ac97_t * ac97) 738static int patch_wolfson_wm9713_3d (struct snd_ac97 * ac97)
739{ 739{
740 int err, i; 740 int err, i;
741 741
@@ -746,7 +746,7 @@ static int patch_wolfson_wm9713_3d (ac97_t * ac97)
746 return 0; 746 return 0;
747} 747}
748 748
749static int patch_wolfson_wm9713_specific(ac97_t * ac97) 749static int patch_wolfson_wm9713_specific(struct snd_ac97 * ac97)
750{ 750{
751 int err, i; 751 int err, i;
752 752
@@ -765,13 +765,13 @@ static int patch_wolfson_wm9713_specific(ac97_t * ac97)
765} 765}
766 766
767#ifdef CONFIG_PM 767#ifdef CONFIG_PM
768static void patch_wolfson_wm9713_suspend (ac97_t * ac97) 768static void patch_wolfson_wm9713_suspend (struct snd_ac97 * ac97)
769{ 769{
770 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff); 770 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff);
771 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff); 771 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff);
772} 772}
773 773
774static void patch_wolfson_wm9713_resume (ac97_t * ac97) 774static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97)
775{ 775{
776 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); 776 snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00);
777 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); 777 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810);
@@ -788,7 +788,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
788#endif 788#endif
789}; 789};
790 790
791int patch_wolfson13(ac97_t * ac97) 791int patch_wolfson13(struct snd_ac97 * ac97)
792{ 792{
793 /* WM9713, WM9714 */ 793 /* WM9713, WM9714 */
794 ac97->build_ops = &patch_wolfson_wm9713_ops; 794 ac97->build_ops = &patch_wolfson_wm9713_ops;
@@ -808,7 +808,7 @@ int patch_wolfson13(ac97_t * ac97)
808/* 808/*
809 * Tritech codec 809 * Tritech codec
810 */ 810 */
811int patch_tritech_tr28028(ac97_t * ac97) 811int patch_tritech_tr28028(struct snd_ac97 * ac97)
812{ 812{
813 snd_ac97_write_cache(ac97, 0x26, 0x0300); 813 snd_ac97_write_cache(ac97, 0x26, 0x0300);
814 snd_ac97_write_cache(ac97, 0x26, 0x0000); 814 snd_ac97_write_cache(ac97, 0x26, 0x0000);
@@ -820,9 +820,9 @@ int patch_tritech_tr28028(ac97_t * ac97)
820/* 820/*
821 * Sigmatel STAC97xx codecs 821 * Sigmatel STAC97xx codecs
822 */ 822 */
823static int patch_sigmatel_stac9700_3d(ac97_t * ac97) 823static int patch_sigmatel_stac9700_3d(struct snd_ac97 * ac97)
824{ 824{
825 snd_kcontrol_t *kctl; 825 struct snd_kcontrol *kctl;
826 int err; 826 int err;
827 827
828 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 828 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
@@ -833,9 +833,9 @@ static int patch_sigmatel_stac9700_3d(ac97_t * ac97)
833 return 0; 833 return 0;
834} 834}
835 835
836static int patch_sigmatel_stac9708_3d(ac97_t * ac97) 836static int patch_sigmatel_stac9708_3d(struct snd_ac97 * ac97)
837{ 837{
838 snd_kcontrol_t *kctl; 838 struct snd_kcontrol *kctl;
839 int err; 839 int err;
840 840
841 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 841 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
@@ -850,18 +850,18 @@ static int patch_sigmatel_stac9708_3d(ac97_t * ac97)
850 return 0; 850 return 0;
851} 851}
852 852
853static const snd_kcontrol_new_t snd_ac97_sigmatel_4speaker = 853static const struct snd_kcontrol_new snd_ac97_sigmatel_4speaker =
854AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch", AC97_SIGMATEL_DAC2INVERT, 2, 1, 0); 854AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch", AC97_SIGMATEL_DAC2INVERT, 2, 1, 0);
855 855
856static const snd_kcontrol_new_t snd_ac97_sigmatel_phaseinvert = 856static const struct snd_kcontrol_new snd_ac97_sigmatel_phaseinvert =
857AC97_SINGLE("Sigmatel Surround Phase Inversion Playback Switch", AC97_SIGMATEL_DAC2INVERT, 3, 1, 0); 857AC97_SINGLE("Sigmatel Surround Phase Inversion Playback Switch", AC97_SIGMATEL_DAC2INVERT, 3, 1, 0);
858 858
859static const snd_kcontrol_new_t snd_ac97_sigmatel_controls[] = { 859static const struct snd_kcontrol_new snd_ac97_sigmatel_controls[] = {
860AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0), 860AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0),
861AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0) 861AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0)
862}; 862};
863 863
864static int patch_sigmatel_stac97xx_specific(ac97_t * ac97) 864static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97)
865{ 865{
866 int err; 866 int err;
867 867
@@ -886,15 +886,15 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
886 .build_specific = patch_sigmatel_stac97xx_specific 886 .build_specific = patch_sigmatel_stac97xx_specific
887}; 887};
888 888
889int patch_sigmatel_stac9700(ac97_t * ac97) 889int patch_sigmatel_stac9700(struct snd_ac97 * ac97)
890{ 890{
891 ac97->build_ops = &patch_sigmatel_stac9700_ops; 891 ac97->build_ops = &patch_sigmatel_stac9700_ops;
892 return 0; 892 return 0;
893} 893}
894 894
895static int snd_ac97_stac9708_put_bias(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 895static int snd_ac97_stac9708_put_bias(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
896{ 896{
897 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 897 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
898 int err; 898 int err;
899 899
900 down(&ac97->page_mutex); 900 down(&ac97->page_mutex);
@@ -906,7 +906,7 @@ static int snd_ac97_stac9708_put_bias(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
906 return err; 906 return err;
907} 907}
908 908
909static const snd_kcontrol_new_t snd_ac97_stac9708_bias_control = { 909static const struct snd_kcontrol_new snd_ac97_stac9708_bias_control = {
910 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 910 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
911 .name = "Sigmatel Output Bias Switch", 911 .name = "Sigmatel Output Bias Switch",
912 .info = snd_ac97_info_volsw, 912 .info = snd_ac97_info_volsw,
@@ -915,7 +915,7 @@ static const snd_kcontrol_new_t snd_ac97_stac9708_bias_control = {
915 .private_value = AC97_SINGLE_VALUE(AC97_SIGMATEL_BIAS2, 4, 1, 0), 915 .private_value = AC97_SINGLE_VALUE(AC97_SIGMATEL_BIAS2, 4, 1, 0),
916}; 916};
917 917
918static int patch_sigmatel_stac9708_specific(ac97_t *ac97) 918static int patch_sigmatel_stac9708_specific(struct snd_ac97 *ac97)
919{ 919{
920 int err; 920 int err;
921 921
@@ -930,7 +930,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
930 .build_specific = patch_sigmatel_stac9708_specific 930 .build_specific = patch_sigmatel_stac9708_specific
931}; 931};
932 932
933int patch_sigmatel_stac9708(ac97_t * ac97) 933int patch_sigmatel_stac9708(struct snd_ac97 * ac97)
934{ 934{
935 unsigned int codec72, codec6c; 935 unsigned int codec72, codec6c;
936 936
@@ -956,7 +956,7 @@ int patch_sigmatel_stac9708(ac97_t * ac97)
956 return 0; 956 return 0;
957} 957}
958 958
959int patch_sigmatel_stac9721(ac97_t * ac97) 959int patch_sigmatel_stac9721(struct snd_ac97 * ac97)
960{ 960{
961 ac97->build_ops = &patch_sigmatel_stac9700_ops; 961 ac97->build_ops = &patch_sigmatel_stac9700_ops;
962 if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) { 962 if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) {
@@ -970,7 +970,7 @@ int patch_sigmatel_stac9721(ac97_t * ac97)
970 return 0; 970 return 0;
971} 971}
972 972
973int patch_sigmatel_stac9744(ac97_t * ac97) 973int patch_sigmatel_stac9744(struct snd_ac97 * ac97)
974{ 974{
975 // patch for SigmaTel 975 // patch for SigmaTel
976 ac97->build_ops = &patch_sigmatel_stac9700_ops; 976 ac97->build_ops = &patch_sigmatel_stac9700_ops;
@@ -982,7 +982,7 @@ int patch_sigmatel_stac9744(ac97_t * ac97)
982 return 0; 982 return 0;
983} 983}
984 984
985int patch_sigmatel_stac9756(ac97_t * ac97) 985int patch_sigmatel_stac9756(struct snd_ac97 * ac97)
986{ 986{
987 // patch for SigmaTel 987 // patch for SigmaTel
988 ac97->build_ops = &patch_sigmatel_stac9700_ops; 988 ac97->build_ops = &patch_sigmatel_stac9700_ops;
@@ -994,7 +994,7 @@ int patch_sigmatel_stac9756(ac97_t * ac97)
994 return 0; 994 return 0;
995} 995}
996 996
997static int snd_ac97_stac9758_output_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 997static int snd_ac97_stac9758_output_jack_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
998{ 998{
999 static char *texts[5] = { "Input/Disabled", "Front Output", 999 static char *texts[5] = { "Input/Disabled", "Front Output",
1000 "Rear Output", "Center/LFE Output", "Mixer Output" }; 1000 "Rear Output", "Center/LFE Output", "Mixer Output" };
@@ -1008,9 +1008,9 @@ static int snd_ac97_stac9758_output_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_
1008 return 0; 1008 return 0;
1009} 1009}
1010 1010
1011static int snd_ac97_stac9758_output_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) 1011static int snd_ac97_stac9758_output_jack_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1012{ 1012{
1013 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1013 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1014 int shift = kcontrol->private_value; 1014 int shift = kcontrol->private_value;
1015 unsigned short val; 1015 unsigned short val;
1016 1016
@@ -1022,9 +1022,9 @@ static int snd_ac97_stac9758_output_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_e
1022 return 0; 1022 return 0;
1023} 1023}
1024 1024
1025static int snd_ac97_stac9758_output_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1025static int snd_ac97_stac9758_output_jack_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1026{ 1026{
1027 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1027 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1028 int shift = kcontrol->private_value; 1028 int shift = kcontrol->private_value;
1029 unsigned short val; 1029 unsigned short val;
1030 1030
@@ -1038,7 +1038,7 @@ static int snd_ac97_stac9758_output_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_e
1038 7 << shift, val << shift, 0); 1038 7 << shift, val << shift, 0);
1039} 1039}
1040 1040
1041static int snd_ac97_stac9758_input_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 1041static int snd_ac97_stac9758_input_jack_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1042{ 1042{
1043 static char *texts[7] = { "Mic2 Jack", "Mic1 Jack", "Line In Jack", 1043 static char *texts[7] = { "Mic2 Jack", "Mic1 Jack", "Line In Jack",
1044 "Front Jack", "Rear Jack", "Center/LFE Jack", "Mute" }; 1044 "Front Jack", "Rear Jack", "Center/LFE Jack", "Mute" };
@@ -1052,9 +1052,9 @@ static int snd_ac97_stac9758_input_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_e
1052 return 0; 1052 return 0;
1053} 1053}
1054 1054
1055static int snd_ac97_stac9758_input_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) 1055static int snd_ac97_stac9758_input_jack_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1056{ 1056{
1057 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1057 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1058 int shift = kcontrol->private_value; 1058 int shift = kcontrol->private_value;
1059 unsigned short val; 1059 unsigned short val;
1060 1060
@@ -1063,16 +1063,16 @@ static int snd_ac97_stac9758_input_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_el
1063 return 0; 1063 return 0;
1064} 1064}
1065 1065
1066static int snd_ac97_stac9758_input_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1066static int snd_ac97_stac9758_input_jack_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1067{ 1067{
1068 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1068 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1069 int shift = kcontrol->private_value; 1069 int shift = kcontrol->private_value;
1070 1070
1071 return ac97_update_bits_page(ac97, AC97_SIGMATEL_INSEL, 7 << shift, 1071 return ac97_update_bits_page(ac97, AC97_SIGMATEL_INSEL, 7 << shift,
1072 ucontrol->value.enumerated.item[0] << shift, 0); 1072 ucontrol->value.enumerated.item[0] << shift, 0);
1073} 1073}
1074 1074
1075static int snd_ac97_stac9758_phonesel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 1075static int snd_ac97_stac9758_phonesel_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1076{ 1076{
1077 static char *texts[3] = { "None", "Front Jack", "Rear Jack" }; 1077 static char *texts[3] = { "None", "Front Jack", "Rear Jack" };
1078 1078
@@ -1085,17 +1085,17 @@ static int snd_ac97_stac9758_phonesel_info(snd_kcontrol_t *kcontrol, snd_ctl_ele
1085 return 0; 1085 return 0;
1086} 1086}
1087 1087
1088static int snd_ac97_stac9758_phonesel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) 1088static int snd_ac97_stac9758_phonesel_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1089{ 1089{
1090 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1090 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1091 1091
1092 ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3; 1092 ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3;
1093 return 0; 1093 return 0;
1094} 1094}
1095 1095
1096static int snd_ac97_stac9758_phonesel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1096static int snd_ac97_stac9758_phonesel_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1097{ 1097{
1098 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1098 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1099 1099
1100 return ac97_update_bits_page(ac97, AC97_SIGMATEL_IOMISC, 3, 1100 return ac97_update_bits_page(ac97, AC97_SIGMATEL_IOMISC, 3,
1101 ucontrol->value.enumerated.item[0], 0); 1101 ucontrol->value.enumerated.item[0], 0);
@@ -1113,7 +1113,7 @@ static int snd_ac97_stac9758_phonesel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem
1113 .get = snd_ac97_stac9758_input_jack_get, \ 1113 .get = snd_ac97_stac9758_input_jack_get, \
1114 .put = snd_ac97_stac9758_input_jack_put, \ 1114 .put = snd_ac97_stac9758_input_jack_put, \
1115 .private_value = shift } 1115 .private_value = shift }
1116static const snd_kcontrol_new_t snd_ac97_sigmatel_stac9758_controls[] = { 1116static const struct snd_kcontrol_new snd_ac97_sigmatel_stac9758_controls[] = {
1117 STAC9758_OUTPUT_JACK("Mic1 Jack", 1), 1117 STAC9758_OUTPUT_JACK("Mic1 Jack", 1),
1118 STAC9758_OUTPUT_JACK("LineIn Jack", 4), 1118 STAC9758_OUTPUT_JACK("LineIn Jack", 4),
1119 STAC9758_OUTPUT_JACK("Front Jack", 7), 1119 STAC9758_OUTPUT_JACK("Front Jack", 7),
@@ -1132,7 +1132,7 @@ static const snd_kcontrol_new_t snd_ac97_sigmatel_stac9758_controls[] = {
1132 AC97_SINGLE("Headphone +3dB Boost", AC97_SIGMATEL_IOMISC, 8, 1, 0) 1132 AC97_SINGLE("Headphone +3dB Boost", AC97_SIGMATEL_IOMISC, 8, 1, 0)
1133}; 1133};
1134 1134
1135static int patch_sigmatel_stac9758_specific(ac97_t *ac97) 1135static int patch_sigmatel_stac9758_specific(struct snd_ac97 *ac97)
1136{ 1136{
1137 int err; 1137 int err;
1138 1138
@@ -1159,7 +1159,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
1159 .build_specific = patch_sigmatel_stac9758_specific 1159 .build_specific = patch_sigmatel_stac9758_specific
1160}; 1160};
1161 1161
1162int patch_sigmatel_stac9758(ac97_t * ac97) 1162int patch_sigmatel_stac9758(struct snd_ac97 * ac97)
1163{ 1163{
1164 static unsigned short regs[4] = { 1164 static unsigned short regs[4] = {
1165 AC97_SIGMATEL_OUTSEL, 1165 AC97_SIGMATEL_OUTSEL,
@@ -1202,12 +1202,12 @@ int patch_sigmatel_stac9758(ac97_t * ac97)
1202/* 1202/*
1203 * Cirrus Logic CS42xx codecs 1203 * Cirrus Logic CS42xx codecs
1204 */ 1204 */
1205static const snd_kcontrol_new_t snd_ac97_cirrus_controls_spdif[2] = { 1205static const struct snd_kcontrol_new snd_ac97_cirrus_controls_spdif[2] = {
1206 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CSR_SPDIF, 15, 1, 0), 1206 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CSR_SPDIF, 15, 1, 0),
1207 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0) 1207 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0)
1208}; 1208};
1209 1209
1210static int patch_cirrus_build_spdif(ac97_t * ac97) 1210static int patch_cirrus_build_spdif(struct snd_ac97 * ac97)
1211{ 1211{
1212 int err; 1212 int err;
1213 1213
@@ -1233,7 +1233,7 @@ static struct snd_ac97_build_ops patch_cirrus_ops = {
1233 .build_spdif = patch_cirrus_build_spdif 1233 .build_spdif = patch_cirrus_build_spdif
1234}; 1234};
1235 1235
1236int patch_cirrus_spdif(ac97_t * ac97) 1236int patch_cirrus_spdif(struct snd_ac97 * ac97)
1237{ 1237{
1238 /* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers. 1238 /* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers.
1239 WHY CAN'T ANYONE FOLLOW THE BLOODY SPEC? *sigh* 1239 WHY CAN'T ANYONE FOLLOW THE BLOODY SPEC? *sigh*
@@ -1254,7 +1254,7 @@ int patch_cirrus_spdif(ac97_t * ac97)
1254 return 0; 1254 return 0;
1255} 1255}
1256 1256
1257int patch_cirrus_cs4299(ac97_t * ac97) 1257int patch_cirrus_cs4299(struct snd_ac97 * ac97)
1258{ 1258{
1259 /* force the detection of PC Beep */ 1259 /* force the detection of PC Beep */
1260 ac97->flags |= AC97_HAS_PC_BEEP; 1260 ac97->flags |= AC97_HAS_PC_BEEP;
@@ -1265,11 +1265,11 @@ int patch_cirrus_cs4299(ac97_t * ac97)
1265/* 1265/*
1266 * Conexant codecs 1266 * Conexant codecs
1267 */ 1267 */
1268static const snd_kcontrol_new_t snd_ac97_conexant_controls_spdif[1] = { 1268static const struct snd_kcontrol_new snd_ac97_conexant_controls_spdif[1] = {
1269 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CXR_AUDIO_MISC, 3, 1, 0), 1269 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CXR_AUDIO_MISC, 3, 1, 0),
1270}; 1270};
1271 1271
1272static int patch_conexant_build_spdif(ac97_t * ac97) 1272static int patch_conexant_build_spdif(struct snd_ac97 * ac97)
1273{ 1273{
1274 int err; 1274 int err;
1275 1275
@@ -1290,7 +1290,7 @@ static struct snd_ac97_build_ops patch_conexant_ops = {
1290 .build_spdif = patch_conexant_build_spdif 1290 .build_spdif = patch_conexant_build_spdif
1291}; 1291};
1292 1292
1293int patch_conexant(ac97_t * ac97) 1293int patch_conexant(struct snd_ac97 * ac97)
1294{ 1294{
1295 ac97->build_ops = &patch_conexant_ops; 1295 ac97->build_ops = &patch_conexant_ops;
1296 ac97->flags |= AC97_CX_SPDIF; 1296 ac97->flags |= AC97_CX_SPDIF;
@@ -1303,7 +1303,7 @@ int patch_conexant(ac97_t * ac97)
1303 * Analog Device AD18xx, AD19xx codecs 1303 * Analog Device AD18xx, AD19xx codecs
1304 */ 1304 */
1305#ifdef CONFIG_PM 1305#ifdef CONFIG_PM
1306static void ad18xx_resume(ac97_t *ac97) 1306static void ad18xx_resume(struct snd_ac97 *ac97)
1307{ 1307{
1308 static unsigned short setup_regs[] = { 1308 static unsigned short setup_regs[] = {
1309 AC97_AD_MISC, AC97_AD_SERIAL_CFG, AC97_AD_JACK_SPDIF, 1309 AC97_AD_MISC, AC97_AD_SERIAL_CFG, AC97_AD_JACK_SPDIF,
@@ -1367,7 +1367,7 @@ static void ad18xx_resume(ac97_t *ac97)
1367} 1367}
1368#endif 1368#endif
1369 1369
1370int patch_ad1819(ac97_t * ac97) 1370int patch_ad1819(struct snd_ac97 * ac97)
1371{ 1371{
1372 unsigned short scfg; 1372 unsigned short scfg;
1373 1373
@@ -1377,7 +1377,7 @@ int patch_ad1819(ac97_t * ac97)
1377 return 0; 1377 return 0;
1378} 1378}
1379 1379
1380static unsigned short patch_ad1881_unchained(ac97_t * ac97, int idx, unsigned short mask) 1380static unsigned short patch_ad1881_unchained(struct snd_ac97 * ac97, int idx, unsigned short mask)
1381{ 1381{
1382 unsigned short val; 1382 unsigned short val;
1383 1383
@@ -1393,7 +1393,7 @@ static unsigned short patch_ad1881_unchained(ac97_t * ac97, int idx, unsigned sh
1393 return mask; 1393 return mask;
1394} 1394}
1395 1395
1396static int patch_ad1881_chained1(ac97_t * ac97, int idx, unsigned short codec_bits) 1396static int patch_ad1881_chained1(struct snd_ac97 * ac97, int idx, unsigned short codec_bits)
1397{ 1397{
1398 static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; 1398 static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 };
1399 unsigned short val; 1399 unsigned short val;
@@ -1411,7 +1411,7 @@ static int patch_ad1881_chained1(ac97_t * ac97, int idx, unsigned short codec_bi
1411 return 1; 1411 return 1;
1412} 1412}
1413 1413
1414static void patch_ad1881_chained(ac97_t * ac97, int unchained_idx, int cidx1, int cidx2) 1414static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int cidx1, int cidx2)
1415{ 1415{
1416 // already detected? 1416 // already detected?
1417 if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1]) 1417 if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1])
@@ -1441,7 +1441,7 @@ static struct snd_ac97_build_ops patch_ad1881_build_ops = {
1441#endif 1441#endif
1442}; 1442};
1443 1443
1444int patch_ad1881(ac97_t * ac97) 1444int patch_ad1881(struct snd_ac97 * ac97)
1445{ 1445{
1446 static const char cfg_idxs[3][2] = { 1446 static const char cfg_idxs[3][2] = {
1447 {2, 1}, 1447 {2, 1},
@@ -1500,7 +1500,7 @@ int patch_ad1881(ac97_t * ac97)
1500 return 0; 1500 return 0;
1501} 1501}
1502 1502
1503static const snd_kcontrol_new_t snd_ac97_controls_ad1885[] = { 1503static const struct snd_kcontrol_new snd_ac97_controls_ad1885[] = {
1504 AC97_SINGLE("Digital Mono Direct", AC97_AD_MISC, 11, 1, 0), 1504 AC97_SINGLE("Digital Mono Direct", AC97_AD_MISC, 11, 1, 0),
1505 /* AC97_SINGLE("Digital Audio Mode", AC97_AD_MISC, 12, 1, 0), */ /* seems problematic */ 1505 /* AC97_SINGLE("Digital Audio Mode", AC97_AD_MISC, 12, 1, 0), */ /* seems problematic */
1506 AC97_SINGLE("Low Power Mixer", AC97_AD_MISC, 14, 1, 0), 1506 AC97_SINGLE("Low Power Mixer", AC97_AD_MISC, 14, 1, 0),
@@ -1509,7 +1509,7 @@ static const snd_kcontrol_new_t snd_ac97_controls_ad1885[] = {
1509 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 8, 1, 1), /* inverted */ 1509 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 8, 1, 1), /* inverted */
1510}; 1510};
1511 1511
1512static int patch_ad1885_specific(ac97_t * ac97) 1512static int patch_ad1885_specific(struct snd_ac97 * ac97)
1513{ 1513{
1514 int err; 1514 int err;
1515 1515
@@ -1525,7 +1525,7 @@ static struct snd_ac97_build_ops patch_ad1885_build_ops = {
1525#endif 1525#endif
1526}; 1526};
1527 1527
1528int patch_ad1885(ac97_t * ac97) 1528int patch_ad1885(struct snd_ac97 * ac97)
1529{ 1529{
1530 patch_ad1881(ac97); 1530 patch_ad1881(ac97);
1531 /* This is required to deal with the Intel D815EEAL2 */ 1531 /* This is required to deal with the Intel D815EEAL2 */
@@ -1538,7 +1538,7 @@ int patch_ad1885(ac97_t * ac97)
1538 return 0; 1538 return 0;
1539} 1539}
1540 1540
1541int patch_ad1886(ac97_t * ac97) 1541int patch_ad1886(struct snd_ac97 * ac97)
1542{ 1542{
1543 patch_ad1881(ac97); 1543 patch_ad1881(ac97);
1544 /* Presario700 workaround */ 1544 /* Presario700 workaround */
@@ -1569,7 +1569,7 @@ int patch_ad1886(ac97_t * ac97)
1569#define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */ 1569#define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */
1570 1570
1571 1571
1572static int snd_ac97_ad198x_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1572static int snd_ac97_ad198x_spdif_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1573{ 1573{
1574 static char *texts[2] = { "AC-Link", "A/D Converter" }; 1574 static char *texts[2] = { "AC-Link", "A/D Converter" };
1575 1575
@@ -1582,9 +1582,9 @@ static int snd_ac97_ad198x_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_e
1582 return 0; 1582 return 0;
1583} 1583}
1584 1584
1585static int snd_ac97_ad198x_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1585static int snd_ac97_ad198x_spdif_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1586{ 1586{
1587 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1587 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1588 unsigned short val; 1588 unsigned short val;
1589 1589
1590 val = ac97->regs[AC97_AD_SERIAL_CFG]; 1590 val = ac97->regs[AC97_AD_SERIAL_CFG];
@@ -1592,9 +1592,9 @@ static int snd_ac97_ad198x_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_e
1592 return 0; 1592 return 0;
1593} 1593}
1594 1594
1595static int snd_ac97_ad198x_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1595static int snd_ac97_ad198x_spdif_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1596{ 1596{
1597 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1597 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1598 unsigned short val; 1598 unsigned short val;
1599 1599
1600 if (ucontrol->value.enumerated.item[0] > 1) 1600 if (ucontrol->value.enumerated.item[0] > 1)
@@ -1603,7 +1603,7 @@ static int snd_ac97_ad198x_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_e
1603 return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val); 1603 return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val);
1604} 1604}
1605 1605
1606static const snd_kcontrol_new_t snd_ac97_ad198x_spdif_source = { 1606static const struct snd_kcontrol_new snd_ac97_ad198x_spdif_source = {
1607 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1607 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1608 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", 1608 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
1609 .info = snd_ac97_ad198x_spdif_source_info, 1609 .info = snd_ac97_ad198x_spdif_source_info,
@@ -1611,17 +1611,17 @@ static const snd_kcontrol_new_t snd_ac97_ad198x_spdif_source = {
1611 .put = snd_ac97_ad198x_spdif_source_put, 1611 .put = snd_ac97_ad198x_spdif_source_put,
1612}; 1612};
1613 1613
1614static int patch_ad198x_post_spdif(ac97_t * ac97) 1614static int patch_ad198x_post_spdif(struct snd_ac97 * ac97)
1615{ 1615{
1616 return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1); 1616 return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1);
1617} 1617}
1618 1618
1619static const snd_kcontrol_new_t snd_ac97_ad1981x_jack_sense[] = { 1619static const struct snd_kcontrol_new snd_ac97_ad1981x_jack_sense[] = {
1620 AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 11, 1, 0), 1620 AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 11, 1, 0),
1621 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), 1621 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0),
1622}; 1622};
1623 1623
1624static int patch_ad1981a_specific(ac97_t * ac97) 1624static int patch_ad1981a_specific(struct snd_ac97 * ac97)
1625{ 1625{
1626 return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, 1626 return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense,
1627 ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); 1627 ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
@@ -1635,7 +1635,7 @@ static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
1635#endif 1635#endif
1636}; 1636};
1637 1637
1638static void check_ad1981_hp_jack_sense(ac97_t *ac97) 1638static void check_ad1981_hp_jack_sense(struct snd_ac97 *ac97)
1639{ 1639{
1640 u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; 1640 u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device;
1641 switch (subid) { 1641 switch (subid) {
@@ -1649,7 +1649,7 @@ static void check_ad1981_hp_jack_sense(ac97_t *ac97)
1649 } 1649 }
1650} 1650}
1651 1651
1652int patch_ad1981a(ac97_t *ac97) 1652int patch_ad1981a(struct snd_ac97 *ac97)
1653{ 1653{
1654 patch_ad1881(ac97); 1654 patch_ad1881(ac97);
1655 ac97->build_ops = &patch_ad1981a_build_ops; 1655 ac97->build_ops = &patch_ad1981a_build_ops;
@@ -1659,10 +1659,10 @@ int patch_ad1981a(ac97_t *ac97)
1659 return 0; 1659 return 0;
1660} 1660}
1661 1661
1662static const snd_kcontrol_new_t snd_ac97_ad198x_2cmic = 1662static const struct snd_kcontrol_new snd_ac97_ad198x_2cmic =
1663AC97_SINGLE("Stereo Mic", AC97_AD_MISC, 6, 1, 0); 1663AC97_SINGLE("Stereo Mic", AC97_AD_MISC, 6, 1, 0);
1664 1664
1665static int patch_ad1981b_specific(ac97_t *ac97) 1665static int patch_ad1981b_specific(struct snd_ac97 *ac97)
1666{ 1666{
1667 int err; 1667 int err;
1668 1668
@@ -1680,7 +1680,7 @@ static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
1680#endif 1680#endif
1681}; 1681};
1682 1682
1683int patch_ad1981b(ac97_t *ac97) 1683int patch_ad1981b(struct snd_ac97 *ac97)
1684{ 1684{
1685 patch_ad1881(ac97); 1685 patch_ad1881(ac97);
1686 ac97->build_ops = &patch_ad1981b_build_ops; 1686 ac97->build_ops = &patch_ad1981b_build_ops;
@@ -1690,7 +1690,7 @@ int patch_ad1981b(ac97_t *ac97)
1690 return 0; 1690 return 0;
1691} 1691}
1692 1692
1693static int snd_ac97_ad1888_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 1693static int snd_ac97_ad1888_lohpsel_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1694{ 1694{
1695 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1695 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1696 uinfo->count = 1; 1696 uinfo->count = 1;
@@ -1699,9 +1699,9 @@ static int snd_ac97_ad1888_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
1699 return 0; 1699 return 0;
1700} 1700}
1701 1701
1702static int snd_ac97_ad1888_lohpsel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) 1702static int snd_ac97_ad1888_lohpsel_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1703{ 1703{
1704 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1704 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1705 unsigned short val; 1705 unsigned short val;
1706 1706
1707 val = ac97->regs[AC97_AD_MISC]; 1707 val = ac97->regs[AC97_AD_MISC];
@@ -1709,9 +1709,9 @@ static int snd_ac97_ad1888_lohpsel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
1709 return 0; 1709 return 0;
1710} 1710}
1711 1711
1712static int snd_ac97_ad1888_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1712static int snd_ac97_ad1888_lohpsel_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1713{ 1713{
1714 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1714 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1715 unsigned short val; 1715 unsigned short val;
1716 1716
1717 val = !ucontrol->value.integer.value[0] 1717 val = !ucontrol->value.integer.value[0]
@@ -1720,7 +1720,7 @@ static int snd_ac97_ad1888_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
1720 AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val); 1720 AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val);
1721} 1721}
1722 1722
1723static int snd_ac97_ad1888_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 1723static int snd_ac97_ad1888_downmix_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1724{ 1724{
1725 static char *texts[3] = {"Off", "6 -> 4", "6 -> 2"}; 1725 static char *texts[3] = {"Off", "6 -> 4", "6 -> 2"};
1726 1726
@@ -1733,9 +1733,9 @@ static int snd_ac97_ad1888_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
1733 return 0; 1733 return 0;
1734} 1734}
1735 1735
1736static int snd_ac97_ad1888_downmix_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) 1736static int snd_ac97_ad1888_downmix_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1737{ 1737{
1738 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1738 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1739 unsigned short val; 1739 unsigned short val;
1740 1740
1741 val = ac97->regs[AC97_AD_MISC]; 1741 val = ac97->regs[AC97_AD_MISC];
@@ -1746,9 +1746,9 @@ static int snd_ac97_ad1888_downmix_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
1746 return 0; 1746 return 0;
1747} 1747}
1748 1748
1749static int snd_ac97_ad1888_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1749static int snd_ac97_ad1888_downmix_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1750{ 1750{
1751 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 1751 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
1752 unsigned short val; 1752 unsigned short val;
1753 1753
1754 if (ucontrol->value.enumerated.item[0] > 2) 1754 if (ucontrol->value.enumerated.item[0] > 2)
@@ -1762,7 +1762,7 @@ static int snd_ac97_ad1888_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
1762 AC97_AD198X_DMIX0 | AC97_AD198X_DMIX1, val); 1762 AC97_AD198X_DMIX0 | AC97_AD198X_DMIX1, val);
1763} 1763}
1764 1764
1765static void ad1888_update_jacks(ac97_t *ac97) 1765static void ad1888_update_jacks(struct snd_ac97 *ac97)
1766{ 1766{
1767 unsigned short val = 0; 1767 unsigned short val = 0;
1768 if (! is_shared_linein(ac97)) 1768 if (! is_shared_linein(ac97))
@@ -1773,7 +1773,7 @@ static void ad1888_update_jacks(ac97_t *ac97)
1773 snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val); 1773 snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val);
1774} 1774}
1775 1775
1776static const snd_kcontrol_new_t snd_ac97_ad1888_controls[] = { 1776static const struct snd_kcontrol_new snd_ac97_ad1888_controls[] = {
1777 { 1777 {
1778 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1778 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1779 .name = "Exchange Front/Surround", 1779 .name = "Exchange Front/Surround",
@@ -1796,7 +1796,7 @@ static const snd_kcontrol_new_t snd_ac97_ad1888_controls[] = {
1796 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), 1796 AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0),
1797}; 1797};
1798 1798
1799static int patch_ad1888_specific(ac97_t *ac97) 1799static int patch_ad1888_specific(struct snd_ac97 *ac97)
1800{ 1800{
1801 /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ 1801 /* rename 0x04 as "Master" and 0x02 as "Master Surround" */
1802 snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Master Surround Playback"); 1802 snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Master Surround Playback");
@@ -1813,7 +1813,7 @@ static struct snd_ac97_build_ops patch_ad1888_build_ops = {
1813 .update_jacks = ad1888_update_jacks, 1813 .update_jacks = ad1888_update_jacks,
1814}; 1814};
1815 1815
1816int patch_ad1888(ac97_t * ac97) 1816int patch_ad1888(struct snd_ac97 * ac97)
1817{ 1817{
1818 unsigned short misc; 1818 unsigned short misc;
1819 1819
@@ -1833,7 +1833,7 @@ int patch_ad1888(ac97_t * ac97)
1833 return 0; 1833 return 0;
1834} 1834}
1835 1835
1836static int patch_ad1980_specific(ac97_t *ac97) 1836static int patch_ad1980_specific(struct snd_ac97 *ac97)
1837{ 1837{
1838 int err; 1838 int err;
1839 1839
@@ -1851,25 +1851,25 @@ static struct snd_ac97_build_ops patch_ad1980_build_ops = {
1851 .update_jacks = ad1888_update_jacks, 1851 .update_jacks = ad1888_update_jacks,
1852}; 1852};
1853 1853
1854int patch_ad1980(ac97_t * ac97) 1854int patch_ad1980(struct snd_ac97 * ac97)
1855{ 1855{
1856 patch_ad1888(ac97); 1856 patch_ad1888(ac97);
1857 ac97->build_ops = &patch_ad1980_build_ops; 1857 ac97->build_ops = &patch_ad1980_build_ops;
1858 return 0; 1858 return 0;
1859} 1859}
1860 1860
1861static const snd_kcontrol_new_t snd_ac97_ad1985_controls[] = { 1861static const struct snd_kcontrol_new snd_ac97_ad1985_controls[] = {
1862 AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0) 1862 AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0)
1863}; 1863};
1864 1864
1865static void ad1985_update_jacks(ac97_t *ac97) 1865static void ad1985_update_jacks(struct snd_ac97 *ac97)
1866{ 1866{
1867 ad1888_update_jacks(ac97); 1867 ad1888_update_jacks(ac97);
1868 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9, 1868 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9,
1869 is_shared_micin(ac97) ? 0 : 1 << 9); 1869 is_shared_micin(ac97) ? 0 : 1 << 9);
1870} 1870}
1871 1871
1872static int patch_ad1985_specific(ac97_t *ac97) 1872static int patch_ad1985_specific(struct snd_ac97 *ac97)
1873{ 1873{
1874 int err; 1874 int err;
1875 1875
@@ -1887,7 +1887,7 @@ static struct snd_ac97_build_ops patch_ad1985_build_ops = {
1887 .update_jacks = ad1985_update_jacks, 1887 .update_jacks = ad1985_update_jacks,
1888}; 1888};
1889 1889
1890int patch_ad1985(ac97_t * ac97) 1890int patch_ad1985(struct snd_ac97 * ac97)
1891{ 1891{
1892 unsigned short misc; 1892 unsigned short misc;
1893 1893
@@ -1916,7 +1916,7 @@ int patch_ad1985(ac97_t * ac97)
1916/* 1916/*
1917 * realtek ALC65x/850 codecs 1917 * realtek ALC65x/850 codecs
1918 */ 1918 */
1919static void alc650_update_jacks(ac97_t *ac97) 1919static void alc650_update_jacks(struct snd_ac97 *ac97)
1920{ 1920{
1921 int shared; 1921 int shared;
1922 1922
@@ -1937,7 +1937,7 @@ static void alc650_update_jacks(ac97_t *ac97)
1937 shared ? 0 : 0x100); 1937 shared ? 0 : 0x100);
1938} 1938}
1939 1939
1940static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = { 1940static const struct snd_kcontrol_new snd_ac97_controls_alc650[] = {
1941 AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0), 1941 AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0),
1942 AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0), 1942 AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0),
1943 AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0), 1943 AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0),
@@ -1963,14 +1963,14 @@ static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = {
1963 AC97_CHANNEL_MODE_CTL, 1963 AC97_CHANNEL_MODE_CTL,
1964}; 1964};
1965 1965
1966static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc650[] = { 1966static const struct snd_kcontrol_new snd_ac97_spdif_controls_alc650[] = {
1967 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0), 1967 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0),
1968 AC97_SINGLE("Analog to IEC958 Output", AC97_ALC650_MULTICH, 12, 1, 0), 1968 AC97_SINGLE("Analog to IEC958 Output", AC97_ALC650_MULTICH, 12, 1, 0),
1969 /* disable this controls since it doesn't work as expected */ 1969 /* disable this controls since it doesn't work as expected */
1970 /* AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 13, 1, 0), */ 1970 /* AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 13, 1, 0), */
1971}; 1971};
1972 1972
1973static int patch_alc650_specific(ac97_t * ac97) 1973static int patch_alc650_specific(struct snd_ac97 * ac97)
1974{ 1974{
1975 int err; 1975 int err;
1976 1976
@@ -1988,7 +1988,7 @@ static struct snd_ac97_build_ops patch_alc650_ops = {
1988 .update_jacks = alc650_update_jacks 1988 .update_jacks = alc650_update_jacks
1989}; 1989};
1990 1990
1991int patch_alc650(ac97_t * ac97) 1991int patch_alc650(struct snd_ac97 * ac97)
1992{ 1992{
1993 unsigned short val; 1993 unsigned short val;
1994 1994
@@ -2043,7 +2043,7 @@ int patch_alc650(ac97_t * ac97)
2043 return 0; 2043 return 0;
2044} 2044}
2045 2045
2046static void alc655_update_jacks(ac97_t *ac97) 2046static void alc655_update_jacks(struct snd_ac97 *ac97)
2047{ 2047{
2048 int shared; 2048 int shared;
2049 2049
@@ -2060,17 +2060,17 @@ static void alc655_update_jacks(ac97_t *ac97)
2060 shared ? (1 << 10) : 0, 0); 2060 shared ? (1 << 10) : 0, 0);
2061} 2061}
2062 2062
2063static const snd_kcontrol_new_t snd_ac97_controls_alc655[] = { 2063static const struct snd_kcontrol_new snd_ac97_controls_alc655[] = {
2064 AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0), 2064 AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0),
2065 AC97_SURROUND_JACK_MODE_CTL, 2065 AC97_SURROUND_JACK_MODE_CTL,
2066 AC97_CHANNEL_MODE_CTL, 2066 AC97_CHANNEL_MODE_CTL,
2067}; 2067};
2068 2068
2069static int alc655_iec958_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 2069static int alc655_iec958_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2070{ 2070{
2071 static char *texts_655[3] = { "PCM", "Analog In", "IEC958 In" }; 2071 static char *texts_655[3] = { "PCM", "Analog In", "IEC958 In" };
2072 static char *texts_658[4] = { "PCM", "Analog1 In", "Analog2 In", "IEC958 In" }; 2072 static char *texts_658[4] = { "PCM", "Analog1 In", "Analog2 In", "IEC958 In" };
2073 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2073 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2074 2074
2075 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 2075 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
2076 uinfo->count = 1; 2076 uinfo->count = 1;
@@ -2084,9 +2084,9 @@ static int alc655_iec958_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_
2084 return 0; 2084 return 0;
2085} 2085}
2086 2086
2087static int alc655_iec958_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 2087static int alc655_iec958_route_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2088{ 2088{
2089 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2089 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2090 unsigned short val; 2090 unsigned short val;
2091 2091
2092 val = ac97->regs[AC97_ALC650_MULTICH]; 2092 val = ac97->regs[AC97_ALC650_MULTICH];
@@ -2097,16 +2097,16 @@ static int alc655_iec958_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_
2097 return 0; 2097 return 0;
2098} 2098}
2099 2099
2100static int alc655_iec958_route_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 2100static int alc655_iec958_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2101{ 2101{
2102 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2102 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2103 2103
2104 return ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 3 << 12, 2104 return ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 3 << 12,
2105 (unsigned short)ucontrol->value.enumerated.item[0] << 12, 2105 (unsigned short)ucontrol->value.enumerated.item[0] << 12,
2106 0); 2106 0);
2107} 2107}
2108 2108
2109static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc655[] = { 2109static const struct snd_kcontrol_new snd_ac97_spdif_controls_alc655[] = {
2110 AC97_PAGE_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0, 0), 2110 AC97_PAGE_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0, 0),
2111 /* disable this controls since it doesn't work as expected */ 2111 /* disable this controls since it doesn't work as expected */
2112 /* AC97_PAGE_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 14, 1, 0, 0), */ 2112 /* AC97_PAGE_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 14, 1, 0, 0), */
@@ -2119,7 +2119,7 @@ static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc655[] = {
2119 }, 2119 },
2120}; 2120};
2121 2121
2122static int patch_alc655_specific(ac97_t * ac97) 2122static int patch_alc655_specific(struct snd_ac97 * ac97)
2123{ 2123{
2124 int err; 2124 int err;
2125 2125
@@ -2137,7 +2137,7 @@ static struct snd_ac97_build_ops patch_alc655_ops = {
2137 .update_jacks = alc655_update_jacks 2137 .update_jacks = alc655_update_jacks
2138}; 2138};
2139 2139
2140int patch_alc655(ac97_t * ac97) 2140int patch_alc655(struct snd_ac97 * ac97)
2141{ 2141{
2142 unsigned int val; 2142 unsigned int val;
2143 2143
@@ -2189,7 +2189,7 @@ int patch_alc655(ac97_t * ac97)
2189#define AC97_ALC850_JACK_SELECT 0x76 2189#define AC97_ALC850_JACK_SELECT 0x76
2190#define AC97_ALC850_MISC1 0x7a 2190#define AC97_ALC850_MISC1 0x7a
2191 2191
2192static void alc850_update_jacks(ac97_t *ac97) 2192static void alc850_update_jacks(struct snd_ac97 *ac97)
2193{ 2193{
2194 int shared; 2194 int shared;
2195 2195
@@ -2211,14 +2211,14 @@ static void alc850_update_jacks(ac97_t *ac97)
2211 shared ? (2<<4) : (1<<4)); 2211 shared ? (2<<4) : (1<<4));
2212} 2212}
2213 2213
2214static const snd_kcontrol_new_t snd_ac97_controls_alc850[] = { 2214static const struct snd_kcontrol_new snd_ac97_controls_alc850[] = {
2215 AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0), 2215 AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0),
2216 AC97_SINGLE("Mic Front Input Switch", AC97_ALC850_JACK_SELECT, 15, 1, 1), 2216 AC97_SINGLE("Mic Front Input Switch", AC97_ALC850_JACK_SELECT, 15, 1, 1),
2217 AC97_SURROUND_JACK_MODE_CTL, 2217 AC97_SURROUND_JACK_MODE_CTL,
2218 AC97_CHANNEL_MODE_CTL, 2218 AC97_CHANNEL_MODE_CTL,
2219}; 2219};
2220 2220
2221static int patch_alc850_specific(ac97_t *ac97) 2221static int patch_alc850_specific(struct snd_ac97 *ac97)
2222{ 2222{
2223 int err; 2223 int err;
2224 2224
@@ -2236,7 +2236,7 @@ static struct snd_ac97_build_ops patch_alc850_ops = {
2236 .update_jacks = alc850_update_jacks 2236 .update_jacks = alc850_update_jacks
2237}; 2237};
2238 2238
2239int patch_alc850(ac97_t *ac97) 2239int patch_alc850(struct snd_ac97 *ac97)
2240{ 2240{
2241 ac97->build_ops = &patch_alc850_ops; 2241 ac97->build_ops = &patch_alc850_ops;
2242 2242
@@ -2273,20 +2273,20 @@ int patch_alc850(ac97_t *ac97)
2273/* 2273/*
2274 * C-Media CM97xx codecs 2274 * C-Media CM97xx codecs
2275 */ 2275 */
2276static void cm9738_update_jacks(ac97_t *ac97) 2276static void cm9738_update_jacks(struct snd_ac97 *ac97)
2277{ 2277{
2278 /* shared Line-In */ 2278 /* shared Line-In */
2279 snd_ac97_update_bits(ac97, AC97_CM9738_VENDOR_CTRL, 1 << 10, 2279 snd_ac97_update_bits(ac97, AC97_CM9738_VENDOR_CTRL, 1 << 10,
2280 is_shared_linein(ac97) ? (1 << 10) : 0); 2280 is_shared_linein(ac97) ? (1 << 10) : 0);
2281} 2281}
2282 2282
2283static const snd_kcontrol_new_t snd_ac97_cm9738_controls[] = { 2283static const struct snd_kcontrol_new snd_ac97_cm9738_controls[] = {
2284 AC97_SINGLE("Duplicate Front", AC97_CM9738_VENDOR_CTRL, 13, 1, 0), 2284 AC97_SINGLE("Duplicate Front", AC97_CM9738_VENDOR_CTRL, 13, 1, 0),
2285 AC97_SURROUND_JACK_MODE_CTL, 2285 AC97_SURROUND_JACK_MODE_CTL,
2286 AC97_CHANNEL_MODE_4CH_CTL, 2286 AC97_CHANNEL_MODE_4CH_CTL,
2287}; 2287};
2288 2288
2289static int patch_cm9738_specific(ac97_t * ac97) 2289static int patch_cm9738_specific(struct snd_ac97 * ac97)
2290{ 2290{
2291 return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls)); 2291 return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls));
2292} 2292}
@@ -2296,7 +2296,7 @@ static struct snd_ac97_build_ops patch_cm9738_ops = {
2296 .update_jacks = cm9738_update_jacks 2296 .update_jacks = cm9738_update_jacks
2297}; 2297};
2298 2298
2299int patch_cm9738(ac97_t * ac97) 2299int patch_cm9738(struct snd_ac97 * ac97)
2300{ 2300{
2301 ac97->build_ops = &patch_cm9738_ops; 2301 ac97->build_ops = &patch_cm9738_ops;
2302 /* FIXME: can anyone confirm below? */ 2302 /* FIXME: can anyone confirm below? */
@@ -2307,7 +2307,7 @@ int patch_cm9738(ac97_t * ac97)
2307 return 0; 2307 return 0;
2308} 2308}
2309 2309
2310static int snd_ac97_cmedia_spdif_playback_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2310static int snd_ac97_cmedia_spdif_playback_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2311{ 2311{
2312 static char *texts[] = { "Analog", "Digital" }; 2312 static char *texts[] = { "Analog", "Digital" };
2313 2313
@@ -2320,9 +2320,9 @@ static int snd_ac97_cmedia_spdif_playback_source_info(snd_kcontrol_t *kcontrol,
2320 return 0; 2320 return 0;
2321} 2321}
2322 2322
2323static int snd_ac97_cmedia_spdif_playback_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2323static int snd_ac97_cmedia_spdif_playback_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2324{ 2324{
2325 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2325 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2326 unsigned short val; 2326 unsigned short val;
2327 2327
2328 val = ac97->regs[AC97_CM9739_SPDIF_CTRL]; 2328 val = ac97->regs[AC97_CM9739_SPDIF_CTRL];
@@ -2330,16 +2330,16 @@ static int snd_ac97_cmedia_spdif_playback_source_get(snd_kcontrol_t * kcontrol,
2330 return 0; 2330 return 0;
2331} 2331}
2332 2332
2333static int snd_ac97_cmedia_spdif_playback_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2333static int snd_ac97_cmedia_spdif_playback_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2334{ 2334{
2335 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2335 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2336 2336
2337 return snd_ac97_update_bits(ac97, AC97_CM9739_SPDIF_CTRL, 2337 return snd_ac97_update_bits(ac97, AC97_CM9739_SPDIF_CTRL,
2338 0x01 << 1, 2338 0x01 << 1,
2339 (ucontrol->value.enumerated.item[0] & 0x01) << 1); 2339 (ucontrol->value.enumerated.item[0] & 0x01) << 1);
2340} 2340}
2341 2341
2342static const snd_kcontrol_new_t snd_ac97_cm9739_controls_spdif[] = { 2342static const struct snd_kcontrol_new snd_ac97_cm9739_controls_spdif[] = {
2343 /* BIT 0: SPDI_EN - always true */ 2343 /* BIT 0: SPDI_EN - always true */
2344 { /* BIT 1: SPDIFS */ 2344 { /* BIT 1: SPDIFS */
2345 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2345 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -2357,7 +2357,7 @@ static const snd_kcontrol_new_t snd_ac97_cm9739_controls_spdif[] = {
2357 /* BIT 8: SPD32 - 32bit SPDIF - not supported yet */ 2357 /* BIT 8: SPD32 - 32bit SPDIF - not supported yet */
2358}; 2358};
2359 2359
2360static void cm9739_update_jacks(ac97_t *ac97) 2360static void cm9739_update_jacks(struct snd_ac97 *ac97)
2361{ 2361{
2362 /* shared Line-In */ 2362 /* shared Line-In */
2363 snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 1 << 10, 2363 snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 1 << 10,
@@ -2367,17 +2367,17 @@ static void cm9739_update_jacks(ac97_t *ac97)
2367 is_shared_micin(ac97) ? 0x1000 : 0x2000); 2367 is_shared_micin(ac97) ? 0x1000 : 0x2000);
2368} 2368}
2369 2369
2370static const snd_kcontrol_new_t snd_ac97_cm9739_controls[] = { 2370static const struct snd_kcontrol_new snd_ac97_cm9739_controls[] = {
2371 AC97_SURROUND_JACK_MODE_CTL, 2371 AC97_SURROUND_JACK_MODE_CTL,
2372 AC97_CHANNEL_MODE_CTL, 2372 AC97_CHANNEL_MODE_CTL,
2373}; 2373};
2374 2374
2375static int patch_cm9739_specific(ac97_t * ac97) 2375static int patch_cm9739_specific(struct snd_ac97 * ac97)
2376{ 2376{
2377 return patch_build_controls(ac97, snd_ac97_cm9739_controls, ARRAY_SIZE(snd_ac97_cm9739_controls)); 2377 return patch_build_controls(ac97, snd_ac97_cm9739_controls, ARRAY_SIZE(snd_ac97_cm9739_controls));
2378} 2378}
2379 2379
2380static int patch_cm9739_post_spdif(ac97_t * ac97) 2380static int patch_cm9739_post_spdif(struct snd_ac97 * ac97)
2381{ 2381{
2382 return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif)); 2382 return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
2383} 2383}
@@ -2388,7 +2388,7 @@ static struct snd_ac97_build_ops patch_cm9739_ops = {
2388 .update_jacks = cm9739_update_jacks 2388 .update_jacks = cm9739_update_jacks
2389}; 2389};
2390 2390
2391int patch_cm9739(ac97_t * ac97) 2391int patch_cm9739(struct snd_ac97 * ac97)
2392{ 2392{
2393 unsigned short val; 2393 unsigned short val;
2394 2394
@@ -2447,7 +2447,7 @@ int patch_cm9739(ac97_t * ac97)
2447#define AC97_CM9761_FUNC 0x66 2447#define AC97_CM9761_FUNC 0x66
2448#define AC97_CM9761_SPDIF_CTRL 0x6c 2448#define AC97_CM9761_SPDIF_CTRL 0x6c
2449 2449
2450static void cm9761_update_jacks(ac97_t *ac97) 2450static void cm9761_update_jacks(struct snd_ac97 *ac97)
2451{ 2451{
2452 /* FIXME: check the bits for each model 2452 /* FIXME: check the bits for each model
2453 * model 83 is confirmed to work 2453 * model 83 is confirmed to work
@@ -2482,12 +2482,12 @@ static void cm9761_update_jacks(ac97_t *ac97)
2482 snd_ac97_update_bits(ac97, AC97_CM9761_MULTI_CHAN, 0x3c88, val); 2482 snd_ac97_update_bits(ac97, AC97_CM9761_MULTI_CHAN, 0x3c88, val);
2483} 2483}
2484 2484
2485static const snd_kcontrol_new_t snd_ac97_cm9761_controls[] = { 2485static const struct snd_kcontrol_new snd_ac97_cm9761_controls[] = {
2486 AC97_SURROUND_JACK_MODE_CTL, 2486 AC97_SURROUND_JACK_MODE_CTL,
2487 AC97_CHANNEL_MODE_CTL, 2487 AC97_CHANNEL_MODE_CTL,
2488}; 2488};
2489 2489
2490static int cm9761_spdif_out_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 2490static int cm9761_spdif_out_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2491{ 2491{
2492 static char *texts[] = { "AC-Link", "ADC", "SPDIF-In" }; 2492 static char *texts[] = { "AC-Link", "ADC", "SPDIF-In" };
2493 2493
@@ -2500,9 +2500,9 @@ static int cm9761_spdif_out_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
2500 return 0; 2500 return 0;
2501} 2501}
2502 2502
2503static int cm9761_spdif_out_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 2503static int cm9761_spdif_out_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2504{ 2504{
2505 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2505 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2506 2506
2507 if (ac97->regs[AC97_CM9761_FUNC] & 0x1) 2507 if (ac97->regs[AC97_CM9761_FUNC] & 0x1)
2508 ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */ 2508 ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */
@@ -2513,9 +2513,9 @@ static int cm9761_spdif_out_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
2513 return 0; 2513 return 0;
2514} 2514}
2515 2515
2516static int cm9761_spdif_out_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 2516static int cm9761_spdif_out_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2517{ 2517{
2518 ac97_t *ac97 = snd_kcontrol_chip(kcontrol); 2518 struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
2519 2519
2520 if (ucontrol->value.enumerated.item[0] == 2) 2520 if (ucontrol->value.enumerated.item[0] == 2)
2521 return snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0x1); 2521 return snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0x1);
@@ -2528,7 +2528,7 @@ static const char *cm9761_dac_clock[] = { "AC-Link", "SPDIF-In", "Both" };
2528static const struct ac97_enum cm9761_dac_clock_enum = 2528static const struct ac97_enum cm9761_dac_clock_enum =
2529 AC97_ENUM_SINGLE(AC97_CM9761_SPDIF_CTRL, 9, 3, cm9761_dac_clock); 2529 AC97_ENUM_SINGLE(AC97_CM9761_SPDIF_CTRL, 9, 3, cm9761_dac_clock);
2530 2530
2531static const snd_kcontrol_new_t snd_ac97_cm9761_controls_spdif[] = { 2531static const struct snd_kcontrol_new snd_ac97_cm9761_controls_spdif[] = {
2532 { /* BIT 1: SPDIFS */ 2532 { /* BIT 1: SPDIFS */
2533 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2533 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2534 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", 2534 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
@@ -2546,12 +2546,12 @@ static const snd_kcontrol_new_t snd_ac97_cm9761_controls_spdif[] = {
2546 AC97_ENUM("DAC Clock Source", cm9761_dac_clock_enum), 2546 AC97_ENUM("DAC Clock Source", cm9761_dac_clock_enum),
2547}; 2547};
2548 2548
2549static int patch_cm9761_post_spdif(ac97_t * ac97) 2549static int patch_cm9761_post_spdif(struct snd_ac97 * ac97)
2550{ 2550{
2551 return patch_build_controls(ac97, snd_ac97_cm9761_controls_spdif, ARRAY_SIZE(snd_ac97_cm9761_controls_spdif)); 2551 return patch_build_controls(ac97, snd_ac97_cm9761_controls_spdif, ARRAY_SIZE(snd_ac97_cm9761_controls_spdif));
2552} 2552}
2553 2553
2554static int patch_cm9761_specific(ac97_t * ac97) 2554static int patch_cm9761_specific(struct snd_ac97 * ac97)
2555{ 2555{
2556 return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls)); 2556 return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls));
2557} 2557}
@@ -2562,7 +2562,7 @@ static struct snd_ac97_build_ops patch_cm9761_ops = {
2562 .update_jacks = cm9761_update_jacks 2562 .update_jacks = cm9761_update_jacks
2563}; 2563};
2564 2564
2565int patch_cm9761(ac97_t *ac97) 2565int patch_cm9761(struct snd_ac97 *ac97)
2566{ 2566{
2567 unsigned short val; 2567 unsigned short val;
2568 2568
@@ -2641,13 +2641,13 @@ int patch_cm9761(ac97_t *ac97)
2641static const char *cm9780_ch_select[] = { "Front", "Side", "Center/LFE", "Rear" }; 2641static const char *cm9780_ch_select[] = { "Front", "Side", "Center/LFE", "Rear" };
2642static const struct ac97_enum cm9780_ch_select_enum = 2642static const struct ac97_enum cm9780_ch_select_enum =
2643 AC97_ENUM_SINGLE(AC97_CM9780_MULTI_CHAN, 6, 4, cm9780_ch_select); 2643 AC97_ENUM_SINGLE(AC97_CM9780_MULTI_CHAN, 6, 4, cm9780_ch_select);
2644static const snd_kcontrol_new_t cm9780_controls[] = { 2644static const struct snd_kcontrol_new cm9780_controls[] = {
2645 AC97_DOUBLE("Side Playback Switch", AC97_CM9780_SIDE, 15, 7, 1, 1), 2645 AC97_DOUBLE("Side Playback Switch", AC97_CM9780_SIDE, 15, 7, 1, 1),
2646 AC97_DOUBLE("Side Playback Volume", AC97_CM9780_SIDE, 8, 0, 31, 0), 2646 AC97_DOUBLE("Side Playback Volume", AC97_CM9780_SIDE, 8, 0, 31, 0),
2647 AC97_ENUM("Side Playback Route", cm9780_ch_select_enum), 2647 AC97_ENUM("Side Playback Route", cm9780_ch_select_enum),
2648}; 2648};
2649 2649
2650static int patch_cm9780_specific(ac97_t *ac97) 2650static int patch_cm9780_specific(struct snd_ac97 *ac97)
2651{ 2651{
2652 return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls)); 2652 return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls));
2653} 2653}
@@ -2657,7 +2657,7 @@ static struct snd_ac97_build_ops patch_cm9780_ops = {
2657 .build_post_spdif = patch_cm9761_post_spdif /* identical with CM9761 */ 2657 .build_post_spdif = patch_cm9761_post_spdif /* identical with CM9761 */
2658}; 2658};
2659 2659
2660int patch_cm9780(ac97_t *ac97) 2660int patch_cm9780(struct snd_ac97 *ac97)
2661{ 2661{
2662 unsigned short val; 2662 unsigned short val;
2663 2663
@@ -2677,14 +2677,14 @@ int patch_cm9780(ac97_t *ac97)
2677/* 2677/*
2678 * VIA VT1616 codec 2678 * VIA VT1616 codec
2679 */ 2679 */
2680static const snd_kcontrol_new_t snd_ac97_controls_vt1616[] = { 2680static const struct snd_kcontrol_new snd_ac97_controls_vt1616[] = {
2681AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0), 2681AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0),
2682AC97_SINGLE("Alternate Level to Surround Out", 0x5a, 15, 1, 0), 2682AC97_SINGLE("Alternate Level to Surround Out", 0x5a, 15, 1, 0),
2683AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0), 2683AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0),
2684AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0), 2684AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0),
2685}; 2685};
2686 2686
2687static int patch_vt1616_specific(ac97_t * ac97) 2687static int patch_vt1616_specific(struct snd_ac97 * ac97)
2688{ 2688{
2689 int err; 2689 int err;
2690 2690
@@ -2700,7 +2700,7 @@ static struct snd_ac97_build_ops patch_vt1616_ops = {
2700 .build_specific = patch_vt1616_specific 2700 .build_specific = patch_vt1616_specific
2701}; 2701};
2702 2702
2703int patch_vt1616(ac97_t * ac97) 2703int patch_vt1616(struct snd_ac97 * ac97)
2704{ 2704{
2705 ac97->build_ops = &patch_vt1616_ops; 2705 ac97->build_ops = &patch_vt1616_ops;
2706 return 0; 2706 return 0;
@@ -2709,7 +2709,7 @@ int patch_vt1616(ac97_t * ac97)
2709/* 2709/*
2710 * VT1617A codec 2710 * VT1617A codec
2711 */ 2711 */
2712int patch_vt1617a(ac97_t * ac97) 2712int patch_vt1617a(struct snd_ac97 * ac97)
2713{ 2713{
2714 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ 2714 ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */
2715 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; 2715 ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
@@ -2718,7 +2718,7 @@ int patch_vt1617a(ac97_t * ac97)
2718 2718
2719/* 2719/*
2720 */ 2720 */
2721static void it2646_update_jacks(ac97_t *ac97) 2721static void it2646_update_jacks(struct snd_ac97 *ac97)
2722{ 2722{
2723 /* shared Line-In */ 2723 /* shared Line-In */
2724 snd_ac97_update_bits(ac97, 0x76, 1 << 9, 2724 snd_ac97_update_bits(ac97, 0x76, 1 << 9,
@@ -2728,18 +2728,18 @@ static void it2646_update_jacks(ac97_t *ac97)
2728 is_shared_micin(ac97) ? (1<<10) : 0); 2728 is_shared_micin(ac97) ? (1<<10) : 0);
2729} 2729}
2730 2730
2731static const snd_kcontrol_new_t snd_ac97_controls_it2646[] = { 2731static const struct snd_kcontrol_new snd_ac97_controls_it2646[] = {
2732 AC97_SURROUND_JACK_MODE_CTL, 2732 AC97_SURROUND_JACK_MODE_CTL,
2733 AC97_CHANNEL_MODE_CTL, 2733 AC97_CHANNEL_MODE_CTL,
2734}; 2734};
2735 2735
2736static const snd_kcontrol_new_t snd_ac97_spdif_controls_it2646[] = { 2736static const struct snd_kcontrol_new snd_ac97_spdif_controls_it2646[] = {
2737 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0x76, 11, 1, 0), 2737 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0x76, 11, 1, 0),
2738 AC97_SINGLE("Analog to IEC958 Output", 0x76, 12, 1, 0), 2738 AC97_SINGLE("Analog to IEC958 Output", 0x76, 12, 1, 0),
2739 AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0), 2739 AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0),
2740}; 2740};
2741 2741
2742static int patch_it2646_specific(ac97_t * ac97) 2742static int patch_it2646_specific(struct snd_ac97 * ac97)
2743{ 2743{
2744 int err; 2744 int err;
2745 if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0) 2745 if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0)
@@ -2754,7 +2754,7 @@ static struct snd_ac97_build_ops patch_it2646_ops = {
2754 .update_jacks = it2646_update_jacks 2754 .update_jacks = it2646_update_jacks
2755}; 2755};
2756 2756
2757int patch_it2646(ac97_t * ac97) 2757int patch_it2646(struct snd_ac97 * ac97)
2758{ 2758{
2759 ac97->build_ops = &patch_it2646_ops; 2759 ac97->build_ops = &patch_it2646_ops;
2760 /* full DAC volume */ 2760 /* full DAC volume */
@@ -2770,11 +2770,11 @@ int patch_it2646(ac97_t * ac97)
2770#define AC97_SI3036_CHIP_ID 0x5a 2770#define AC97_SI3036_CHIP_ID 0x5a
2771#define AC97_SI3036_LINE_CFG 0x5c 2771#define AC97_SI3036_LINE_CFG 0x5c
2772 2772
2773static const snd_kcontrol_new_t snd_ac97_controls_si3036[] = { 2773static const struct snd_kcontrol_new snd_ac97_controls_si3036[] = {
2774AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1) 2774AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1)
2775}; 2775};
2776 2776
2777static int patch_si3036_specific(ac97_t * ac97) 2777static int patch_si3036_specific(struct snd_ac97 * ac97)
2778{ 2778{
2779 int idx, err; 2779 int idx, err;
2780 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++) 2780 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++)
@@ -2787,7 +2787,7 @@ static struct snd_ac97_build_ops patch_si3036_ops = {
2787 .build_specific = patch_si3036_specific, 2787 .build_specific = patch_si3036_specific,
2788}; 2788};
2789 2789
2790int mpatch_si3036(ac97_t * ac97) 2790int mpatch_si3036(struct snd_ac97 * ac97)
2791{ 2791{
2792 ac97->build_ops = &patch_si3036_ops; 2792 ac97->build_ops = &patch_si3036_ops;
2793 snd_ac97_write_cache(ac97, 0x5c, 0xf210 ); 2793 snd_ac97_write_cache(ac97, 0x5c, 0xf210 );
diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h
index ec1811320106..5060cb6f2ec3 100644
--- a/sound/pci/ac97/ac97_patch.h
+++ b/sound/pci/ac97/ac97_patch.h
@@ -22,40 +22,40 @@
22 * 22 *
23 */ 23 */
24 24
25int patch_yamaha_ymf753(ac97_t * ac97); 25int patch_yamaha_ymf753(struct snd_ac97 * ac97);
26int patch_wolfson00(ac97_t * ac97); 26int patch_wolfson00(struct snd_ac97 * ac97);
27int patch_wolfson03(ac97_t * ac97); 27int patch_wolfson03(struct snd_ac97 * ac97);
28int patch_wolfson04(ac97_t * ac97); 28int patch_wolfson04(struct snd_ac97 * ac97);
29int patch_wolfson05(ac97_t * ac97); 29int patch_wolfson05(struct snd_ac97 * ac97);
30int patch_wolfson11(ac97_t * ac97); 30int patch_wolfson11(struct snd_ac97 * ac97);
31int patch_wolfson13(ac97_t * ac97); 31int patch_wolfson13(struct snd_ac97 * ac97);
32int patch_tritech_tr28028(ac97_t * ac97); 32int patch_tritech_tr28028(struct snd_ac97 * ac97);
33int patch_sigmatel_stac9700(ac97_t * ac97); 33int patch_sigmatel_stac9700(struct snd_ac97 * ac97);
34int patch_sigmatel_stac9708(ac97_t * ac97); 34int patch_sigmatel_stac9708(struct snd_ac97 * ac97);
35int patch_sigmatel_stac9721(ac97_t * ac97); 35int patch_sigmatel_stac9721(struct snd_ac97 * ac97);
36int patch_sigmatel_stac9744(ac97_t * ac97); 36int patch_sigmatel_stac9744(struct snd_ac97 * ac97);
37int patch_sigmatel_stac9756(ac97_t * ac97); 37int patch_sigmatel_stac9756(struct snd_ac97 * ac97);
38int patch_sigmatel_stac9758(ac97_t * ac97); 38int patch_sigmatel_stac9758(struct snd_ac97 * ac97);
39int patch_cirrus_cs4299(ac97_t * ac97); 39int patch_cirrus_cs4299(struct snd_ac97 * ac97);
40int patch_cirrus_spdif(ac97_t * ac97); 40int patch_cirrus_spdif(struct snd_ac97 * ac97);
41int patch_conexant(ac97_t * ac97); 41int patch_conexant(struct snd_ac97 * ac97);
42int patch_ad1819(ac97_t * ac97); 42int patch_ad1819(struct snd_ac97 * ac97);
43int patch_ad1881(ac97_t * ac97); 43int patch_ad1881(struct snd_ac97 * ac97);
44int patch_ad1885(ac97_t * ac97); 44int patch_ad1885(struct snd_ac97 * ac97);
45int patch_ad1886(ac97_t * ac97); 45int patch_ad1886(struct snd_ac97 * ac97);
46int patch_ad1888(ac97_t * ac97); 46int patch_ad1888(struct snd_ac97 * ac97);
47int patch_ad1980(ac97_t * ac97); 47int patch_ad1980(struct snd_ac97 * ac97);
48int patch_ad1981a(ac97_t * ac97); 48int patch_ad1981a(struct snd_ac97 * ac97);
49int patch_ad1981b(ac97_t * ac97); 49int patch_ad1981b(struct snd_ac97 * ac97);
50int patch_ad1985(ac97_t * ac97); 50int patch_ad1985(struct snd_ac97 * ac97);
51int patch_alc650(ac97_t * ac97); 51int patch_alc650(struct snd_ac97 * ac97);
52int patch_alc655(ac97_t * ac97); 52int patch_alc655(struct snd_ac97 * ac97);
53int patch_alc850(ac97_t * ac97); 53int patch_alc850(struct snd_ac97 * ac97);
54int patch_cm9738(ac97_t * ac97); 54int patch_cm9738(struct snd_ac97 * ac97);
55int patch_cm9739(ac97_t * ac97); 55int patch_cm9739(struct snd_ac97 * ac97);
56int patch_cm9761(ac97_t * ac97); 56int patch_cm9761(struct snd_ac97 * ac97);
57int patch_cm9780(ac97_t * ac97); 57int patch_cm9780(struct snd_ac97 * ac97);
58int patch_vt1616(ac97_t * ac97); 58int patch_vt1616(struct snd_ac97 * ac97);
59int patch_vt1617a(ac97_t * ac97); 59int patch_vt1617a(struct snd_ac97 * ac97);
60int patch_it2646(ac97_t * ac97); 60int patch_it2646(struct snd_ac97 * ac97);
61int mpatch_si3036(ac97_t * ac97); 61int mpatch_si3036(struct snd_ac97 * ac97);
diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c
index ded13165d635..c3e590bf7a02 100644
--- a/sound/pci/ac97/ac97_pcm.c
+++ b/sound/pci/ac97/ac97_pcm.c
@@ -170,7 +170,7 @@ static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx,
170 return rate_cregs[slot - 3]; 170 return rate_cregs[slot - 3];
171} 171}
172 172
173static int set_spdif_rate(ac97_t *ac97, unsigned short rate) 173static int set_spdif_rate(struct snd_ac97 *ac97, unsigned short rate)
174{ 174{
175 unsigned short old, bits, reg, mask; 175 unsigned short old, bits, reg, mask;
176 unsigned int sbits; 176 unsigned int sbits;
@@ -254,7 +254,7 @@ static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
254 * 254 *
255 * Returns zero if successful, or a negative error code on failure. 255 * Returns zero if successful, or a negative error code on failure.
256 */ 256 */
257int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate) 257int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate)
258{ 258{
259 int dbl; 259 int dbl;
260 unsigned int tmp; 260 unsigned int tmp;
@@ -315,7 +315,7 @@ int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate)
315 return 0; 315 return 0;
316} 316}
317 317
318static unsigned short get_pslots(ac97_t *ac97, unsigned char *rate_table, unsigned short *spdif_slots) 318static unsigned short get_pslots(struct snd_ac97 *ac97, unsigned char *rate_table, unsigned short *spdif_slots)
319{ 319{
320 if (!ac97_is_audio(ac97)) 320 if (!ac97_is_audio(ac97))
321 return 0; 321 return 0;
@@ -390,7 +390,7 @@ static unsigned short get_pslots(ac97_t *ac97, unsigned char *rate_table, unsign
390 } 390 }
391} 391}
392 392
393static unsigned short get_cslots(ac97_t *ac97) 393static unsigned short get_cslots(struct snd_ac97 *ac97)
394{ 394{
395 unsigned short slots; 395 unsigned short slots;
396 396
@@ -437,7 +437,7 @@ static unsigned int get_rates(struct ac97_pcm *pcm, unsigned int cidx, unsigned
437 * some slots are available, pcm->xxx.slots and pcm->xxx.rslots[] members 437 * some slots are available, pcm->xxx.slots and pcm->xxx.rslots[] members
438 * are reduced and might be zero. 438 * are reduced and might be zero.
439 */ 439 */
440int snd_ac97_pcm_assign(ac97_bus_t *bus, 440int snd_ac97_pcm_assign(struct snd_ac97_bus *bus,
441 unsigned short pcms_count, 441 unsigned short pcms_count,
442 const struct ac97_pcm *pcms) 442 const struct ac97_pcm *pcms)
443{ 443{
@@ -449,7 +449,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus,
449 unsigned short tmp, slots; 449 unsigned short tmp, slots;
450 unsigned short spdif_slots[4]; 450 unsigned short spdif_slots[4];
451 unsigned int rates; 451 unsigned int rates;
452 ac97_t *codec; 452 struct snd_ac97 *codec;
453 453
454 rpcms = kcalloc(pcms_count, sizeof(struct ac97_pcm), GFP_KERNEL); 454 rpcms = kcalloc(pcms_count, sizeof(struct ac97_pcm), GFP_KERNEL);
455 if (rpcms == NULL) 455 if (rpcms == NULL)
@@ -560,7 +560,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus,
560int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, 560int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
561 enum ac97_pcm_cfg cfg, unsigned short slots) 561 enum ac97_pcm_cfg cfg, unsigned short slots)
562{ 562{
563 ac97_bus_t *bus; 563 struct snd_ac97_bus *bus;
564 int i, cidx, r, ok_flag; 564 int i, cidx, r, ok_flag;
565 unsigned int reg_ok[4] = {0,0,0,0}; 565 unsigned int reg_ok[4] = {0,0,0,0};
566 unsigned char reg; 566 unsigned char reg;
@@ -639,7 +639,7 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
639 */ 639 */
640int snd_ac97_pcm_close(struct ac97_pcm *pcm) 640int snd_ac97_pcm_close(struct ac97_pcm *pcm)
641{ 641{
642 ac97_bus_t *bus; 642 struct snd_ac97_bus *bus;
643 unsigned short slots = pcm->aslots; 643 unsigned short slots = pcm->aslots;
644 int i, cidx; 644 int i, cidx;
645 645
@@ -656,31 +656,31 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm)
656 return 0; 656 return 0;
657} 657}
658 658
659static int double_rate_hw_constraint_rate(snd_pcm_hw_params_t *params, 659static int double_rate_hw_constraint_rate(struct snd_pcm_hw_params *params,
660 snd_pcm_hw_rule_t *rule) 660 struct snd_pcm_hw_rule *rule)
661{ 661{
662 snd_interval_t *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 662 struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
663 if (channels->min > 2) { 663 if (channels->min > 2) {
664 static const snd_interval_t single_rates = { 664 static const struct snd_interval single_rates = {
665 .min = 1, 665 .min = 1,
666 .max = 48000, 666 .max = 48000,
667 }; 667 };
668 snd_interval_t *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); 668 struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
669 return snd_interval_refine(rate, &single_rates); 669 return snd_interval_refine(rate, &single_rates);
670 } 670 }
671 return 0; 671 return 0;
672} 672}
673 673
674static int double_rate_hw_constraint_channels(snd_pcm_hw_params_t *params, 674static int double_rate_hw_constraint_channels(struct snd_pcm_hw_params *params,
675 snd_pcm_hw_rule_t *rule) 675 struct snd_pcm_hw_rule *rule)
676{ 676{
677 snd_interval_t *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); 677 struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
678 if (rate->min > 48000) { 678 if (rate->min > 48000) {
679 static const snd_interval_t double_rate_channels = { 679 static const struct snd_interval double_rate_channels = {
680 .min = 2, 680 .min = 2,
681 .max = 2, 681 .max = 2,
682 }; 682 };
683 snd_interval_t *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 683 struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
684 return snd_interval_refine(channels, &double_rate_channels); 684 return snd_interval_refine(channels, &double_rate_channels);
685 } 685 }
686 return 0; 686 return 0;
@@ -693,7 +693,7 @@ static int double_rate_hw_constraint_channels(snd_pcm_hw_params_t *params,
693 * Installs the hardware constraint rules to prevent using double rates and 693 * Installs the hardware constraint rules to prevent using double rates and
694 * more than two channels at the same time. 694 * more than two channels at the same time.
695 */ 695 */
696int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime) 696int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime)
697{ 697{
698 int err; 698 int err;
699 699
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c
index f4333b867bd5..266073201293 100644
--- a/sound/pci/ac97/ac97_proc.c
+++ b/sound/pci/ac97/ac97_proc.c
@@ -34,7 +34,7 @@
34 * proc interface 34 * proc interface
35 */ 35 */
36 36
37static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer) 37static void snd_ac97_proc_read_functions(struct snd_ac97 *ac97, struct snd_info_buffer *buffer)
38{ 38{
39 int header = 0, function; 39 int header = 0, function;
40 unsigned short info, sense_info; 40 unsigned short info, sense_info;
@@ -68,7 +68,7 @@ static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer
68 } 68 }
69} 69}
70 70
71static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx) 71static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subidx)
72{ 72{
73 char name[64]; 73 char name[64];
74 unsigned short val, tmp, ext, mext; 74 unsigned short val, tmp, ext, mext;
@@ -80,7 +80,6 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
80 snd_ac97_get_name(NULL, ac97->id, name, 0); 80 snd_ac97_get_name(NULL, ac97->id, name, 0);
81 snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name); 81 snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name);
82 82
83
84 if ((ac97->scaps & AC97_SCAP_AUDIO) == 0) 83 if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
85 goto __modem; 84 goto __modem;
86 85
@@ -299,9 +298,9 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
299 } 298 }
300} 299}
301 300
302static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) 301static void snd_ac97_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
303{ 302{
304 ac97_t *ac97 = entry->private_data; 303 struct snd_ac97 *ac97 = entry->private_data;
305 304
306 down(&ac97->page_mutex); 305 down(&ac97->page_mutex);
307 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 306 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86
@@ -334,9 +333,9 @@ static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
334 333
335#ifdef CONFIG_SND_DEBUG 334#ifdef CONFIG_SND_DEBUG
336/* direct register write for debugging */ 335/* direct register write for debugging */
337static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 336static void snd_ac97_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
338{ 337{
339 ac97_t *ac97 = entry->private_data; 338 struct snd_ac97 *ac97 = entry->private_data;
340 char line[64]; 339 char line[64];
341 unsigned int reg, val; 340 unsigned int reg, val;
342 down(&ac97->page_mutex); 341 down(&ac97->page_mutex);
@@ -351,7 +350,7 @@ static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t
351} 350}
352#endif 351#endif
353 352
354static void snd_ac97_proc_regs_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx) 353static void snd_ac97_proc_regs_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subidx)
355{ 354{
356 int reg, val; 355 int reg, val;
357 356
@@ -361,10 +360,10 @@ static void snd_ac97_proc_regs_read_main(ac97_t *ac97, snd_info_buffer_t * buffe
361 } 360 }
362} 361}
363 362
364static void snd_ac97_proc_regs_read(snd_info_entry_t *entry, 363static void snd_ac97_proc_regs_read(struct snd_info_entry *entry,
365 snd_info_buffer_t * buffer) 364 struct snd_info_buffer *buffer)
366{ 365{
367 ac97_t *ac97 = entry->private_data; 366 struct snd_ac97 *ac97 = entry->private_data;
368 367
369 down(&ac97->page_mutex); 368 down(&ac97->page_mutex);
370 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 369 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86
@@ -385,9 +384,9 @@ static void snd_ac97_proc_regs_read(snd_info_entry_t *entry,
385 up(&ac97->page_mutex); 384 up(&ac97->page_mutex);
386} 385}
387 386
388void snd_ac97_proc_init(ac97_t * ac97) 387void snd_ac97_proc_init(struct snd_ac97 * ac97)
389{ 388{
390 snd_info_entry_t *entry; 389 struct snd_info_entry *entry;
391 char name[32]; 390 char name[32];
392 const char *prefix; 391 const char *prefix;
393 392
@@ -419,7 +418,7 @@ void snd_ac97_proc_init(ac97_t * ac97)
419 ac97->proc_regs = entry; 418 ac97->proc_regs = entry;
420} 419}
421 420
422void snd_ac97_proc_done(ac97_t * ac97) 421void snd_ac97_proc_done(struct snd_ac97 * ac97)
423{ 422{
424 if (ac97->proc_regs) { 423 if (ac97->proc_regs) {
425 snd_info_unregister(ac97->proc_regs); 424 snd_info_unregister(ac97->proc_regs);
@@ -431,9 +430,9 @@ void snd_ac97_proc_done(ac97_t * ac97)
431 } 430 }
432} 431}
433 432
434void snd_ac97_bus_proc_init(ac97_bus_t * bus) 433void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus)
435{ 434{
436 snd_info_entry_t *entry; 435 struct snd_info_entry *entry;
437 char name[32]; 436 char name[32];
438 437
439 sprintf(name, "codec97#%d", bus->num); 438 sprintf(name, "codec97#%d", bus->num);
@@ -447,7 +446,7 @@ void snd_ac97_bus_proc_init(ac97_bus_t * bus)
447 bus->proc = entry; 446 bus->proc = entry;
448} 447}
449 448
450void snd_ac97_bus_proc_done(ac97_bus_t * bus) 449void snd_ac97_bus_proc_done(struct snd_ac97_bus * bus)
451{ 450{
452 if (bus->proc) { 451 if (bus->proc) {
453 snd_info_unregister(bus->proc); 452 snd_info_unregister(bus->proc);