Changeset 34 for GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c
- Timestamp:
- Dec 11, 2005, 5:57:39 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c
r33 r34 312 312 static int snd_emu10k1_gpr_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 313 313 { 314 s nd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t*)kcontrol->private_value;314 struct snd_emu10k1_fx8010_ctl *ctl = (struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value; 315 315 316 316 if (ctl->min == 0 && ctl->max == 1) … … 326 326 static int snd_emu10k1_gpr_ctl_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 327 327 { 328 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);329 s nd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t*)kcontrol->private_value;328 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 329 struct snd_emu10k1_fx8010_ctl *ctl = (struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value; 330 330 unsigned long flags; 331 331 unsigned int i; … … 340 340 static int snd_emu10k1_gpr_ctl_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 341 341 { 342 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);343 s nd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t*)kcontrol->private_value;342 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 343 struct snd_emu10k1_fx8010_ctl *ctl = (struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value; 344 344 unsigned long flags; 345 345 unsigned int nval, val; … … 388 388 */ 389 389 390 static void snd_emu10k1_fx8010_interrupt( emu10k1_t*emu)391 { 392 s nd_emu10k1_fx8010_irq_t*irq, *nirq;390 static void snd_emu10k1_fx8010_interrupt(struct snd_emu10k1 *emu) 391 { 392 struct snd_emu10k1_fx8010_irq *irq, *nirq; 393 393 394 394 irq = emu->fx8010.irq_handlers; … … 404 404 } 405 405 406 int snd_emu10k1_fx8010_register_irq_handler( emu10k1_t*emu,406 int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu, 407 407 snd_fx8010_irq_handler_t *handler, 408 408 unsigned char gpr_running, 409 409 void *private_data, 410 s nd_emu10k1_fx8010_irq_t**r_irq)411 { 412 s nd_emu10k1_fx8010_irq_t*irq;410 struct snd_emu10k1_fx8010_irq **r_irq) 411 { 412 struct snd_emu10k1_fx8010_irq *irq; 413 413 unsigned long flags; 414 414 … … 437 437 } 438 438 439 int snd_emu10k1_fx8010_unregister_irq_handler( emu10k1_t*emu,440 s nd_emu10k1_fx8010_irq_t*irq)441 { 442 s nd_emu10k1_fx8010_irq_t*tmp;439 int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, 440 struct snd_emu10k1_fx8010_irq *irq) 441 { 442 struct snd_emu10k1_fx8010_irq *tmp; 443 443 unsigned long flags; 444 444 … … 496 496 snd_emu10k1_audigy_write_op(icode, ptr, op, r, a, x, y) 497 497 498 void snd_emu10k1_efx_write( emu10k1_t*emu, unsigned int pc, unsigned int data)498 void snd_emu10k1_efx_write(struct snd_emu10k1 *emu, unsigned int pc, unsigned int data) 499 499 { 500 500 pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE; … … 502 502 } 503 503 504 unsigned int snd_emu10k1_efx_read( emu10k1_t*emu, unsigned int pc)504 unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc) 505 505 { 506 506 pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE; … … 508 508 } 509 509 510 static int snd_emu10k1_gpr_poke( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)510 static int snd_emu10k1_gpr_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 511 511 { 512 512 int gpr; … … 523 523 } 524 524 525 static int snd_emu10k1_gpr_peek( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)525 static int snd_emu10k1_gpr_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 526 526 { 527 527 int gpr; … … 537 537 } 538 538 539 static int snd_emu10k1_tram_poke( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)539 static int snd_emu10k1_tram_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 540 540 { 541 541 int tram; … … 559 559 } 560 560 561 static int snd_emu10k1_tram_peek( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)561 static int snd_emu10k1_tram_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 562 562 { 563 563 int tram; … … 581 581 } 582 582 583 static int snd_emu10k1_code_poke( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)583 static int snd_emu10k1_code_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 584 584 { 585 585 u32 pc, lo, hi; … … 597 597 } 598 598 599 static int snd_emu10k1_code_peek( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)599 static int snd_emu10k1_code_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 600 600 { 601 601 u32 pc; … … 612 612 } 613 613 614 static s nd_emu10k1_fx8010_ctl_t *snd_emu10k1_look_for_ctl(emu10k1_t*emu, snd_ctl_elem_id_t *id)615 { 616 s nd_emu10k1_fx8010_ctl_t*ctl;614 static struct snd_emu10k1_fx8010_ctl *snd_emu10k1_look_for_ctl(struct snd_emu10k1 *emu, snd_ctl_elem_id_t *id) 615 { 616 struct snd_emu10k1_fx8010_ctl *ctl; 617 617 snd_kcontrol_t *kcontrol; 618 618 struct list_head *list; … … 629 629 } 630 630 631 static int snd_emu10k1_verify_controls( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)631 static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 632 632 { 633 633 unsigned int i; … … 684 684 static void snd_emu10k1_ctl_private_free(snd_kcontrol_t *kctl) 685 685 { 686 s nd_emu10k1_fx8010_ctl_t*ctl;687 688 ctl = (s nd_emu10k1_fx8010_ctl_t*)kctl->private_value;686 struct snd_emu10k1_fx8010_ctl *ctl; 687 688 ctl = (struct snd_emu10k1_fx8010_ctl *)kctl->private_value; 689 689 kctl->private_value = 0; 690 690 list_del(&ctl->list); … … 692 692 } 693 693 694 static int snd_emu10k1_add_controls( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)694 static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 695 695 { 696 696 unsigned int i, j; 697 697 emu10k1_fx8010_control_gpr_t *_gctl; 698 698 emu10k1_fx8010_control_gpr_t *gctl; 699 s nd_emu10k1_fx8010_ctl_t*ctl, *nctl;699 struct snd_emu10k1_fx8010_ctl *ctl, *nctl; 700 700 snd_kcontrol_new_t knew; 701 701 snd_kcontrol_t *kctl; … … 742 742 nctl->translation = gctl->translation; 743 743 if (ctl == NULL) { 744 ctl = (s nd_emu10k1_fx8010_ctl_t*)kmalloc(sizeof(*ctl), GFP_KERNEL);744 ctl = (struct snd_emu10k1_fx8010_ctl *)kmalloc(sizeof(*ctl), GFP_KERNEL); 745 745 if (ctl == NULL) { 746 746 err = -ENOMEM; … … 773 773 } 774 774 775 static int snd_emu10k1_del_controls( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)775 static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 776 776 { 777 777 unsigned int i; 778 778 snd_ctl_elem_id_t *_id, id; 779 s nd_emu10k1_fx8010_ctl_t*ctl;779 struct snd_emu10k1_fx8010_ctl *ctl; 780 780 snd_card_t *card = emu->card; 781 781 … … 792 792 } 793 793 794 static int snd_emu10k1_list_controls( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)794 static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 795 795 { 796 796 unsigned int i = 0, j; … … 798 798 emu10k1_fx8010_control_gpr_t *gctl; 799 799 emu10k1_fx8010_control_gpr_t *_gctl; 800 s nd_emu10k1_fx8010_ctl_t*ctl;800 struct snd_emu10k1_fx8010_ctl *ctl; 801 801 snd_ctl_elem_id_t *id; 802 802 struct list_head *list; … … 840 840 } 841 841 842 static int snd_emu10k1_icode_poke( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)842 static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 843 843 { 844 844 int err = 0; … … 871 871 } 872 872 873 static int snd_emu10k1_icode_peek( emu10k1_t*emu, emu10k1_fx8010_code_t *icode)873 static int snd_emu10k1_icode_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode) 874 874 { 875 875 int err; … … 889 889 } 890 890 891 static int snd_emu10k1_ipcm_poke( emu10k1_t*emu, emu10k1_fx8010_pcm_t *ipcm)891 static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_pcm_t *ipcm) 892 892 { 893 893 unsigned int i; 894 894 int err = 0; 895 s nd_emu10k1_fx8010_pcm_t*pcm;895 struct snd_emu10k1_fx8010_pcm *pcm; 896 896 897 897 if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT) … … 934 934 } 935 935 936 static int snd_emu10k1_ipcm_peek( emu10k1_t*emu, emu10k1_fx8010_pcm_t *ipcm)936 static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_pcm_t *ipcm) 937 937 { 938 938 unsigned int i; 939 939 int err = 0; 940 s nd_emu10k1_fx8010_pcm_t*pcm;940 struct snd_emu10k1_fx8010_pcm *pcm; 941 941 942 942 if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT) … … 1019 1019 */ 1020 1020 1021 static int __devinit _snd_emu10k1_audigy_init_efx( emu10k1_t*emu)1021 static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) 1022 1022 { 1023 1023 int err, i, z, gpr, nctl; … … 1035 1035 INIT_LIST_HEAD(&emu->fx8010.gpr_ctl); 1036 1036 1037 if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL ||1037 if ((icode = (emu10k1_fx8010_code_t *)kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL || 1038 1038 (icode->gpr_map = (u_int32_t __user *)kcalloc(512 + 256 + 256 + 2 * 1024, sizeof(u_int32_t), GFP_KERNEL)) == NULL || 1039 1039 (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(*controls), GFP_KERNEL)) == NULL) { … … 1487 1487 1488 1488 1489 static int __devinit _snd_emu10k1_init_efx( emu10k1_t*emu)1489 static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu) 1490 1490 { 1491 1491 int err, i, z, gpr, tmp, playback, capture; … … 1500 1500 INIT_LIST_HEAD(&emu->fx8010.gpr_ctl); 1501 1501 1502 if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL)1502 if ((icode = (emu10k1_fx8010_code_t *)kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL) 1503 1503 return -ENOMEM; 1504 1504 if ((icode->gpr_map = (u_int32_t __user *)kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), GFP_KERNEL)) == NULL || 1505 1505 (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(emu10k1_fx8010_control_gpr_t), GFP_KERNEL)) == NULL || 1506 (ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL)) == NULL) {1506 (ipcm = (emu10k1_fx8010_pcm_t *)kzalloc(sizeof(*ipcm), GFP_KERNEL)) == NULL) { 1507 1507 err = -ENOMEM; 1508 1508 goto __err; … … 2050 2050 } 2051 2051 2052 int __devinit snd_emu10k1_init_efx( emu10k1_t*emu)2052 int __devinit snd_emu10k1_init_efx(struct snd_emu10k1 *emu) 2053 2053 { 2054 2054 if (emu->audigy) … … 2058 2058 } 2059 2059 2060 void snd_emu10k1_free_efx( emu10k1_t*emu)2060 void snd_emu10k1_free_efx(struct snd_emu10k1 *emu) 2061 2061 { 2062 2062 /* stop processor */ … … 2068 2068 2069 2069 #if 0 // FIXME: who use them? 2070 int snd_emu10k1_fx8010_tone_control_activate( emu10k1_t*emu, int output)2070 int snd_emu10k1_fx8010_tone_control_activate(struct snd_emu10k1 *emu, int output) 2071 2071 { 2072 2072 snd_runtime_check(output >= 0 && output < 6, return -EINVAL); … … 2075 2075 } 2076 2076 2077 int snd_emu10k1_fx8010_tone_control_deactivate( emu10k1_t*emu, int output)2077 int snd_emu10k1_fx8010_tone_control_deactivate(struct snd_emu10k1 *emu, int output) 2078 2078 { 2079 2079 snd_runtime_check(output >= 0 && output < 6, return -EINVAL); … … 2083 2083 #endif 2084 2084 2085 int snd_emu10k1_fx8010_tram_setup( emu10k1_t*emu, u32 size)2085 int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size) 2086 2086 { 2087 2087 u8 size_reg = 0; … … 2138 2138 } 2139 2139 2140 static int snd_emu10k1_fx8010_info( emu10k1_t*emu, emu10k1_fx8010_info_t *info)2140 static int snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu, emu10k1_fx8010_info_t *info) 2141 2141 { 2142 2142 char **fxbus, **extin, **extout; … … 2166 2166 static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg) 2167 2167 { 2168 emu10k1_t*emu = hw->private_data;2168 struct snd_emu10k1 *emu = hw->private_data; 2169 2169 emu10k1_fx8010_info_t *info; 2170 2170 emu10k1_fx8010_code_t *icode; … … 2228 2228 return res; 2229 2229 case SNDRV_EMU10K1_IOCTL_PCM_PEEK: 2230 ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL);2230 ipcm = (emu10k1_fx8010_pcm_t *)kzalloc(sizeof(*ipcm), GFP_KERNEL); 2231 2231 if (ipcm == NULL) 2232 2232 return -ENOMEM; … … 2314 2314 } 2315 2315 2316 int __devinit snd_emu10k1_fx8010_new( emu10k1_t*emu, int device, snd_hwdep_t ** rhwdep)2316 int __devinit snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, snd_hwdep_t ** rhwdep) 2317 2317 { 2318 2318 snd_hwdep_t *hw;
Note:
See TracChangeset
for help on using the changeset viewer.