aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/intel8x0.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 09:04:53 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:19:38 -0500
commit6b75a9d8b6c794d4c41d1b875c3e8e920b09e151 (patch)
treeb75b956a7695a3f63c9fbdf5350ebbb90aca99c2 /sound/pci/intel8x0.c
parenta5f22156e03d40f1da24a1b19a8a84c4fb3208f2 (diff)
[ALSA] Remove xxx_t typedefs: PCI Intel8x0
Modules: Intel8x0 driver,Intel8x0-modem driver Remove xxx_t typedefs from the PCI Intel8x0 and modem drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/intel8x0.c')
-rw-r--r--sound/pci/intel8x0.c428
1 files changed, 240 insertions, 188 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index af2b1435e630..3ea90f1e22e5 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -272,7 +272,8 @@ enum {
272#define ALI_INT_CPRAIS (1<<7) /* command port available */ 272#define ALI_INT_CPRAIS (1<<7) /* command port available */
273#define ALI_INT_SPRAIS (1<<5) /* status port available */ 273#define ALI_INT_SPRAIS (1<<5) /* status port available */
274#define ALI_INT_GPIO (1<<1) 274#define ALI_INT_GPIO (1<<1)
275#define ALI_INT_MASK (ALI_INT_SPDIFOUT|ALI_INT_CODECSPDIFOUT|ALI_INT_MICIN|ALI_INT_PCMOUT|ALI_INT_PCMIN) 275#define ALI_INT_MASK (ALI_INT_SPDIFOUT|ALI_INT_CODECSPDIFOUT|\
276 ALI_INT_MICIN|ALI_INT_PCMOUT|ALI_INT_PCMIN)
276 277
277#define ICH_ALI_SC_RESET (1<<31) /* master reset */ 278#define ICH_ALI_SC_RESET (1<<31) /* master reset */
278#define ICH_ALI_SC_AC97_DBL (1<<30) 279#define ICH_ALI_SC_AC97_DBL (1<<30)
@@ -303,18 +304,40 @@ enum {
303 * 304 *
304 */ 305 */
305 306
306enum { ICHD_PCMIN, ICHD_PCMOUT, ICHD_MIC, ICHD_MIC2, ICHD_PCM2IN, ICHD_SPBAR, ICHD_LAST = ICHD_SPBAR }; 307enum {
307enum { NVD_PCMIN, NVD_PCMOUT, NVD_MIC, NVD_SPBAR, NVD_LAST = NVD_SPBAR }; 308 ICHD_PCMIN,
308enum { ALID_PCMIN, ALID_PCMOUT, ALID_MIC, ALID_AC97SPDIFOUT, ALID_SPDIFIN, ALID_SPDIFOUT, ALID_LAST = ALID_SPDIFOUT }; 309 ICHD_PCMOUT,
310 ICHD_MIC,
311 ICHD_MIC2,
312 ICHD_PCM2IN,
313 ICHD_SPBAR,
314 ICHD_LAST = ICHD_SPBAR
315};
316enum {
317 NVD_PCMIN,
318 NVD_PCMOUT,
319 NVD_MIC,
320 NVD_SPBAR,
321 NVD_LAST = NVD_SPBAR
322};
323enum {
324 ALID_PCMIN,
325 ALID_PCMOUT,
326 ALID_MIC,
327 ALID_AC97SPDIFOUT,
328 ALID_SPDIFIN,
329 ALID_SPDIFOUT,
330 ALID_LAST = ALID_SPDIFOUT
331};
309 332
310#define get_ichdev(substream) (ichdev_t *)(substream->runtime->private_data) 333#define get_ichdev(substream) (substream->runtime->private_data)
311 334
312typedef struct { 335struct ichdev {
313 unsigned int ichd; /* ich device number */ 336 unsigned int ichd; /* ich device number */
314 unsigned long reg_offset; /* offset to bmaddr */ 337 unsigned long reg_offset; /* offset to bmaddr */
315 u32 *bdbar; /* CPU address (32bit) */ 338 u32 *bdbar; /* CPU address (32bit) */
316 unsigned int bdbar_addr; /* PCI bus address (32bit) */ 339 unsigned int bdbar_addr; /* PCI bus address (32bit) */
317 snd_pcm_substream_t *substream; 340 struct snd_pcm_substream *substream;
318 unsigned int physbuf; /* physical address (32bit) */ 341 unsigned int physbuf; /* physical address (32bit) */
319 unsigned int size; 342 unsigned int size;
320 unsigned int fragsize; 343 unsigned int fragsize;
@@ -336,11 +359,9 @@ typedef struct {
336 int pcm_open_flag; 359 int pcm_open_flag;
337 unsigned int page_attr_changed: 1; 360 unsigned int page_attr_changed: 1;
338 unsigned int suspended: 1; 361 unsigned int suspended: 1;
339} ichdev_t; 362};
340
341typedef struct _snd_intel8x0 intel8x0_t;
342 363
343struct _snd_intel8x0 { 364struct intel8x0 {
344 unsigned int device_type; 365 unsigned int device_type;
345 366
346 int irq; 367 int irq;
@@ -353,11 +374,11 @@ struct _snd_intel8x0 {
353 void __iomem *remap_bmaddr; 374 void __iomem *remap_bmaddr;
354 375
355 struct pci_dev *pci; 376 struct pci_dev *pci;
356 snd_card_t *card; 377 struct snd_card *card;
357 378
358 int pcm_devs; 379 int pcm_devs;
359 snd_pcm_t *pcm[6]; 380 struct snd_pcm *pcm[6];
360 ichdev_t ichd[6]; 381 struct ichdev ichd[6];
361 382
362 unsigned multi4: 1, 383 unsigned multi4: 1,
363 multi6: 1, 384 multi6: 1,
@@ -374,8 +395,8 @@ struct _snd_intel8x0 {
374 int spdif_idx; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */ 395 int spdif_idx; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */
375 unsigned int sdm_saved; /* SDM reg value */ 396 unsigned int sdm_saved; /* SDM reg value */
376 397
377 ac97_bus_t *ac97_bus; 398 struct snd_ac97_bus *ac97_bus;
378 ac97_t *ac97[3]; 399 struct snd_ac97 *ac97[3];
379 unsigned int ac97_sdin[3]; 400 unsigned int ac97_sdin[3];
380 401
381 spinlock_t reg_lock; 402 spinlock_t reg_lock;
@@ -418,7 +439,7 @@ MODULE_DEVICE_TABLE(pci, snd_intel8x0_ids);
418 * Lowlevel I/O - busmaster 439 * Lowlevel I/O - busmaster
419 */ 440 */
420 441
421static u8 igetbyte(intel8x0_t *chip, u32 offset) 442static u8 igetbyte(struct intel8x0 *chip, u32 offset)
422{ 443{
423 if (chip->bm_mmio) 444 if (chip->bm_mmio)
424 return readb(chip->remap_bmaddr + offset); 445 return readb(chip->remap_bmaddr + offset);
@@ -426,7 +447,7 @@ static u8 igetbyte(intel8x0_t *chip, u32 offset)
426 return inb(chip->bmaddr + offset); 447 return inb(chip->bmaddr + offset);
427} 448}
428 449
429static u16 igetword(intel8x0_t *chip, u32 offset) 450static u16 igetword(struct intel8x0 *chip, u32 offset)
430{ 451{
431 if (chip->bm_mmio) 452 if (chip->bm_mmio)
432 return readw(chip->remap_bmaddr + offset); 453 return readw(chip->remap_bmaddr + offset);
@@ -434,7 +455,7 @@ static u16 igetword(intel8x0_t *chip, u32 offset)
434 return inw(chip->bmaddr + offset); 455 return inw(chip->bmaddr + offset);
435} 456}
436 457
437static u32 igetdword(intel8x0_t *chip, u32 offset) 458static u32 igetdword(struct intel8x0 *chip, u32 offset)
438{ 459{
439 if (chip->bm_mmio) 460 if (chip->bm_mmio)
440 return readl(chip->remap_bmaddr + offset); 461 return readl(chip->remap_bmaddr + offset);
@@ -442,7 +463,7 @@ static u32 igetdword(intel8x0_t *chip, u32 offset)
442 return inl(chip->bmaddr + offset); 463 return inl(chip->bmaddr + offset);
443} 464}
444 465
445static void iputbyte(intel8x0_t *chip, u32 offset, u8 val) 466static void iputbyte(struct intel8x0 *chip, u32 offset, u8 val)
446{ 467{
447 if (chip->bm_mmio) 468 if (chip->bm_mmio)
448 writeb(val, chip->remap_bmaddr + offset); 469 writeb(val, chip->remap_bmaddr + offset);
@@ -450,7 +471,7 @@ static void iputbyte(intel8x0_t *chip, u32 offset, u8 val)
450 outb(val, chip->bmaddr + offset); 471 outb(val, chip->bmaddr + offset);
451} 472}
452 473
453static void iputword(intel8x0_t *chip, u32 offset, u16 val) 474static void iputword(struct intel8x0 *chip, u32 offset, u16 val)
454{ 475{
455 if (chip->bm_mmio) 476 if (chip->bm_mmio)
456 writew(val, chip->remap_bmaddr + offset); 477 writew(val, chip->remap_bmaddr + offset);
@@ -458,7 +479,7 @@ static void iputword(intel8x0_t *chip, u32 offset, u16 val)
458 outw(val, chip->bmaddr + offset); 479 outw(val, chip->bmaddr + offset);
459} 480}
460 481
461static void iputdword(intel8x0_t *chip, u32 offset, u32 val) 482static void iputdword(struct intel8x0 *chip, u32 offset, u32 val)
462{ 483{
463 if (chip->bm_mmio) 484 if (chip->bm_mmio)
464 writel(val, chip->remap_bmaddr + offset); 485 writel(val, chip->remap_bmaddr + offset);
@@ -470,7 +491,7 @@ static void iputdword(intel8x0_t *chip, u32 offset, u32 val)
470 * Lowlevel I/O - AC'97 registers 491 * Lowlevel I/O - AC'97 registers
471 */ 492 */
472 493
473static u16 iagetword(intel8x0_t *chip, u32 offset) 494static u16 iagetword(struct intel8x0 *chip, u32 offset)
474{ 495{
475 if (chip->mmio) 496 if (chip->mmio)
476 return readw(chip->remap_addr + offset); 497 return readw(chip->remap_addr + offset);
@@ -478,7 +499,7 @@ static u16 iagetword(intel8x0_t *chip, u32 offset)
478 return inw(chip->addr + offset); 499 return inw(chip->addr + offset);
479} 500}
480 501
481static void iaputword(intel8x0_t *chip, u32 offset, u16 val) 502static void iaputword(struct intel8x0 *chip, u32 offset, u16 val)
482{ 503{
483 if (chip->mmio) 504 if (chip->mmio)
484 writew(val, chip->remap_addr + offset); 505 writew(val, chip->remap_addr + offset);
@@ -495,7 +516,7 @@ static void iaputword(intel8x0_t *chip, u32 offset, u16 val)
495 */ 516 */
496 517
497/* return the GLOB_STA bit for the corresponding codec */ 518/* return the GLOB_STA bit for the corresponding codec */
498static unsigned int get_ich_codec_bit(intel8x0_t *chip, unsigned int codec) 519static unsigned int get_ich_codec_bit(struct intel8x0 *chip, unsigned int codec)
499{ 520{
500 static unsigned int codec_bit[3] = { 521 static unsigned int codec_bit[3] = {
501 ICH_PCR, ICH_SCR, ICH_TCR 522 ICH_PCR, ICH_SCR, ICH_TCR
@@ -506,7 +527,7 @@ static unsigned int get_ich_codec_bit(intel8x0_t *chip, unsigned int codec)
506 return codec_bit[codec]; 527 return codec_bit[codec];
507} 528}
508 529
509static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec) 530static int snd_intel8x0_codec_semaphore(struct intel8x0 *chip, unsigned int codec)
510{ 531{
511 int time; 532 int time;
512 533
@@ -545,11 +566,11 @@ static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec)
545 return -EBUSY; 566 return -EBUSY;
546} 567}
547 568
548static void snd_intel8x0_codec_write(ac97_t *ac97, 569static void snd_intel8x0_codec_write(struct snd_ac97 *ac97,
549 unsigned short reg, 570 unsigned short reg,
550 unsigned short val) 571 unsigned short val)
551{ 572{
552 intel8x0_t *chip = ac97->private_data; 573 struct intel8x0 *chip = ac97->private_data;
553 574
554 if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) { 575 if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
555 if (! chip->in_ac97_init) 576 if (! chip->in_ac97_init)
@@ -558,10 +579,10 @@ static void snd_intel8x0_codec_write(ac97_t *ac97,
558 iaputword(chip, reg + ac97->num * 0x80, val); 579 iaputword(chip, reg + ac97->num * 0x80, val);
559} 580}
560 581
561static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, 582static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
562 unsigned short reg) 583 unsigned short reg)
563{ 584{
564 intel8x0_t *chip = ac97->private_data; 585 struct intel8x0 *chip = ac97->private_data;
565 unsigned short res; 586 unsigned short res;
566 unsigned int tmp; 587 unsigned int tmp;
567 588
@@ -573,7 +594,8 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97,
573 res = iagetword(chip, reg + ac97->num * 0x80); 594 res = iagetword(chip, reg + ac97->num * 0x80);
574 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { 595 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) {
575 /* reset RCS and preserve other R/WC bits */ 596 /* reset RCS and preserve other R/WC bits */
576 iputdword(chip, ICHREG(GLOB_STA), tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); 597 iputdword(chip, ICHREG(GLOB_STA), tmp &
598 ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI));
577 if (! chip->in_ac97_init) 599 if (! chip->in_ac97_init)
578 snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg); 600 snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
579 res = 0xffff; 601 res = 0xffff;
@@ -582,7 +604,7 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97,
582 return res; 604 return res;
583} 605}
584 606
585static void snd_intel8x0_codec_read_test(intel8x0_t *chip, unsigned int codec) 607static void snd_intel8x0_codec_read_test(struct intel8x0 *chip, unsigned int codec)
586{ 608{
587 unsigned int tmp; 609 unsigned int tmp;
588 610
@@ -590,7 +612,8 @@ static void snd_intel8x0_codec_read_test(intel8x0_t *chip, unsigned int codec)
590 iagetword(chip, codec * 0x80); 612 iagetword(chip, codec * 0x80);
591 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { 613 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) {
592 /* reset RCS and preserve other R/WC bits */ 614 /* reset RCS and preserve other R/WC bits */
593 iputdword(chip, ICHREG(GLOB_STA), tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); 615 iputdword(chip, ICHREG(GLOB_STA), tmp &
616 ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI));
594 } 617 }
595 } 618 }
596} 619}
@@ -598,7 +621,7 @@ static void snd_intel8x0_codec_read_test(intel8x0_t *chip, unsigned int codec)
598/* 621/*
599 * access to AC97 for Ali5455 622 * access to AC97 for Ali5455
600 */ 623 */
601static int snd_intel8x0_ali_codec_ready(intel8x0_t *chip, int mask) 624static int snd_intel8x0_ali_codec_ready(struct intel8x0 *chip, int mask)
602{ 625{
603 int count = 0; 626 int count = 0;
604 for (count = 0; count < 0x7f; count++) { 627 for (count = 0; count < 0x7f; count++) {
@@ -611,7 +634,7 @@ static int snd_intel8x0_ali_codec_ready(intel8x0_t *chip, int mask)
611 return -EBUSY; 634 return -EBUSY;
612} 635}
613 636
614static int snd_intel8x0_ali_codec_semaphore(intel8x0_t *chip) 637static int snd_intel8x0_ali_codec_semaphore(struct intel8x0 *chip)
615{ 638{
616 int time = 100; 639 int time = 100;
617 if (chip->buggy_semaphore) 640 if (chip->buggy_semaphore)
@@ -623,9 +646,9 @@ static int snd_intel8x0_ali_codec_semaphore(intel8x0_t *chip)
623 return snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_CODEC_READY); 646 return snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_CODEC_READY);
624} 647}
625 648
626static unsigned short snd_intel8x0_ali_codec_read(ac97_t *ac97, unsigned short reg) 649static unsigned short snd_intel8x0_ali_codec_read(struct snd_ac97 *ac97, unsigned short reg)
627{ 650{
628 intel8x0_t *chip = ac97->private_data; 651 struct intel8x0 *chip = ac97->private_data;
629 unsigned short data = 0xffff; 652 unsigned short data = 0xffff;
630 653
631 if (snd_intel8x0_ali_codec_semaphore(chip)) 654 if (snd_intel8x0_ali_codec_semaphore(chip))
@@ -641,9 +664,10 @@ static unsigned short snd_intel8x0_ali_codec_read(ac97_t *ac97, unsigned short r
641 return data; 664 return data;
642} 665}
643 666
644static void snd_intel8x0_ali_codec_write(ac97_t *ac97, unsigned short reg, unsigned short val) 667static void snd_intel8x0_ali_codec_write(struct snd_ac97 *ac97, unsigned short reg,
668 unsigned short val)
645{ 669{
646 intel8x0_t *chip = ac97->private_data; 670 struct intel8x0 *chip = ac97->private_data;
647 671
648 if (snd_intel8x0_ali_codec_semaphore(chip)) 672 if (snd_intel8x0_ali_codec_semaphore(chip))
649 return; 673 return;
@@ -658,7 +682,7 @@ static void snd_intel8x0_ali_codec_write(ac97_t *ac97, unsigned short reg, unsig
658/* 682/*
659 * DMA I/O 683 * DMA I/O
660 */ 684 */
661static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev) 685static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
662{ 686{
663 int idx; 687 int idx;
664 u32 *bdbar = ichdev->bdbar; 688 u32 *bdbar = ichdev->bdbar;
@@ -681,10 +705,15 @@ static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev)
681 ichdev->ack_reload = ichdev->ack = 1; 705 ichdev->ack_reload = ichdev->ack = 1;
682 ichdev->fragsize1 = ichdev->fragsize; 706 ichdev->fragsize1 = ichdev->fragsize;
683 for (idx = 0; idx < (ICH_REG_LVI_MASK + 1) * 2; idx += 2) { 707 for (idx = 0; idx < (ICH_REG_LVI_MASK + 1) * 2; idx += 2) {
684 bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size)); 708 bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf +
709 (((idx >> 1) * ichdev->fragsize) %
710 ichdev->size));
685 bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */ 711 bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */
686 ichdev->fragsize >> ichdev->pos_shift); 712 ichdev->fragsize >> ichdev->pos_shift);
687 // printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]); 713#if 0
714 printk("bdbar[%i] = 0x%x [0x%x]\n",
715 idx + 0, bdbar[idx + 0], bdbar[idx + 1]);
716#endif
688 } 717 }
689 ichdev->frags = ichdev->size / ichdev->fragsize; 718 ichdev->frags = ichdev->size / ichdev->fragsize;
690 } 719 }
@@ -722,7 +751,7 @@ static void fill_nocache(void *buf, int size, int nocache)
722 * Interrupt handler 751 * Interrupt handler
723 */ 752 */
724 753
725static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) 754static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev)
726{ 755{
727 unsigned long port = ichdev->reg_offset; 756 unsigned long port = ichdev->reg_offset;
728 int status, civ, i, step; 757 int status, civ, i, step;
@@ -757,7 +786,12 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev)
757 ichdev->lvi_frag++; 786 ichdev->lvi_frag++;
758 ichdev->lvi_frag %= ichdev->frags; 787 ichdev->lvi_frag %= ichdev->frags;
759 ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + ichdev->lvi_frag * ichdev->fragsize1); 788 ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + ichdev->lvi_frag * ichdev->fragsize1);
760 // printk("new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), inl(port + 4), inb(port + ICH_REG_OFF_CR)); 789#if 0
790 printk("new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n",
791 ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2],
792 ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port),
793 inl(port + 4), inb(port + ICH_REG_OFF_CR));
794#endif
761 if (--ichdev->ack == 0) { 795 if (--ichdev->ack == 0) {
762 ichdev->ack = ichdev->ack_reload; 796 ichdev->ack = ichdev->ack_reload;
763 ack = 1; 797 ack = 1;
@@ -773,8 +807,8 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev)
773 807
774static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) 808static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs)
775{ 809{
776 intel8x0_t *chip = dev_id; 810 struct intel8x0 *chip = dev_id;
777 ichdev_t *ichdev; 811 struct ichdev *ichdev;
778 unsigned int status; 812 unsigned int status;
779 unsigned int i; 813 unsigned int i;
780 814
@@ -808,10 +842,10 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs
808 * PCM part 842 * PCM part
809 */ 843 */
810 844
811static int snd_intel8x0_pcm_trigger(snd_pcm_substream_t *substream, int cmd) 845static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
812{ 846{
813 intel8x0_t *chip = snd_pcm_substream_chip(substream); 847 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
814 ichdev_t *ichdev = get_ichdev(substream); 848 struct ichdev *ichdev = get_ichdev(substream);
815 unsigned char val = 0; 849 unsigned char val = 0;
816 unsigned long port = ichdev->reg_offset; 850 unsigned long port = ichdev->reg_offset;
817 851
@@ -847,12 +881,14 @@ static int snd_intel8x0_pcm_trigger(snd_pcm_substream_t *substream, int cmd)
847 return 0; 881 return 0;
848} 882}
849 883
850static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd) 884static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd)
851{ 885{
852 intel8x0_t *chip = snd_pcm_substream_chip(substream); 886 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
853 ichdev_t *ichdev = get_ichdev(substream); 887 struct ichdev *ichdev = get_ichdev(substream);
854 unsigned long port = ichdev->reg_offset; 888 unsigned long port = ichdev->reg_offset;
855 static int fiforeg[] = { ICHREG(ALI_FIFOCR1), ICHREG(ALI_FIFOCR2), ICHREG(ALI_FIFOCR3) }; 889 static int fiforeg[] = {
890 ICHREG(ALI_FIFOCR1), ICHREG(ALI_FIFOCR2), ICHREG(ALI_FIFOCR3)
891 };
856 unsigned int val, fifo; 892 unsigned int val, fifo;
857 893
858 val = igetdword(chip, ICHREG(ALI_DMACR)); 894 val = igetdword(chip, ICHREG(ALI_DMACR));
@@ -871,14 +907,16 @@ static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd)
871 } 907 }
872 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE); 908 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE);
873 val &= ~(1 << (ichdev->ali_slot + 16)); /* clear PAUSE flag */ 909 val &= ~(1 << (ichdev->ali_slot + 16)); /* clear PAUSE flag */
874 iputdword(chip, ICHREG(ALI_DMACR), val | (1 << ichdev->ali_slot)); /* start DMA */ 910 /* start DMA */
911 iputdword(chip, ICHREG(ALI_DMACR), val | (1 << ichdev->ali_slot));
875 break; 912 break;
876 case SNDRV_PCM_TRIGGER_SUSPEND: 913 case SNDRV_PCM_TRIGGER_SUSPEND:
877 ichdev->suspended = 1; 914 ichdev->suspended = 1;
878 /* fallthru */ 915 /* fallthru */
879 case SNDRV_PCM_TRIGGER_STOP: 916 case SNDRV_PCM_TRIGGER_STOP:
880 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 917 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
881 iputdword(chip, ICHREG(ALI_DMACR), val | (1 << (ichdev->ali_slot + 16))); /* pause */ 918 /* pause */
919 iputdword(chip, ICHREG(ALI_DMACR), val | (1 << (ichdev->ali_slot + 16)));
882 iputbyte(chip, port + ICH_REG_OFF_CR, 0); 920 iputbyte(chip, port + ICH_REG_OFF_CR, 0);
883 while (igetbyte(chip, port + ICH_REG_OFF_CR)) 921 while (igetbyte(chip, port + ICH_REG_OFF_CR))
884 ; 922 ;
@@ -887,7 +925,8 @@ static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd)
887 /* reset whole DMA things */ 925 /* reset whole DMA things */
888 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS); 926 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS);
889 /* clear interrupts */ 927 /* clear interrupts */
890 iputbyte(chip, port + ICH_REG_OFF_SR, igetbyte(chip, port + ICH_REG_OFF_SR) | 0x1e); 928 iputbyte(chip, port + ICH_REG_OFF_SR,
929 igetbyte(chip, port + ICH_REG_OFF_SR) | 0x1e);
891 iputdword(chip, ICHREG(ALI_INTERRUPTSR), 930 iputdword(chip, ICHREG(ALI_INTERRUPTSR),
892 igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ichdev->int_sta_mask); 931 igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ichdev->int_sta_mask);
893 break; 932 break;
@@ -897,12 +936,12 @@ static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd)
897 return 0; 936 return 0;
898} 937}
899 938
900static int snd_intel8x0_hw_params(snd_pcm_substream_t * substream, 939static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream,
901 snd_pcm_hw_params_t * hw_params) 940 struct snd_pcm_hw_params *hw_params)
902{ 941{
903 intel8x0_t *chip = snd_pcm_substream_chip(substream); 942 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
904 ichdev_t *ichdev = get_ichdev(substream); 943 struct ichdev *ichdev = get_ichdev(substream);
905 snd_pcm_runtime_t *runtime = substream->runtime; 944 struct snd_pcm_runtime *runtime = substream->runtime;
906 int dbl = params_rate(hw_params) > 48000; 945 int dbl = params_rate(hw_params) > 48000;
907 int err; 946 int err;
908 947
@@ -930,15 +969,16 @@ static int snd_intel8x0_hw_params(snd_pcm_substream_t * substream,
930 ichdev->pcm_open_flag = 1; 969 ichdev->pcm_open_flag = 1;
931 /* Force SPDIF setting */ 970 /* Force SPDIF setting */
932 if (ichdev->ichd == ICHD_PCMOUT && chip->spdif_idx < 0) 971 if (ichdev->ichd == ICHD_PCMOUT && chip->spdif_idx < 0)
933 snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF, params_rate(hw_params)); 972 snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF,
973 params_rate(hw_params));
934 } 974 }
935 return err; 975 return err;
936} 976}
937 977
938static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream) 978static int snd_intel8x0_hw_free(struct snd_pcm_substream *substream)
939{ 979{
940 intel8x0_t *chip = snd_pcm_substream_chip(substream); 980 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
941 ichdev_t *ichdev = get_ichdev(substream); 981 struct ichdev *ichdev = get_ichdev(substream);
942 982
943 if (ichdev->pcm_open_flag) { 983 if (ichdev->pcm_open_flag) {
944 snd_ac97_pcm_close(ichdev->pcm); 984 snd_ac97_pcm_close(ichdev->pcm);
@@ -951,8 +991,8 @@ static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream)
951 return snd_pcm_lib_free_pages(substream); 991 return snd_pcm_lib_free_pages(substream);
952} 992}
953 993
954static void snd_intel8x0_setup_pcm_out(intel8x0_t *chip, 994static void snd_intel8x0_setup_pcm_out(struct intel8x0 *chip,
955 snd_pcm_runtime_t *runtime) 995 struct snd_pcm_runtime *runtime)
956{ 996{
957 unsigned int cnt; 997 unsigned int cnt;
958 int dbl = runtime->rate > 48000; 998 int dbl = runtime->rate > 48000;
@@ -1004,11 +1044,11 @@ static void snd_intel8x0_setup_pcm_out(intel8x0_t *chip,
1004 spin_unlock_irq(&chip->reg_lock); 1044 spin_unlock_irq(&chip->reg_lock);
1005} 1045}
1006 1046
1007static int snd_intel8x0_pcm_prepare(snd_pcm_substream_t * substream) 1047static int snd_intel8x0_pcm_prepare(struct snd_pcm_substream *substream)
1008{ 1048{
1009 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1049 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1010 snd_pcm_runtime_t *runtime = substream->runtime; 1050 struct snd_pcm_runtime *runtime = substream->runtime;
1011 ichdev_t *ichdev = get_ichdev(substream); 1051 struct ichdev *ichdev = get_ichdev(substream);
1012 1052
1013 ichdev->physbuf = runtime->dma_addr; 1053 ichdev->physbuf = runtime->dma_addr;
1014 ichdev->size = snd_pcm_lib_buffer_bytes(substream); 1054 ichdev->size = snd_pcm_lib_buffer_bytes(substream);
@@ -1022,10 +1062,10 @@ static int snd_intel8x0_pcm_prepare(snd_pcm_substream_t * substream)
1022 return 0; 1062 return 0;
1023} 1063}
1024 1064
1025static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substream) 1065static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *substream)
1026{ 1066{
1027 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1067 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1028 ichdev_t *ichdev = get_ichdev(substream); 1068 struct ichdev *ichdev = get_ichdev(substream);
1029 size_t ptr1, ptr; 1069 size_t ptr1, ptr;
1030 int civ, timeout = 100; 1070 int civ, timeout = 100;
1031 unsigned int position; 1071 unsigned int position;
@@ -1052,7 +1092,7 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substrea
1052 return bytes_to_frames(substream->runtime, ptr); 1092 return bytes_to_frames(substream->runtime, ptr);
1053} 1093}
1054 1094
1055static snd_pcm_hardware_t snd_intel8x0_stream = 1095static struct snd_pcm_hardware snd_intel8x0_stream =
1056{ 1096{
1057 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1097 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1058 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1098 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1077,7 +1117,7 @@ static unsigned int channels4[] = {
1077 2, 4, 1117 2, 4,
1078}; 1118};
1079 1119
1080static snd_pcm_hw_constraint_list_t hw_constraints_channels4 = { 1120static struct snd_pcm_hw_constraint_list hw_constraints_channels4 = {
1081 .count = ARRAY_SIZE(channels4), 1121 .count = ARRAY_SIZE(channels4),
1082 .list = channels4, 1122 .list = channels4,
1083 .mask = 0, 1123 .mask = 0,
@@ -1087,16 +1127,16 @@ static unsigned int channels6[] = {
1087 2, 4, 6, 1127 2, 4, 6,
1088}; 1128};
1089 1129
1090static snd_pcm_hw_constraint_list_t hw_constraints_channels6 = { 1130static struct snd_pcm_hw_constraint_list hw_constraints_channels6 = {
1091 .count = ARRAY_SIZE(channels6), 1131 .count = ARRAY_SIZE(channels6),
1092 .list = channels6, 1132 .list = channels6,
1093 .mask = 0, 1133 .mask = 0,
1094}; 1134};
1095 1135
1096static int snd_intel8x0_pcm_open(snd_pcm_substream_t * substream, ichdev_t *ichdev) 1136static int snd_intel8x0_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev)
1097{ 1137{
1098 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1138 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1099 snd_pcm_runtime_t *runtime = substream->runtime; 1139 struct snd_pcm_runtime *runtime = substream->runtime;
1100 int err; 1140 int err;
1101 1141
1102 ichdev->substream = substream; 1142 ichdev->substream = substream;
@@ -1113,10 +1153,10 @@ static int snd_intel8x0_pcm_open(snd_pcm_substream_t * substream, ichdev_t *ichd
1113 return 0; 1153 return 0;
1114} 1154}
1115 1155
1116static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream) 1156static int snd_intel8x0_playback_open(struct snd_pcm_substream *substream)
1117{ 1157{
1118 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1158 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1119 snd_pcm_runtime_t *runtime = substream->runtime; 1159 struct snd_pcm_runtime *runtime = substream->runtime;
1120 int err; 1160 int err;
1121 1161
1122 err = snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMOUT]); 1162 err = snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMOUT]);
@@ -1125,10 +1165,12 @@ static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream)
1125 1165
1126 if (chip->multi6) { 1166 if (chip->multi6) {
1127 runtime->hw.channels_max = 6; 1167 runtime->hw.channels_max = 6;
1128 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels6); 1168 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
1169 &hw_constraints_channels6);
1129 } else if (chip->multi4) { 1170 } else if (chip->multi4) {
1130 runtime->hw.channels_max = 4; 1171 runtime->hw.channels_max = 4;
1131 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels4); 1172 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
1173 &hw_constraints_channels4);
1132 } 1174 }
1133 if (chip->dra) { 1175 if (chip->dra) {
1134 snd_ac97_pcm_double_rate_rules(runtime); 1176 snd_ac97_pcm_double_rate_rules(runtime);
@@ -1140,94 +1182,94 @@ static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream)
1140 return 0; 1182 return 0;
1141} 1183}
1142 1184
1143static int snd_intel8x0_playback_close(snd_pcm_substream_t * substream) 1185static int snd_intel8x0_playback_close(struct snd_pcm_substream *substream)
1144{ 1186{
1145 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1187 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1146 1188
1147 chip->ichd[ICHD_PCMOUT].substream = NULL; 1189 chip->ichd[ICHD_PCMOUT].substream = NULL;
1148 return 0; 1190 return 0;
1149} 1191}
1150 1192
1151static int snd_intel8x0_capture_open(snd_pcm_substream_t * substream) 1193static int snd_intel8x0_capture_open(struct snd_pcm_substream *substream)
1152{ 1194{
1153 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1195 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1154 1196
1155 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMIN]); 1197 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMIN]);
1156} 1198}
1157 1199
1158static int snd_intel8x0_capture_close(snd_pcm_substream_t * substream) 1200static int snd_intel8x0_capture_close(struct snd_pcm_substream *substream)
1159{ 1201{
1160 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1202 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1161 1203
1162 chip->ichd[ICHD_PCMIN].substream = NULL; 1204 chip->ichd[ICHD_PCMIN].substream = NULL;
1163 return 0; 1205 return 0;
1164} 1206}
1165 1207
1166static int snd_intel8x0_mic_open(snd_pcm_substream_t * substream) 1208static int snd_intel8x0_mic_open(struct snd_pcm_substream *substream)
1167{ 1209{
1168 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1210 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1169 1211
1170 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC]); 1212 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC]);
1171} 1213}
1172 1214
1173static int snd_intel8x0_mic_close(snd_pcm_substream_t * substream) 1215static int snd_intel8x0_mic_close(struct snd_pcm_substream *substream)
1174{ 1216{
1175 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1217 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1176 1218
1177 chip->ichd[ICHD_MIC].substream = NULL; 1219 chip->ichd[ICHD_MIC].substream = NULL;
1178 return 0; 1220 return 0;
1179} 1221}
1180 1222
1181static int snd_intel8x0_mic2_open(snd_pcm_substream_t * substream) 1223static int snd_intel8x0_mic2_open(struct snd_pcm_substream *substream)
1182{ 1224{
1183 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1225 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1184 1226
1185 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC2]); 1227 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC2]);
1186} 1228}
1187 1229
1188static int snd_intel8x0_mic2_close(snd_pcm_substream_t * substream) 1230static int snd_intel8x0_mic2_close(struct snd_pcm_substream *substream)
1189{ 1231{
1190 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1232 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1191 1233
1192 chip->ichd[ICHD_MIC2].substream = NULL; 1234 chip->ichd[ICHD_MIC2].substream = NULL;
1193 return 0; 1235 return 0;
1194} 1236}
1195 1237
1196static int snd_intel8x0_capture2_open(snd_pcm_substream_t * substream) 1238static int snd_intel8x0_capture2_open(struct snd_pcm_substream *substream)
1197{ 1239{
1198 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1240 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1199 1241
1200 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCM2IN]); 1242 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCM2IN]);
1201} 1243}
1202 1244
1203static int snd_intel8x0_capture2_close(snd_pcm_substream_t * substream) 1245static int snd_intel8x0_capture2_close(struct snd_pcm_substream *substream)
1204{ 1246{
1205 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1247 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1206 1248
1207 chip->ichd[ICHD_PCM2IN].substream = NULL; 1249 chip->ichd[ICHD_PCM2IN].substream = NULL;
1208 return 0; 1250 return 0;
1209} 1251}
1210 1252
1211static int snd_intel8x0_spdif_open(snd_pcm_substream_t * substream) 1253static int snd_intel8x0_spdif_open(struct snd_pcm_substream *substream)
1212{ 1254{
1213 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1255 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1214 int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR; 1256 int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR;
1215 1257
1216 return snd_intel8x0_pcm_open(substream, &chip->ichd[idx]); 1258 return snd_intel8x0_pcm_open(substream, &chip->ichd[idx]);
1217} 1259}
1218 1260
1219static int snd_intel8x0_spdif_close(snd_pcm_substream_t * substream) 1261static int snd_intel8x0_spdif_close(struct snd_pcm_substream *substream)
1220{ 1262{
1221 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1263 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1222 int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR; 1264 int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR;
1223 1265
1224 chip->ichd[idx].substream = NULL; 1266 chip->ichd[idx].substream = NULL;
1225 return 0; 1267 return 0;
1226} 1268}
1227 1269
1228static int snd_intel8x0_ali_ac97spdifout_open(snd_pcm_substream_t * substream) 1270static int snd_intel8x0_ali_ac97spdifout_open(struct snd_pcm_substream *substream)
1229{ 1271{
1230 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1272 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1231 unsigned int val; 1273 unsigned int val;
1232 1274
1233 spin_lock_irq(&chip->reg_lock); 1275 spin_lock_irq(&chip->reg_lock);
@@ -1240,9 +1282,9 @@ static int snd_intel8x0_ali_ac97spdifout_open(snd_pcm_substream_t * substream)
1240 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_AC97SPDIFOUT]); 1282 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_AC97SPDIFOUT]);
1241} 1283}
1242 1284
1243static int snd_intel8x0_ali_ac97spdifout_close(snd_pcm_substream_t * substream) 1285static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substream)
1244{ 1286{
1245 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1287 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1246 unsigned int val; 1288 unsigned int val;
1247 1289
1248 chip->ichd[ALID_AC97SPDIFOUT].substream = NULL; 1290 chip->ichd[ALID_AC97SPDIFOUT].substream = NULL;
@@ -1255,39 +1297,39 @@ static int snd_intel8x0_ali_ac97spdifout_close(snd_pcm_substream_t * substream)
1255 return 0; 1297 return 0;
1256} 1298}
1257 1299
1258static int snd_intel8x0_ali_spdifin_open(snd_pcm_substream_t * substream) 1300static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
1259{ 1301{
1260 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1302 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1261 1303
1262 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFIN]); 1304 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFIN]);
1263} 1305}
1264 1306
1265static int snd_intel8x0_ali_spdifin_close(snd_pcm_substream_t * substream) 1307static int snd_intel8x0_ali_spdifin_close(struct snd_pcm_substream *substream)
1266{ 1308{
1267 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1309 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1268 1310
1269 chip->ichd[ALID_SPDIFIN].substream = NULL; 1311 chip->ichd[ALID_SPDIFIN].substream = NULL;
1270 return 0; 1312 return 0;
1271} 1313}
1272 1314
1273#if 0 // NYI 1315#if 0 // NYI
1274static int snd_intel8x0_ali_spdifout_open(snd_pcm_substream_t * substream) 1316static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream)
1275{ 1317{
1276 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1318 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1277 1319
1278 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFOUT]); 1320 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFOUT]);
1279} 1321}
1280 1322
1281static int snd_intel8x0_ali_spdifout_close(snd_pcm_substream_t * substream) 1323static int snd_intel8x0_ali_spdifout_close(struct snd_pcm_substream *substream)
1282{ 1324{
1283 intel8x0_t *chip = snd_pcm_substream_chip(substream); 1325 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1284 1326
1285 chip->ichd[ALID_SPDIFOUT].substream = NULL; 1327 chip->ichd[ALID_SPDIFOUT].substream = NULL;
1286 return 0; 1328 return 0;
1287} 1329}
1288#endif 1330#endif
1289 1331
1290static snd_pcm_ops_t snd_intel8x0_playback_ops = { 1332static struct snd_pcm_ops snd_intel8x0_playback_ops = {
1291 .open = snd_intel8x0_playback_open, 1333 .open = snd_intel8x0_playback_open,
1292 .close = snd_intel8x0_playback_close, 1334 .close = snd_intel8x0_playback_close,
1293 .ioctl = snd_pcm_lib_ioctl, 1335 .ioctl = snd_pcm_lib_ioctl,
@@ -1298,7 +1340,7 @@ static snd_pcm_ops_t snd_intel8x0_playback_ops = {
1298 .pointer = snd_intel8x0_pcm_pointer, 1340 .pointer = snd_intel8x0_pcm_pointer,
1299}; 1341};
1300 1342
1301static snd_pcm_ops_t snd_intel8x0_capture_ops = { 1343static struct snd_pcm_ops snd_intel8x0_capture_ops = {
1302 .open = snd_intel8x0_capture_open, 1344 .open = snd_intel8x0_capture_open,
1303 .close = snd_intel8x0_capture_close, 1345 .close = snd_intel8x0_capture_close,
1304 .ioctl = snd_pcm_lib_ioctl, 1346 .ioctl = snd_pcm_lib_ioctl,
@@ -1309,7 +1351,7 @@ static snd_pcm_ops_t snd_intel8x0_capture_ops = {
1309 .pointer = snd_intel8x0_pcm_pointer, 1351 .pointer = snd_intel8x0_pcm_pointer,
1310}; 1352};
1311 1353
1312static snd_pcm_ops_t snd_intel8x0_capture_mic_ops = { 1354static struct snd_pcm_ops snd_intel8x0_capture_mic_ops = {
1313 .open = snd_intel8x0_mic_open, 1355 .open = snd_intel8x0_mic_open,
1314 .close = snd_intel8x0_mic_close, 1356 .close = snd_intel8x0_mic_close,
1315 .ioctl = snd_pcm_lib_ioctl, 1357 .ioctl = snd_pcm_lib_ioctl,
@@ -1320,7 +1362,7 @@ static snd_pcm_ops_t snd_intel8x0_capture_mic_ops = {
1320 .pointer = snd_intel8x0_pcm_pointer, 1362 .pointer = snd_intel8x0_pcm_pointer,
1321}; 1363};
1322 1364
1323static snd_pcm_ops_t snd_intel8x0_capture_mic2_ops = { 1365static struct snd_pcm_ops snd_intel8x0_capture_mic2_ops = {
1324 .open = snd_intel8x0_mic2_open, 1366 .open = snd_intel8x0_mic2_open,
1325 .close = snd_intel8x0_mic2_close, 1367 .close = snd_intel8x0_mic2_close,
1326 .ioctl = snd_pcm_lib_ioctl, 1368 .ioctl = snd_pcm_lib_ioctl,
@@ -1331,7 +1373,7 @@ static snd_pcm_ops_t snd_intel8x0_capture_mic2_ops = {
1331 .pointer = snd_intel8x0_pcm_pointer, 1373 .pointer = snd_intel8x0_pcm_pointer,
1332}; 1374};
1333 1375
1334static snd_pcm_ops_t snd_intel8x0_capture2_ops = { 1376static struct snd_pcm_ops snd_intel8x0_capture2_ops = {
1335 .open = snd_intel8x0_capture2_open, 1377 .open = snd_intel8x0_capture2_open,
1336 .close = snd_intel8x0_capture2_close, 1378 .close = snd_intel8x0_capture2_close,
1337 .ioctl = snd_pcm_lib_ioctl, 1379 .ioctl = snd_pcm_lib_ioctl,
@@ -1342,7 +1384,7 @@ static snd_pcm_ops_t snd_intel8x0_capture2_ops = {
1342 .pointer = snd_intel8x0_pcm_pointer, 1384 .pointer = snd_intel8x0_pcm_pointer,
1343}; 1385};
1344 1386
1345static snd_pcm_ops_t snd_intel8x0_spdif_ops = { 1387static struct snd_pcm_ops snd_intel8x0_spdif_ops = {
1346 .open = snd_intel8x0_spdif_open, 1388 .open = snd_intel8x0_spdif_open,
1347 .close = snd_intel8x0_spdif_close, 1389 .close = snd_intel8x0_spdif_close,
1348 .ioctl = snd_pcm_lib_ioctl, 1390 .ioctl = snd_pcm_lib_ioctl,
@@ -1353,7 +1395,7 @@ static snd_pcm_ops_t snd_intel8x0_spdif_ops = {
1353 .pointer = snd_intel8x0_pcm_pointer, 1395 .pointer = snd_intel8x0_pcm_pointer,
1354}; 1396};
1355 1397
1356static snd_pcm_ops_t snd_intel8x0_ali_playback_ops = { 1398static struct snd_pcm_ops snd_intel8x0_ali_playback_ops = {
1357 .open = snd_intel8x0_playback_open, 1399 .open = snd_intel8x0_playback_open,
1358 .close = snd_intel8x0_playback_close, 1400 .close = snd_intel8x0_playback_close,
1359 .ioctl = snd_pcm_lib_ioctl, 1401 .ioctl = snd_pcm_lib_ioctl,
@@ -1364,7 +1406,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_playback_ops = {
1364 .pointer = snd_intel8x0_pcm_pointer, 1406 .pointer = snd_intel8x0_pcm_pointer,
1365}; 1407};
1366 1408
1367static snd_pcm_ops_t snd_intel8x0_ali_capture_ops = { 1409static struct snd_pcm_ops snd_intel8x0_ali_capture_ops = {
1368 .open = snd_intel8x0_capture_open, 1410 .open = snd_intel8x0_capture_open,
1369 .close = snd_intel8x0_capture_close, 1411 .close = snd_intel8x0_capture_close,
1370 .ioctl = snd_pcm_lib_ioctl, 1412 .ioctl = snd_pcm_lib_ioctl,
@@ -1375,7 +1417,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_capture_ops = {
1375 .pointer = snd_intel8x0_pcm_pointer, 1417 .pointer = snd_intel8x0_pcm_pointer,
1376}; 1418};
1377 1419
1378static snd_pcm_ops_t snd_intel8x0_ali_capture_mic_ops = { 1420static struct snd_pcm_ops snd_intel8x0_ali_capture_mic_ops = {
1379 .open = snd_intel8x0_mic_open, 1421 .open = snd_intel8x0_mic_open,
1380 .close = snd_intel8x0_mic_close, 1422 .close = snd_intel8x0_mic_close,
1381 .ioctl = snd_pcm_lib_ioctl, 1423 .ioctl = snd_pcm_lib_ioctl,
@@ -1386,7 +1428,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_capture_mic_ops = {
1386 .pointer = snd_intel8x0_pcm_pointer, 1428 .pointer = snd_intel8x0_pcm_pointer,
1387}; 1429};
1388 1430
1389static snd_pcm_ops_t snd_intel8x0_ali_ac97spdifout_ops = { 1431static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = {
1390 .open = snd_intel8x0_ali_ac97spdifout_open, 1432 .open = snd_intel8x0_ali_ac97spdifout_open,
1391 .close = snd_intel8x0_ali_ac97spdifout_close, 1433 .close = snd_intel8x0_ali_ac97spdifout_close,
1392 .ioctl = snd_pcm_lib_ioctl, 1434 .ioctl = snd_pcm_lib_ioctl,
@@ -1397,7 +1439,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_ac97spdifout_ops = {
1397 .pointer = snd_intel8x0_pcm_pointer, 1439 .pointer = snd_intel8x0_pcm_pointer,
1398}; 1440};
1399 1441
1400static snd_pcm_ops_t snd_intel8x0_ali_spdifin_ops = { 1442static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
1401 .open = snd_intel8x0_ali_spdifin_open, 1443 .open = snd_intel8x0_ali_spdifin_open,
1402 .close = snd_intel8x0_ali_spdifin_close, 1444 .close = snd_intel8x0_ali_spdifin_close,
1403 .ioctl = snd_pcm_lib_ioctl, 1445 .ioctl = snd_pcm_lib_ioctl,
@@ -1409,7 +1451,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_spdifin_ops = {
1409}; 1451};
1410 1452
1411#if 0 // NYI 1453#if 0 // NYI
1412static snd_pcm_ops_t snd_intel8x0_ali_spdifout_ops = { 1454static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = {
1413 .open = snd_intel8x0_ali_spdifout_open, 1455 .open = snd_intel8x0_ali_spdifout_open,
1414 .close = snd_intel8x0_ali_spdifout_close, 1456 .close = snd_intel8x0_ali_spdifout_close,
1415 .ioctl = snd_pcm_lib_ioctl, 1457 .ioctl = snd_pcm_lib_ioctl,
@@ -1423,16 +1465,17 @@ static snd_pcm_ops_t snd_intel8x0_ali_spdifout_ops = {
1423 1465
1424struct ich_pcm_table { 1466struct ich_pcm_table {
1425 char *suffix; 1467 char *suffix;
1426 snd_pcm_ops_t *playback_ops; 1468 struct snd_pcm_ops *playback_ops;
1427 snd_pcm_ops_t *capture_ops; 1469 struct snd_pcm_ops *capture_ops;
1428 size_t prealloc_size; 1470 size_t prealloc_size;
1429 size_t prealloc_max_size; 1471 size_t prealloc_max_size;
1430 int ac97_idx; 1472 int ac97_idx;
1431}; 1473};
1432 1474
1433static int __devinit snd_intel8x0_pcm1(intel8x0_t *chip, int device, struct ich_pcm_table *rec) 1475static int __devinit snd_intel8x0_pcm1(struct intel8x0 *chip, int device,
1476 struct ich_pcm_table *rec)
1434{ 1477{
1435 snd_pcm_t *pcm; 1478 struct snd_pcm *pcm;
1436 int err; 1479 int err;
1437 char name[32]; 1480 char name[32];
1438 1481
@@ -1459,7 +1502,8 @@ static int __devinit snd_intel8x0_pcm1(intel8x0_t *chip, int device, struct ich_
1459 strcpy(pcm->name, chip->card->shortname); 1502 strcpy(pcm->name, chip->card->shortname);
1460 chip->pcm[device] = pcm; 1503 chip->pcm[device] = pcm;
1461 1504
1462 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), 1505 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1506 snd_dma_pci_data(chip->pci),
1463 rec->prealloc_size, rec->prealloc_max_size); 1507 rec->prealloc_size, rec->prealloc_max_size);
1464 1508
1465 return 0; 1509 return 0;
@@ -1557,7 +1601,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = {
1557#endif 1601#endif
1558}; 1602};
1559 1603
1560static int __devinit snd_intel8x0_pcm(intel8x0_t *chip) 1604static int __devinit snd_intel8x0_pcm(struct intel8x0 *chip)
1561{ 1605{
1562 int i, tblsize, device, err; 1606 int i, tblsize, device, err;
1563 struct ich_pcm_table *tbl, *rec; 1607 struct ich_pcm_table *tbl, *rec;
@@ -1604,15 +1648,15 @@ static int __devinit snd_intel8x0_pcm(intel8x0_t *chip)
1604 * Mixer part 1648 * Mixer part
1605 */ 1649 */
1606 1650
1607static void snd_intel8x0_mixer_free_ac97_bus(ac97_bus_t *bus) 1651static void snd_intel8x0_mixer_free_ac97_bus(struct snd_ac97_bus *bus)
1608{ 1652{
1609 intel8x0_t *chip = bus->private_data; 1653 struct intel8x0 *chip = bus->private_data;
1610 chip->ac97_bus = NULL; 1654 chip->ac97_bus = NULL;
1611} 1655}
1612 1656
1613static void snd_intel8x0_mixer_free_ac97(ac97_t *ac97) 1657static void snd_intel8x0_mixer_free_ac97(struct snd_ac97 *ac97)
1614{ 1658{
1615 intel8x0_t *chip = ac97->private_data; 1659 struct intel8x0 *chip = ac97->private_data;
1616 chip->ac97[ac97->num] = NULL; 1660 chip->ac97[ac97->num] = NULL;
1617} 1661}
1618 1662
@@ -1961,19 +2005,20 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1961 { } /* terminator */ 2005 { } /* terminator */
1962}; 2006};
1963 2007
1964static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const char *quirk_override) 2008static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
2009 const char *quirk_override)
1965{ 2010{
1966 ac97_bus_t *pbus; 2011 struct snd_ac97_bus *pbus;
1967 ac97_template_t ac97; 2012 struct snd_ac97_template ac97;
1968 int err; 2013 int err;
1969 unsigned int i, codecs; 2014 unsigned int i, codecs;
1970 unsigned int glob_sta = 0; 2015 unsigned int glob_sta = 0;
1971 ac97_bus_ops_t *ops; 2016 struct snd_ac97_bus_ops *ops;
1972 static ac97_bus_ops_t standard_bus_ops = { 2017 static struct snd_ac97_bus_ops standard_bus_ops = {
1973 .write = snd_intel8x0_codec_write, 2018 .write = snd_intel8x0_codec_write,
1974 .read = snd_intel8x0_codec_read, 2019 .read = snd_intel8x0_codec_read,
1975 }; 2020 };
1976 static ac97_bus_ops_t ali_bus_ops = { 2021 static struct snd_ac97_bus_ops ali_bus_ops = {
1977 .write = snd_intel8x0_ali_codec_write, 2022 .write = snd_intel8x0_ali_codec_write,
1978 .read = snd_intel8x0_ali_codec_read, 2023 .read = snd_intel8x0_ali_codec_read,
1979 }; 2024 };
@@ -2128,7 +2173,8 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const
2128 __err: 2173 __err:
2129 /* clear the cold-reset bit for the next chance */ 2174 /* clear the cold-reset bit for the next chance */
2130 if (chip->device_type != DEVICE_ALI) 2175 if (chip->device_type != DEVICE_ALI)
2131 iputdword(chip, ICHREG(GLOB_CNT), igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD); 2176 iputdword(chip, ICHREG(GLOB_CNT),
2177 igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD);
2132 return err; 2178 return err;
2133} 2179}
2134 2180
@@ -2137,7 +2183,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const
2137 * 2183 *
2138 */ 2184 */
2139 2185
2140static void do_ali_reset(intel8x0_t *chip) 2186static void do_ali_reset(struct intel8x0 *chip)
2141{ 2187{
2142 iputdword(chip, ICHREG(ALI_SCR), ICH_ALI_SC_RESET); 2188 iputdword(chip, ICHREG(ALI_SCR), ICH_ALI_SC_RESET);
2143 iputdword(chip, ICHREG(ALI_FIFOCR1), 0x83838383); 2189 iputdword(chip, ICHREG(ALI_FIFOCR1), 0x83838383);
@@ -2149,7 +2195,7 @@ static void do_ali_reset(intel8x0_t *chip)
2149 iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000); 2195 iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000);
2150} 2196}
2151 2197
2152static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) 2198static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
2153{ 2199{
2154 unsigned long end_time; 2200 unsigned long end_time;
2155 unsigned int cnt, status, nstatus; 2201 unsigned int cnt, status, nstatus;
@@ -2174,7 +2220,8 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2174 goto __ok; 2220 goto __ok;
2175 schedule_timeout_uninterruptible(1); 2221 schedule_timeout_uninterruptible(1);
2176 } while (time_after_eq(end_time, jiffies)); 2222 } while (time_after_eq(end_time, jiffies));
2177 snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); 2223 snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n",
2224 igetdword(chip, ICHREG(GLOB_CNT)));
2178 return -EIO; 2225 return -EIO;
2179 2226
2180 __ok: 2227 __ok:
@@ -2185,14 +2232,16 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2185 */ 2232 */
2186 end_time = jiffies + HZ; 2233 end_time = jiffies + HZ;
2187 do { 2234 do {
2188 status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); 2235 status = igetdword(chip, ICHREG(GLOB_STA)) &
2236 (ICH_PCR | ICH_SCR | ICH_TCR);
2189 if (status) 2237 if (status)
2190 break; 2238 break;
2191 schedule_timeout_uninterruptible(1); 2239 schedule_timeout_uninterruptible(1);
2192 } while (time_after_eq(end_time, jiffies)); 2240 } while (time_after_eq(end_time, jiffies));
2193 if (! status) { 2241 if (! status) {
2194 /* no codec is found */ 2242 /* no codec is found */
2195 snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", igetdword(chip, ICHREG(GLOB_STA))); 2243 snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n",
2244 igetdword(chip, ICHREG(GLOB_STA)));
2196 return -EIO; 2245 return -EIO;
2197 } 2246 }
2198 2247
@@ -2220,7 +2269,8 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2220 /* wait until all the probed codecs are ready */ 2269 /* wait until all the probed codecs are ready */
2221 end_time = jiffies + HZ; 2270 end_time = jiffies + HZ;
2222 do { 2271 do {
2223 nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); 2272 nstatus = igetdword(chip, ICHREG(GLOB_STA)) &
2273 (ICH_PCR | ICH_SCR | ICH_TCR);
2224 if (status == nstatus) 2274 if (status == nstatus)
2225 break; 2275 break;
2226 schedule_timeout_uninterruptible(1); 2276 schedule_timeout_uninterruptible(1);
@@ -2241,7 +2291,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2241 return 0; 2291 return 0;
2242} 2292}
2243 2293
2244static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing) 2294static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing)
2245{ 2295{
2246 u32 reg; 2296 u32 reg;
2247 int i = 0; 2297 int i = 0;
@@ -2276,7 +2326,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing)
2276 return 0; 2326 return 0;
2277} 2327}
2278 2328
2279static int snd_intel8x0_chip_init(intel8x0_t *chip, int probing) 2329static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing)
2280{ 2330{
2281 unsigned int i; 2331 unsigned int i;
2282 int err; 2332 int err;
@@ -2298,11 +2348,12 @@ static int snd_intel8x0_chip_init(intel8x0_t *chip, int probing)
2298 iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS); 2348 iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS);
2299 /* initialize Buffer Descriptor Lists */ 2349 /* initialize Buffer Descriptor Lists */
2300 for (i = 0; i < chip->bdbars_count; i++) 2350 for (i = 0; i < chip->bdbars_count; i++)
2301 iputdword(chip, ICH_REG_OFF_BDBAR + chip->ichd[i].reg_offset, chip->ichd[i].bdbar_addr); 2351 iputdword(chip, ICH_REG_OFF_BDBAR + chip->ichd[i].reg_offset,
2352 chip->ichd[i].bdbar_addr);
2302 return 0; 2353 return 0;
2303} 2354}
2304 2355
2305static int snd_intel8x0_free(intel8x0_t *chip) 2356static int snd_intel8x0_free(struct intel8x0 *chip)
2306{ 2357{
2307 unsigned int i; 2358 unsigned int i;
2308 2359
@@ -2325,7 +2376,7 @@ static int snd_intel8x0_free(intel8x0_t *chip)
2325 synchronize_irq(chip->irq); 2376 synchronize_irq(chip->irq);
2326 __hw_end: 2377 __hw_end:
2327 if (chip->irq >= 0) 2378 if (chip->irq >= 0)
2328 free_irq(chip->irq, (void *)chip); 2379 free_irq(chip->irq, chip);
2329 if (chip->bdbars.area) { 2380 if (chip->bdbars.area) {
2330 if (chip->fix_nocache) 2381 if (chip->fix_nocache)
2331 fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 0); 2382 fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 0);
@@ -2345,9 +2396,9 @@ static int snd_intel8x0_free(intel8x0_t *chip)
2345/* 2396/*
2346 * power management 2397 * power management
2347 */ 2398 */
2348static int intel8x0_suspend(snd_card_t *card, pm_message_t state) 2399static int intel8x0_suspend(struct snd_card *card, pm_message_t state)
2349{ 2400{
2350 intel8x0_t *chip = card->pm_private_data; 2401 struct intel8x0 *chip = card->pm_private_data;
2351 int i; 2402 int i;
2352 2403
2353 for (i = 0; i < chip->pcm_devs; i++) 2404 for (i = 0; i < chip->pcm_devs; i++)
@@ -2355,9 +2406,9 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state)
2355 /* clear nocache */ 2406 /* clear nocache */
2356 if (chip->fix_nocache) { 2407 if (chip->fix_nocache) {
2357 for (i = 0; i < chip->bdbars_count; i++) { 2408 for (i = 0; i < chip->bdbars_count; i++) {
2358 ichdev_t *ichdev = &chip->ichd[i]; 2409 struct ichdev *ichdev = &chip->ichd[i];
2359 if (ichdev->substream && ichdev->page_attr_changed) { 2410 if (ichdev->substream && ichdev->page_attr_changed) {
2360 snd_pcm_runtime_t *runtime = ichdev->substream->runtime; 2411 struct snd_pcm_runtime *runtime = ichdev->substream->runtime;
2361 if (runtime->dma_area) 2412 if (runtime->dma_area)
2362 fill_nocache(runtime->dma_area, runtime->dma_bytes, 0); 2413 fill_nocache(runtime->dma_area, runtime->dma_bytes, 0);
2363 } 2414 }
@@ -2370,19 +2421,20 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state)
2370 chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); 2421 chip->sdm_saved = igetbyte(chip, ICHREG(SDM));
2371 2422
2372 if (chip->irq >= 0) 2423 if (chip->irq >= 0)
2373 free_irq(chip->irq, (void *)chip); 2424 free_irq(chip->irq, chip);
2374 pci_disable_device(chip->pci); 2425 pci_disable_device(chip->pci);
2375 return 0; 2426 return 0;
2376} 2427}
2377 2428
2378static int intel8x0_resume(snd_card_t *card) 2429static int intel8x0_resume(struct snd_card *card)
2379{ 2430{
2380 intel8x0_t *chip = card->pm_private_data; 2431 struct intel8x0 *chip = card->pm_private_data;
2381 int i; 2432 int i;
2382 2433
2383 pci_enable_device(chip->pci); 2434 pci_enable_device(chip->pci);
2384 pci_set_master(chip->pci); 2435 pci_set_master(chip->pci);
2385 request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip); 2436 request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ,
2437 card->shortname, chip);
2386 synchronize_irq(chip->irq); 2438 synchronize_irq(chip->irq);
2387 snd_intel8x0_chip_init(chip, 1); 2439 snd_intel8x0_chip_init(chip, 1);
2388 2440
@@ -2407,9 +2459,9 @@ static int intel8x0_resume(snd_card_t *card)
2407 /* refill nocache */ 2459 /* refill nocache */
2408 if (chip->fix_nocache) { 2460 if (chip->fix_nocache) {
2409 for (i = 0; i < chip->bdbars_count; i++) { 2461 for (i = 0; i < chip->bdbars_count; i++) {
2410 ichdev_t *ichdev = &chip->ichd[i]; 2462 struct ichdev *ichdev = &chip->ichd[i];
2411 if (ichdev->substream && ichdev->page_attr_changed) { 2463 if (ichdev->substream && ichdev->page_attr_changed) {
2412 snd_pcm_runtime_t *runtime = ichdev->substream->runtime; 2464 struct snd_pcm_runtime *runtime = ichdev->substream->runtime;
2413 if (runtime->dma_area) 2465 if (runtime->dma_area)
2414 fill_nocache(runtime->dma_area, runtime->dma_bytes, 1); 2466 fill_nocache(runtime->dma_area, runtime->dma_bytes, 1);
2415 } 2467 }
@@ -2418,7 +2470,7 @@ static int intel8x0_resume(snd_card_t *card)
2418 2470
2419 /* resume status */ 2471 /* resume status */
2420 for (i = 0; i < chip->bdbars_count; i++) { 2472 for (i = 0; i < chip->bdbars_count; i++) {
2421 ichdev_t *ichdev = &chip->ichd[i]; 2473 struct ichdev *ichdev = &chip->ichd[i];
2422 unsigned long port = ichdev->reg_offset; 2474 unsigned long port = ichdev->reg_offset;
2423 if (! ichdev->substream || ! ichdev->suspended) 2475 if (! ichdev->substream || ! ichdev->suspended)
2424 continue; 2476 continue;
@@ -2436,10 +2488,10 @@ static int intel8x0_resume(snd_card_t *card)
2436 2488
2437#define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ 2489#define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */
2438 2490
2439static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip) 2491static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
2440{ 2492{
2441 snd_pcm_substream_t *subs; 2493 struct snd_pcm_substream *subs;
2442 ichdev_t *ichdev; 2494 struct ichdev *ichdev;
2443 unsigned long port; 2495 unsigned long port;
2444 unsigned long pos, t; 2496 unsigned long pos, t;
2445 struct timeval start_time, stop_time; 2497 struct timeval start_time, stop_time;
@@ -2516,10 +2568,10 @@ static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip)
2516 printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock); 2568 printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock);
2517} 2569}
2518 2570
2519static void snd_intel8x0_proc_read(snd_info_entry_t * entry, 2571static void snd_intel8x0_proc_read(struct snd_info_entry * entry,
2520 snd_info_buffer_t * buffer) 2572 struct snd_info_buffer *buffer)
2521{ 2573{
2522 intel8x0_t *chip = entry->private_data; 2574 struct intel8x0 *chip = entry->private_data;
2523 unsigned int tmp; 2575 unsigned int tmp;
2524 2576
2525 snd_iprintf(buffer, "Intel8x0\n\n"); 2577 snd_iprintf(buffer, "Intel8x0\n\n");
@@ -2542,17 +2594,17 @@ static void snd_intel8x0_proc_read(snd_info_entry_t * entry,
2542 chip->ac97_sdin[2]); 2594 chip->ac97_sdin[2]);
2543} 2595}
2544 2596
2545static void __devinit snd_intel8x0_proc_init(intel8x0_t * chip) 2597static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip)
2546{ 2598{
2547 snd_info_entry_t *entry; 2599 struct snd_info_entry *entry;
2548 2600
2549 if (! snd_card_proc_new(chip->card, "intel8x0", &entry)) 2601 if (! snd_card_proc_new(chip->card, "intel8x0", &entry))
2550 snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read); 2602 snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read);
2551} 2603}
2552 2604
2553static int snd_intel8x0_dev_free(snd_device_t *device) 2605static int snd_intel8x0_dev_free(struct snd_device *device)
2554{ 2606{
2555 intel8x0_t *chip = device->device_data; 2607 struct intel8x0 *chip = device->device_data;
2556 return snd_intel8x0_free(chip); 2608 return snd_intel8x0_free(chip);
2557} 2609}
2558 2610
@@ -2561,17 +2613,17 @@ struct ich_reg_info {
2561 unsigned int offset; 2613 unsigned int offset;
2562}; 2614};
2563 2615
2564static int __devinit snd_intel8x0_create(snd_card_t * card, 2616static int __devinit snd_intel8x0_create(struct snd_card *card,
2565 struct pci_dev *pci, 2617 struct pci_dev *pci,
2566 unsigned long device_type, 2618 unsigned long device_type,
2567 intel8x0_t ** r_intel8x0) 2619 struct intel8x0 ** r_intel8x0)
2568{ 2620{
2569 intel8x0_t *chip; 2621 struct intel8x0 *chip;
2570 int err; 2622 int err;
2571 unsigned int i; 2623 unsigned int i;
2572 unsigned int int_sta_masks; 2624 unsigned int int_sta_masks;
2573 ichdev_t *ichdev; 2625 struct ichdev *ichdev;
2574 static snd_device_ops_t ops = { 2626 static struct snd_device_ops ops = {
2575 .dev_free = snd_intel8x0_dev_free, 2627 .dev_free = snd_intel8x0_dev_free,
2576 }; 2628 };
2577 2629
@@ -2734,7 +2786,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
2734 2786
2735 /* request irq after initializaing int_sta_mask, etc */ 2787 /* request irq after initializaing int_sta_mask, etc */
2736 if (request_irq(pci->irq, snd_intel8x0_interrupt, 2788 if (request_irq(pci->irq, snd_intel8x0_interrupt,
2737 SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) { 2789 SA_INTERRUPT|SA_SHIRQ, card->shortname, chip)) {
2738 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 2790 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
2739 snd_intel8x0_free(chip); 2791 snd_intel8x0_free(chip);
2740 return -EBUSY; 2792 return -EBUSY;
@@ -2793,8 +2845,8 @@ static struct shortname_table {
2793static int __devinit snd_intel8x0_probe(struct pci_dev *pci, 2845static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2794 const struct pci_device_id *pci_id) 2846 const struct pci_device_id *pci_id)
2795{ 2847{
2796 snd_card_t *card; 2848 struct snd_card *card;
2797 intel8x0_t *chip; 2849 struct intel8x0 *chip;
2798 int err; 2850 int err;
2799 struct shortname_table *name; 2851 struct shortname_table *name;
2800 2852