diff options
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 156 |
1 files changed, 76 insertions, 80 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 429ef3810b16..abdbd96d4c06 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -238,11 +238,7 @@ enum { | |||
238 | /* | 238 | /* |
239 | */ | 239 | */ |
240 | 240 | ||
241 | typedef struct snd_azx azx_t; | 241 | struct azx_dev { |
242 | typedef struct snd_azx_rb azx_rb_t; | ||
243 | typedef struct snd_azx_dev azx_dev_t; | ||
244 | |||
245 | struct snd_azx_dev { | ||
246 | u32 *bdl; /* virtual address of the BDL */ | 242 | u32 *bdl; /* virtual address of the BDL */ |
247 | dma_addr_t bdl_addr; /* physical address of the BDL */ | 243 | dma_addr_t bdl_addr; /* physical address of the BDL */ |
248 | volatile u32 *posbuf; /* position buffer pointer */ | 244 | volatile u32 *posbuf; /* position buffer pointer */ |
@@ -258,7 +254,7 @@ struct snd_azx_dev { | |||
258 | u32 sd_int_sta_mask; /* stream int status mask */ | 254 | u32 sd_int_sta_mask; /* stream int status mask */ |
259 | 255 | ||
260 | /* pcm support */ | 256 | /* pcm support */ |
261 | snd_pcm_substream_t *substream; /* assigned substream, set in PCM open */ | 257 | struct snd_pcm_substream *substream; /* assigned substream, set in PCM open */ |
262 | unsigned int format_val; /* format value to be set in the controller and the codec */ | 258 | unsigned int format_val; /* format value to be set in the controller and the codec */ |
263 | unsigned char stream_tag; /* assigned stream */ | 259 | unsigned char stream_tag; /* assigned stream */ |
264 | unsigned char index; /* stream index */ | 260 | unsigned char index; /* stream index */ |
@@ -269,7 +265,7 @@ struct snd_azx_dev { | |||
269 | }; | 265 | }; |
270 | 266 | ||
271 | /* CORB/RIRB */ | 267 | /* CORB/RIRB */ |
272 | struct snd_azx_rb { | 268 | struct azx_rb { |
273 | u32 *buf; /* CORB/RIRB buffer | 269 | u32 *buf; /* CORB/RIRB buffer |
274 | * Each CORB entry is 4byte, RIRB is 8byte | 270 | * Each CORB entry is 4byte, RIRB is 8byte |
275 | */ | 271 | */ |
@@ -280,8 +276,8 @@ struct snd_azx_rb { | |||
280 | u32 res; /* last read value */ | 276 | u32 res; /* last read value */ |
281 | }; | 277 | }; |
282 | 278 | ||
283 | struct snd_azx { | 279 | struct azx { |
284 | snd_card_t *card; | 280 | struct snd_card *card; |
285 | struct pci_dev *pci; | 281 | struct pci_dev *pci; |
286 | 282 | ||
287 | /* chip type specific */ | 283 | /* chip type specific */ |
@@ -302,19 +298,19 @@ struct snd_azx { | |||
302 | struct semaphore open_mutex; | 298 | struct semaphore open_mutex; |
303 | 299 | ||
304 | /* streams (x num_streams) */ | 300 | /* streams (x num_streams) */ |
305 | azx_dev_t *azx_dev; | 301 | struct azx_dev *azx_dev; |
306 | 302 | ||
307 | /* PCM */ | 303 | /* PCM */ |
308 | unsigned int pcm_devs; | 304 | unsigned int pcm_devs; |
309 | snd_pcm_t *pcm[AZX_MAX_PCMS]; | 305 | struct snd_pcm *pcm[AZX_MAX_PCMS]; |
310 | 306 | ||
311 | /* HD codec */ | 307 | /* HD codec */ |
312 | unsigned short codec_mask; | 308 | unsigned short codec_mask; |
313 | struct hda_bus *bus; | 309 | struct hda_bus *bus; |
314 | 310 | ||
315 | /* CORB/RIRB */ | 311 | /* CORB/RIRB */ |
316 | azx_rb_t corb; | 312 | struct azx_rb corb; |
317 | azx_rb_t rirb; | 313 | struct azx_rb rirb; |
318 | 314 | ||
319 | /* BDL, CORB/RIRB and position buffers */ | 315 | /* BDL, CORB/RIRB and position buffers */ |
320 | struct snd_dma_buffer bdl; | 316 | struct snd_dma_buffer bdl; |
@@ -375,7 +371,7 @@ static char *driver_short_names[] __devinitdata = { | |||
375 | readb((dev)->sd_addr + ICH6_REG_##reg) | 371 | readb((dev)->sd_addr + ICH6_REG_##reg) |
376 | 372 | ||
377 | /* for pcm support */ | 373 | /* for pcm support */ |
378 | #define get_azx_dev(substream) (azx_dev_t*)(substream->runtime->private_data) | 374 | #define get_azx_dev(substream) (substream->runtime->private_data) |
379 | 375 | ||
380 | /* Get the upper 32bit of the given dma_addr_t | 376 | /* Get the upper 32bit of the given dma_addr_t |
381 | * Compiler should optimize and eliminate the code if dma_addr_t is 32bit | 377 | * Compiler should optimize and eliminate the code if dma_addr_t is 32bit |
@@ -391,7 +387,7 @@ static char *driver_short_names[] __devinitdata = { | |||
391 | /* | 387 | /* |
392 | * CORB / RIRB interface | 388 | * CORB / RIRB interface |
393 | */ | 389 | */ |
394 | static int azx_alloc_cmd_io(azx_t *chip) | 390 | static int azx_alloc_cmd_io(struct azx *chip) |
395 | { | 391 | { |
396 | int err; | 392 | int err; |
397 | 393 | ||
@@ -405,7 +401,7 @@ static int azx_alloc_cmd_io(azx_t *chip) | |||
405 | return 0; | 401 | return 0; |
406 | } | 402 | } |
407 | 403 | ||
408 | static void azx_init_cmd_io(azx_t *chip) | 404 | static void azx_init_cmd_io(struct azx *chip) |
409 | { | 405 | { |
410 | /* CORB set up */ | 406 | /* CORB set up */ |
411 | chip->corb.addr = chip->rb.addr; | 407 | chip->corb.addr = chip->rb.addr; |
@@ -443,7 +439,7 @@ static void azx_init_cmd_io(azx_t *chip) | |||
443 | chip->rirb.rp = chip->rirb.cmds = 0; | 439 | chip->rirb.rp = chip->rirb.cmds = 0; |
444 | } | 440 | } |
445 | 441 | ||
446 | static void azx_free_cmd_io(azx_t *chip) | 442 | static void azx_free_cmd_io(struct azx *chip) |
447 | { | 443 | { |
448 | /* disable ringbuffer DMAs */ | 444 | /* disable ringbuffer DMAs */ |
449 | azx_writeb(chip, RIRBCTL, 0); | 445 | azx_writeb(chip, RIRBCTL, 0); |
@@ -454,7 +450,7 @@ static void azx_free_cmd_io(azx_t *chip) | |||
454 | static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, | 450 | static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, |
455 | unsigned int verb, unsigned int para) | 451 | unsigned int verb, unsigned int para) |
456 | { | 452 | { |
457 | azx_t *chip = codec->bus->private_data; | 453 | struct azx *chip = codec->bus->private_data; |
458 | unsigned int wp; | 454 | unsigned int wp; |
459 | u32 val; | 455 | u32 val; |
460 | 456 | ||
@@ -481,7 +477,7 @@ static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, | |||
481 | #define ICH6_RIRB_EX_UNSOL_EV (1<<4) | 477 | #define ICH6_RIRB_EX_UNSOL_EV (1<<4) |
482 | 478 | ||
483 | /* retrieve RIRB entry - called from interrupt handler */ | 479 | /* retrieve RIRB entry - called from interrupt handler */ |
484 | static void azx_update_rirb(azx_t *chip) | 480 | static void azx_update_rirb(struct azx *chip) |
485 | { | 481 | { |
486 | unsigned int rp, wp; | 482 | unsigned int rp, wp; |
487 | u32 res, res_ex; | 483 | u32 res, res_ex; |
@@ -510,7 +506,7 @@ static void azx_update_rirb(azx_t *chip) | |||
510 | /* receive a response */ | 506 | /* receive a response */ |
511 | static unsigned int azx_get_response(struct hda_codec *codec) | 507 | static unsigned int azx_get_response(struct hda_codec *codec) |
512 | { | 508 | { |
513 | azx_t *chip = codec->bus->private_data; | 509 | struct azx *chip = codec->bus->private_data; |
514 | int timeout = 50; | 510 | int timeout = 50; |
515 | 511 | ||
516 | while (chip->rirb.cmds) { | 512 | while (chip->rirb.cmds) { |
@@ -546,7 +542,7 @@ static unsigned int azx_get_response(struct hda_codec *codec) | |||
546 | static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, | 542 | static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, |
547 | unsigned int verb, unsigned int para) | 543 | unsigned int verb, unsigned int para) |
548 | { | 544 | { |
549 | azx_t *chip = codec->bus->private_data; | 545 | struct azx *chip = codec->bus->private_data; |
550 | u32 val; | 546 | u32 val; |
551 | int timeout = 50; | 547 | int timeout = 50; |
552 | 548 | ||
@@ -574,7 +570,7 @@ static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, | |||
574 | /* receive a response */ | 570 | /* receive a response */ |
575 | static unsigned int azx_get_response(struct hda_codec *codec) | 571 | static unsigned int azx_get_response(struct hda_codec *codec) |
576 | { | 572 | { |
577 | azx_t *chip = codec->bus->private_data; | 573 | struct azx *chip = codec->bus->private_data; |
578 | int timeout = 50; | 574 | int timeout = 50; |
579 | 575 | ||
580 | while (timeout--) { | 576 | while (timeout--) { |
@@ -592,7 +588,7 @@ static unsigned int azx_get_response(struct hda_codec *codec) | |||
592 | #endif /* USE_CORB_RIRB */ | 588 | #endif /* USE_CORB_RIRB */ |
593 | 589 | ||
594 | /* reset codec link */ | 590 | /* reset codec link */ |
595 | static int azx_reset(azx_t *chip) | 591 | static int azx_reset(struct azx *chip) |
596 | { | 592 | { |
597 | int count; | 593 | int count; |
598 | 594 | ||
@@ -642,7 +638,7 @@ static int azx_reset(azx_t *chip) | |||
642 | */ | 638 | */ |
643 | 639 | ||
644 | /* enable interrupts */ | 640 | /* enable interrupts */ |
645 | static void azx_int_enable(azx_t *chip) | 641 | static void azx_int_enable(struct azx *chip) |
646 | { | 642 | { |
647 | /* enable controller CIE and GIE */ | 643 | /* enable controller CIE and GIE */ |
648 | azx_writel(chip, INTCTL, azx_readl(chip, INTCTL) | | 644 | azx_writel(chip, INTCTL, azx_readl(chip, INTCTL) | |
@@ -650,13 +646,13 @@ static void azx_int_enable(azx_t *chip) | |||
650 | } | 646 | } |
651 | 647 | ||
652 | /* disable interrupts */ | 648 | /* disable interrupts */ |
653 | static void azx_int_disable(azx_t *chip) | 649 | static void azx_int_disable(struct azx *chip) |
654 | { | 650 | { |
655 | int i; | 651 | int i; |
656 | 652 | ||
657 | /* disable interrupts in stream descriptor */ | 653 | /* disable interrupts in stream descriptor */ |
658 | for (i = 0; i < chip->num_streams; i++) { | 654 | for (i = 0; i < chip->num_streams; i++) { |
659 | azx_dev_t *azx_dev = &chip->azx_dev[i]; | 655 | struct azx_dev *azx_dev = &chip->azx_dev[i]; |
660 | azx_sd_writeb(azx_dev, SD_CTL, | 656 | azx_sd_writeb(azx_dev, SD_CTL, |
661 | azx_sd_readb(azx_dev, SD_CTL) & ~SD_INT_MASK); | 657 | azx_sd_readb(azx_dev, SD_CTL) & ~SD_INT_MASK); |
662 | } | 658 | } |
@@ -670,13 +666,13 @@ static void azx_int_disable(azx_t *chip) | |||
670 | } | 666 | } |
671 | 667 | ||
672 | /* clear interrupts */ | 668 | /* clear interrupts */ |
673 | static void azx_int_clear(azx_t *chip) | 669 | static void azx_int_clear(struct azx *chip) |
674 | { | 670 | { |
675 | int i; | 671 | int i; |
676 | 672 | ||
677 | /* clear stream status */ | 673 | /* clear stream status */ |
678 | for (i = 0; i < chip->num_streams; i++) { | 674 | for (i = 0; i < chip->num_streams; i++) { |
679 | azx_dev_t *azx_dev = &chip->azx_dev[i]; | 675 | struct azx_dev *azx_dev = &chip->azx_dev[i]; |
680 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); | 676 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); |
681 | } | 677 | } |
682 | 678 | ||
@@ -691,7 +687,7 @@ static void azx_int_clear(azx_t *chip) | |||
691 | } | 687 | } |
692 | 688 | ||
693 | /* start a stream */ | 689 | /* start a stream */ |
694 | static void azx_stream_start(azx_t *chip, azx_dev_t *azx_dev) | 690 | static void azx_stream_start(struct azx *chip, struct azx_dev *azx_dev) |
695 | { | 691 | { |
696 | /* enable SIE */ | 692 | /* enable SIE */ |
697 | azx_writeb(chip, INTCTL, | 693 | azx_writeb(chip, INTCTL, |
@@ -702,7 +698,7 @@ static void azx_stream_start(azx_t *chip, azx_dev_t *azx_dev) | |||
702 | } | 698 | } |
703 | 699 | ||
704 | /* stop a stream */ | 700 | /* stop a stream */ |
705 | static void azx_stream_stop(azx_t *chip, azx_dev_t *azx_dev) | 701 | static void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev) |
706 | { | 702 | { |
707 | /* stop DMA */ | 703 | /* stop DMA */ |
708 | azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) & | 704 | azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) & |
@@ -717,7 +713,7 @@ static void azx_stream_stop(azx_t *chip, azx_dev_t *azx_dev) | |||
717 | /* | 713 | /* |
718 | * initialize the chip | 714 | * initialize the chip |
719 | */ | 715 | */ |
720 | static void azx_init_chip(azx_t *chip) | 716 | static void azx_init_chip(struct azx *chip) |
721 | { | 717 | { |
722 | unsigned char reg; | 718 | unsigned char reg; |
723 | 719 | ||
@@ -765,8 +761,8 @@ static void azx_init_chip(azx_t *chip) | |||
765 | */ | 761 | */ |
766 | static irqreturn_t azx_interrupt(int irq, void* dev_id, struct pt_regs *regs) | 762 | static irqreturn_t azx_interrupt(int irq, void* dev_id, struct pt_regs *regs) |
767 | { | 763 | { |
768 | azx_t *chip = dev_id; | 764 | struct azx *chip = dev_id; |
769 | azx_dev_t *azx_dev; | 765 | struct azx_dev *azx_dev; |
770 | u32 status; | 766 | u32 status; |
771 | int i; | 767 | int i; |
772 | 768 | ||
@@ -814,7 +810,7 @@ static irqreturn_t azx_interrupt(int irq, void* dev_id, struct pt_regs *regs) | |||
814 | /* | 810 | /* |
815 | * set up BDL entries | 811 | * set up BDL entries |
816 | */ | 812 | */ |
817 | static void azx_setup_periods(azx_dev_t *azx_dev) | 813 | static void azx_setup_periods(struct azx_dev *azx_dev) |
818 | { | 814 | { |
819 | u32 *bdl = azx_dev->bdl; | 815 | u32 *bdl = azx_dev->bdl; |
820 | dma_addr_t dma_addr = azx_dev->substream->runtime->dma_addr; | 816 | dma_addr_t dma_addr = azx_dev->substream->runtime->dma_addr; |
@@ -843,7 +839,7 @@ static void azx_setup_periods(azx_dev_t *azx_dev) | |||
843 | /* | 839 | /* |
844 | * set up the SD for streaming | 840 | * set up the SD for streaming |
845 | */ | 841 | */ |
846 | static int azx_setup_controller(azx_t *chip, azx_dev_t *azx_dev) | 842 | static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev) |
847 | { | 843 | { |
848 | unsigned char val; | 844 | unsigned char val; |
849 | int timeout; | 845 | int timeout; |
@@ -903,7 +899,7 @@ static int azx_setup_controller(azx_t *chip, azx_dev_t *azx_dev) | |||
903 | * Codec initialization | 899 | * Codec initialization |
904 | */ | 900 | */ |
905 | 901 | ||
906 | static int __devinit azx_codec_create(azx_t *chip, const char *model) | 902 | static int __devinit azx_codec_create(struct azx *chip, const char *model) |
907 | { | 903 | { |
908 | struct hda_bus_template bus_temp; | 904 | struct hda_bus_template bus_temp; |
909 | int c, codecs, err; | 905 | int c, codecs, err; |
@@ -941,7 +937,7 @@ static int __devinit azx_codec_create(azx_t *chip, const char *model) | |||
941 | */ | 937 | */ |
942 | 938 | ||
943 | /* assign a stream for the PCM */ | 939 | /* assign a stream for the PCM */ |
944 | static inline azx_dev_t *azx_assign_device(azx_t *chip, int stream) | 940 | static inline struct azx_dev *azx_assign_device(struct azx *chip, int stream) |
945 | { | 941 | { |
946 | int dev, i, nums; | 942 | int dev, i, nums; |
947 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { | 943 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
@@ -960,12 +956,12 @@ static inline azx_dev_t *azx_assign_device(azx_t *chip, int stream) | |||
960 | } | 956 | } |
961 | 957 | ||
962 | /* release the assigned stream */ | 958 | /* release the assigned stream */ |
963 | static inline void azx_release_device(azx_dev_t *azx_dev) | 959 | static inline void azx_release_device(struct azx_dev *azx_dev) |
964 | { | 960 | { |
965 | azx_dev->opened = 0; | 961 | azx_dev->opened = 0; |
966 | } | 962 | } |
967 | 963 | ||
968 | static snd_pcm_hardware_t azx_pcm_hw = { | 964 | static struct snd_pcm_hardware azx_pcm_hw = { |
969 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 965 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
970 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 966 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
971 | SNDRV_PCM_INFO_MMAP_VALID | | 967 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -986,18 +982,18 @@ static snd_pcm_hardware_t azx_pcm_hw = { | |||
986 | }; | 982 | }; |
987 | 983 | ||
988 | struct azx_pcm { | 984 | struct azx_pcm { |
989 | azx_t *chip; | 985 | struct azx *chip; |
990 | struct hda_codec *codec; | 986 | struct hda_codec *codec; |
991 | struct hda_pcm_stream *hinfo[2]; | 987 | struct hda_pcm_stream *hinfo[2]; |
992 | }; | 988 | }; |
993 | 989 | ||
994 | static int azx_pcm_open(snd_pcm_substream_t *substream) | 990 | static int azx_pcm_open(struct snd_pcm_substream *substream) |
995 | { | 991 | { |
996 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); | 992 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); |
997 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; | 993 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; |
998 | azx_t *chip = apcm->chip; | 994 | struct azx *chip = apcm->chip; |
999 | azx_dev_t *azx_dev; | 995 | struct azx_dev *azx_dev; |
1000 | snd_pcm_runtime_t *runtime = substream->runtime; | 996 | struct snd_pcm_runtime *runtime = substream->runtime; |
1001 | unsigned long flags; | 997 | unsigned long flags; |
1002 | int err; | 998 | int err; |
1003 | 999 | ||
@@ -1029,12 +1025,12 @@ static int azx_pcm_open(snd_pcm_substream_t *substream) | |||
1029 | return 0; | 1025 | return 0; |
1030 | } | 1026 | } |
1031 | 1027 | ||
1032 | static int azx_pcm_close(snd_pcm_substream_t *substream) | 1028 | static int azx_pcm_close(struct snd_pcm_substream *substream) |
1033 | { | 1029 | { |
1034 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); | 1030 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); |
1035 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; | 1031 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; |
1036 | azx_t *chip = apcm->chip; | 1032 | struct azx *chip = apcm->chip; |
1037 | azx_dev_t *azx_dev = get_azx_dev(substream); | 1033 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1038 | unsigned long flags; | 1034 | unsigned long flags; |
1039 | 1035 | ||
1040 | down(&chip->open_mutex); | 1036 | down(&chip->open_mutex); |
@@ -1048,15 +1044,15 @@ static int azx_pcm_close(snd_pcm_substream_t *substream) | |||
1048 | return 0; | 1044 | return 0; |
1049 | } | 1045 | } |
1050 | 1046 | ||
1051 | static int azx_pcm_hw_params(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *hw_params) | 1047 | static int azx_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) |
1052 | { | 1048 | { |
1053 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | 1049 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
1054 | } | 1050 | } |
1055 | 1051 | ||
1056 | static int azx_pcm_hw_free(snd_pcm_substream_t *substream) | 1052 | static int azx_pcm_hw_free(struct snd_pcm_substream *substream) |
1057 | { | 1053 | { |
1058 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); | 1054 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); |
1059 | azx_dev_t *azx_dev = get_azx_dev(substream); | 1055 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1060 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; | 1056 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; |
1061 | 1057 | ||
1062 | /* reset BDL address */ | 1058 | /* reset BDL address */ |
@@ -1069,13 +1065,13 @@ static int azx_pcm_hw_free(snd_pcm_substream_t *substream) | |||
1069 | return snd_pcm_lib_free_pages(substream); | 1065 | return snd_pcm_lib_free_pages(substream); |
1070 | } | 1066 | } |
1071 | 1067 | ||
1072 | static int azx_pcm_prepare(snd_pcm_substream_t *substream) | 1068 | static int azx_pcm_prepare(struct snd_pcm_substream *substream) |
1073 | { | 1069 | { |
1074 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); | 1070 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); |
1075 | azx_t *chip = apcm->chip; | 1071 | struct azx *chip = apcm->chip; |
1076 | azx_dev_t *azx_dev = get_azx_dev(substream); | 1072 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1077 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; | 1073 | struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; |
1078 | snd_pcm_runtime_t *runtime = substream->runtime; | 1074 | struct snd_pcm_runtime *runtime = substream->runtime; |
1079 | 1075 | ||
1080 | azx_dev->bufsize = snd_pcm_lib_buffer_bytes(substream); | 1076 | azx_dev->bufsize = snd_pcm_lib_buffer_bytes(substream); |
1081 | azx_dev->fragsize = snd_pcm_lib_period_bytes(substream); | 1077 | azx_dev->fragsize = snd_pcm_lib_period_bytes(substream); |
@@ -1104,11 +1100,11 @@ static int azx_pcm_prepare(snd_pcm_substream_t *substream) | |||
1104 | azx_dev->format_val, substream); | 1100 | azx_dev->format_val, substream); |
1105 | } | 1101 | } |
1106 | 1102 | ||
1107 | static int azx_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | 1103 | static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) |
1108 | { | 1104 | { |
1109 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); | 1105 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); |
1110 | azx_dev_t *azx_dev = get_azx_dev(substream); | 1106 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1111 | azx_t *chip = apcm->chip; | 1107 | struct azx *chip = apcm->chip; |
1112 | int err = 0; | 1108 | int err = 0; |
1113 | 1109 | ||
1114 | spin_lock(&chip->reg_lock); | 1110 | spin_lock(&chip->reg_lock); |
@@ -1139,11 +1135,11 @@ static int azx_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | |||
1139 | return err; | 1135 | return err; |
1140 | } | 1136 | } |
1141 | 1137 | ||
1142 | static snd_pcm_uframes_t azx_pcm_pointer(snd_pcm_substream_t *substream) | 1138 | static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream) |
1143 | { | 1139 | { |
1144 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); | 1140 | struct azx_pcm *apcm = snd_pcm_substream_chip(substream); |
1145 | azx_t *chip = apcm->chip; | 1141 | struct azx *chip = apcm->chip; |
1146 | azx_dev_t *azx_dev = get_azx_dev(substream); | 1142 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1147 | unsigned int pos; | 1143 | unsigned int pos; |
1148 | 1144 | ||
1149 | if (chip->position_fix == POS_FIX_POSBUF) { | 1145 | if (chip->position_fix == POS_FIX_POSBUF) { |
@@ -1185,7 +1181,7 @@ static snd_pcm_uframes_t azx_pcm_pointer(snd_pcm_substream_t *substream) | |||
1185 | return bytes_to_frames(substream->runtime, pos); | 1181 | return bytes_to_frames(substream->runtime, pos); |
1186 | } | 1182 | } |
1187 | 1183 | ||
1188 | static snd_pcm_ops_t azx_pcm_ops = { | 1184 | static struct snd_pcm_ops azx_pcm_ops = { |
1189 | .open = azx_pcm_open, | 1185 | .open = azx_pcm_open, |
1190 | .close = azx_pcm_close, | 1186 | .close = azx_pcm_close, |
1191 | .ioctl = snd_pcm_lib_ioctl, | 1187 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1196,16 +1192,16 @@ static snd_pcm_ops_t azx_pcm_ops = { | |||
1196 | .pointer = azx_pcm_pointer, | 1192 | .pointer = azx_pcm_pointer, |
1197 | }; | 1193 | }; |
1198 | 1194 | ||
1199 | static void azx_pcm_free(snd_pcm_t *pcm) | 1195 | static void azx_pcm_free(struct snd_pcm *pcm) |
1200 | { | 1196 | { |
1201 | kfree(pcm->private_data); | 1197 | kfree(pcm->private_data); |
1202 | } | 1198 | } |
1203 | 1199 | ||
1204 | static int __devinit create_codec_pcm(azx_t *chip, struct hda_codec *codec, | 1200 | static int __devinit create_codec_pcm(struct azx *chip, struct hda_codec *codec, |
1205 | struct hda_pcm *cpcm, int pcm_dev) | 1201 | struct hda_pcm *cpcm, int pcm_dev) |
1206 | { | 1202 | { |
1207 | int err; | 1203 | int err; |
1208 | snd_pcm_t *pcm; | 1204 | struct snd_pcm *pcm; |
1209 | struct azx_pcm *apcm; | 1205 | struct azx_pcm *apcm; |
1210 | 1206 | ||
1211 | snd_assert(cpcm->stream[0].substreams || cpcm->stream[1].substreams, return -EINVAL); | 1207 | snd_assert(cpcm->stream[0].substreams || cpcm->stream[1].substreams, return -EINVAL); |
@@ -1239,7 +1235,7 @@ static int __devinit create_codec_pcm(azx_t *chip, struct hda_codec *codec, | |||
1239 | return 0; | 1235 | return 0; |
1240 | } | 1236 | } |
1241 | 1237 | ||
1242 | static int __devinit azx_pcm_create(azx_t *chip) | 1238 | static int __devinit azx_pcm_create(struct azx *chip) |
1243 | { | 1239 | { |
1244 | struct list_head *p; | 1240 | struct list_head *p; |
1245 | struct hda_codec *codec; | 1241 | struct hda_codec *codec; |
@@ -1291,7 +1287,7 @@ static int __devinit azx_pcm_create(azx_t *chip) | |||
1291 | /* | 1287 | /* |
1292 | * mixer creation - all stuff is implemented in hda module | 1288 | * mixer creation - all stuff is implemented in hda module |
1293 | */ | 1289 | */ |
1294 | static int __devinit azx_mixer_create(azx_t *chip) | 1290 | static int __devinit azx_mixer_create(struct azx *chip) |
1295 | { | 1291 | { |
1296 | return snd_hda_build_controls(chip->bus); | 1292 | return snd_hda_build_controls(chip->bus); |
1297 | } | 1293 | } |
@@ -1300,7 +1296,7 @@ static int __devinit azx_mixer_create(azx_t *chip) | |||
1300 | /* | 1296 | /* |
1301 | * initialize SD streams | 1297 | * initialize SD streams |
1302 | */ | 1298 | */ |
1303 | static int __devinit azx_init_stream(azx_t *chip) | 1299 | static int __devinit azx_init_stream(struct azx *chip) |
1304 | { | 1300 | { |
1305 | int i; | 1301 | int i; |
1306 | 1302 | ||
@@ -1309,7 +1305,7 @@ static int __devinit azx_init_stream(azx_t *chip) | |||
1309 | */ | 1305 | */ |
1310 | for (i = 0; i < chip->num_streams; i++) { | 1306 | for (i = 0; i < chip->num_streams; i++) { |
1311 | unsigned int off = sizeof(u32) * (i * AZX_MAX_FRAG * 4); | 1307 | unsigned int off = sizeof(u32) * (i * AZX_MAX_FRAG * 4); |
1312 | azx_dev_t *azx_dev = &chip->azx_dev[i]; | 1308 | struct azx_dev *azx_dev = &chip->azx_dev[i]; |
1313 | azx_dev->bdl = (u32 *)(chip->bdl.area + off); | 1309 | azx_dev->bdl = (u32 *)(chip->bdl.area + off); |
1314 | azx_dev->bdl_addr = chip->bdl.addr + off; | 1310 | azx_dev->bdl_addr = chip->bdl.addr + off; |
1315 | azx_dev->posbuf = (volatile u32 *)(chip->posbuf.area + i * 8); | 1311 | azx_dev->posbuf = (volatile u32 *)(chip->posbuf.area + i * 8); |
@@ -1330,9 +1326,9 @@ static int __devinit azx_init_stream(azx_t *chip) | |||
1330 | /* | 1326 | /* |
1331 | * power management | 1327 | * power management |
1332 | */ | 1328 | */ |
1333 | static int azx_suspend(snd_card_t *card, pm_message_t state) | 1329 | static int azx_suspend(struct snd_card *card, pm_message_t state) |
1334 | { | 1330 | { |
1335 | azx_t *chip = card->pm_private_data; | 1331 | struct azx *chip = card->pm_private_data; |
1336 | int i; | 1332 | int i; |
1337 | 1333 | ||
1338 | for (i = 0; i < chip->pcm_devs; i++) | 1334 | for (i = 0; i < chip->pcm_devs; i++) |
@@ -1344,9 +1340,9 @@ static int azx_suspend(snd_card_t *card, pm_message_t state) | |||
1344 | return 0; | 1340 | return 0; |
1345 | } | 1341 | } |
1346 | 1342 | ||
1347 | static int azx_resume(snd_card_t *card) | 1343 | static int azx_resume(struct snd_card *card) |
1348 | { | 1344 | { |
1349 | azx_t *chip = card->pm_private_data; | 1345 | struct azx *chip = card->pm_private_data; |
1350 | 1346 | ||
1351 | pci_enable_device(chip->pci); | 1347 | pci_enable_device(chip->pci); |
1352 | pci_set_master(chip->pci); | 1348 | pci_set_master(chip->pci); |
@@ -1360,7 +1356,7 @@ static int azx_resume(snd_card_t *card) | |||
1360 | /* | 1356 | /* |
1361 | * destructor | 1357 | * destructor |
1362 | */ | 1358 | */ |
1363 | static int azx_free(azx_t *chip) | 1359 | static int azx_free(struct azx *chip) |
1364 | { | 1360 | { |
1365 | if (chip->initialized) { | 1361 | if (chip->initialized) { |
1366 | int i; | 1362 | int i; |
@@ -1402,7 +1398,7 @@ static int azx_free(azx_t *chip) | |||
1402 | return 0; | 1398 | return 0; |
1403 | } | 1399 | } |
1404 | 1400 | ||
1405 | static int azx_dev_free(snd_device_t *device) | 1401 | static int azx_dev_free(struct snd_device *device) |
1406 | { | 1402 | { |
1407 | return azx_free(device->device_data); | 1403 | return azx_free(device->device_data); |
1408 | } | 1404 | } |
@@ -1410,13 +1406,13 @@ static int azx_dev_free(snd_device_t *device) | |||
1410 | /* | 1406 | /* |
1411 | * constructor | 1407 | * constructor |
1412 | */ | 1408 | */ |
1413 | static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, | 1409 | static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, |
1414 | int posfix, int driver_type, | 1410 | int posfix, int driver_type, |
1415 | azx_t **rchip) | 1411 | struct azx **rchip) |
1416 | { | 1412 | { |
1417 | azx_t *chip; | 1413 | struct azx *chip; |
1418 | int err = 0; | 1414 | int err = 0; |
1419 | static snd_device_ops_t ops = { | 1415 | static struct snd_device_ops ops = { |
1420 | .dev_free = azx_dev_free, | 1416 | .dev_free = azx_dev_free, |
1421 | }; | 1417 | }; |
1422 | 1418 | ||
@@ -1548,8 +1544,8 @@ static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, | |||
1548 | 1544 | ||
1549 | static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) | 1545 | static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) |
1550 | { | 1546 | { |
1551 | snd_card_t *card; | 1547 | struct snd_card *card; |
1552 | azx_t *chip; | 1548 | struct azx *chip; |
1553 | int err = 0; | 1549 | int err = 0; |
1554 | 1550 | ||
1555 | card = snd_card_new(index, id, THIS_MODULE, 0); | 1551 | card = snd_card_new(index, id, THIS_MODULE, 0); |