Changeset 34 for GPL/trunk/alsa-kernel/pci/emu10k1
- Timestamp:
- Dec 11, 2005, 5:57:39 PM (20 years ago)
- Location:
- GPL/trunk/alsa-kernel/pci/emu10k1
- Files:
-
- 18 edited
-
emu10k1.c (modified) (2 diffs)
-
emu10k1_callback.c (modified) (18 diffs)
-
emu10k1_main.c (modified) (13 diffs)
-
emu10k1_patch.c (modified) (3 diffs)
-
emu10k1_synth.c (modified) (3 diffs)
-
emu10k1_synth_local.h (modified) (1 diff)
-
emu10k1x.c (modified) (62 diffs)
-
emufx.c (modified) (39 diffs)
-
emumixer.c (modified) (28 diffs)
-
emumpu401.c (modified) (14 diffs)
-
emupcm.c (modified) (55 diffs)
-
emuproc.c (modified) (13 diffs)
-
io.c (modified) (17 diffs)
-
irq.c (modified) (4 diffs)
-
memory.c (modified) (21 diffs)
-
p16v.c (modified) (23 diffs)
-
timer.c (modified) (4 diffs)
-
voice.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1.c
r33 r34 122 122 #endif 123 123 snd_card_t *card; 124 emu10k1_t*emu;124 struct snd_emu10k1 *emu; 125 125 #ifdef ENABLE_SYNTH 126 126 snd_seq_device_t *wave = NULL; … … 208 208 #ifdef ENABLE_SYNTH 209 209 if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, 210 sizeof(s nd_emu10k1_synth_arg_t), &wave) < 0 ||210 sizeof(struct snd_emu10k1_synth_arg), &wave) < 0 || 211 211 wave == NULL) { 212 212 snd_printk("can't initialize Emu10k1 wavetable synth\n"); 213 213 } else { 214 s nd_emu10k1_synth_arg_t*arg;214 struct snd_emu10k1_synth_arg *arg; 215 215 arg = SNDRV_SEQ_DEVICE_ARGPTR(wave); 216 216 strcpy(wave->name, "Emu-10k1 Synth"); -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_callback.c
r33 r34 37 37 * prototypes 38 38 */ 39 static void lookup_voices(s nd_emux_t *emu, emu10k1_t*hw, best_voice_t *best, int active_only);40 static s nd_emux_voice_t *get_voice(snd_emux_t *emu, snd_emux_port_t *port);41 static int start_voice(s nd_emux_voice_t*vp);42 static void trigger_voice(s nd_emux_voice_t*vp);43 static void release_voice(s nd_emux_voice_t*vp);44 static void update_voice(s nd_emux_voice_t*vp, int update);45 static void terminate_voice(s nd_emux_voice_t*vp);46 static void free_voice(s nd_emux_voice_t*vp);47 48 static void set_fmmod( emu10k1_t *hw, snd_emux_voice_t*vp);49 static void set_fm2frq2( emu10k1_t *hw, snd_emux_voice_t*vp);50 static void set_filterQ( emu10k1_t *hw, snd_emux_voice_t*vp);39 static void lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw, best_voice_t *best, int active_only); 40 static struct snd_emux_voice *get_voice(struct snd_emux *emu, struct snd_emux_port *port); 41 static int start_voice(struct snd_emux_voice *vp); 42 static void trigger_voice(struct snd_emux_voice *vp); 43 static void release_voice(struct snd_emux_voice *vp); 44 static void update_voice(struct snd_emux_voice *vp, int update); 45 static void terminate_voice(struct snd_emux_voice *vp); 46 static void free_voice(struct snd_emux_voice *vp); 47 48 static void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); 49 static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); 50 static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); 51 51 52 52 /* … … 61 61 * set up operators 62 62 */ 63 #ifdef TARGET_OS2 64 static snd_emux_operators_t emu10k1_ops = { 65 THIS_MODULE, 66 get_voice, 67 start_voice, 68 trigger_voice, 69 release_voice, 70 update_voice, 71 terminate_voice, 72 free_voice, 0, 73 snd_emu10k1_sample_new, 74 snd_emu10k1_sample_free,0,0,0 63 static struct snd_emux_operators emu10k1_ops = { 64 .owner = THIS_MODULE, 65 .get_voice = get_voice, 66 .prepare = start_voice, 67 .trigger = trigger_voice, 68 .release = release_voice, 69 .update = update_voice, 70 .terminate = terminate_voice, 71 .free_voice = free_voice, 72 .sample_new = snd_emu10k1_sample_new, 73 .sample_free = snd_emu10k1_sample_free, 75 74 }; 76 #else 77 static snd_emux_operators_t emu10k1_ops = { 78 owner: THIS_MODULE, 79 get_voice: get_voice, 80 prepare: start_voice, 81 trigger: trigger_voice, 82 release: release_voice, 83 update: update_voice, 84 terminate: terminate_voice, 85 free_voice: free_voice, 86 sample_new: snd_emu10k1_sample_new, 87 sample_free: snd_emu10k1_sample_free, 88 }; 89 #endif 90 void 91 snd_emu10k1_ops_setup(snd_emux_t *emu) 75 76 void snd_emu10k1_ops_setup(struct snd_emux *emu) 92 77 { 93 78 emu->ops = emu10k1_ops; … … 101 86 */ 102 87 int 103 snd_emu10k1_synth_get_voice( emu10k1_t*hw)104 { 105 s nd_emux_t*emu;106 s nd_emux_voice_t*vp;88 snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) 89 { 90 struct snd_emux *emu; 91 struct snd_emux_voice *vp; 107 92 best_voice_t best[V_END]; 108 93 unsigned long flags; … … 139 124 */ 140 125 static void 141 release_voice(s nd_emux_voice_t*vp)126 release_voice(struct snd_emux_voice *vp) 142 127 { 143 128 int dcysusv; 144 emu10k1_t*hw;129 struct snd_emu10k1 *hw; 145 130 146 131 hw = vp->hw; … … 156 141 */ 157 142 static void 158 terminate_voice(s nd_emux_voice_t*vp)159 { 160 emu10k1_t*hw;143 terminate_voice(struct snd_emux_voice *vp) 144 { 145 struct snd_emu10k1 *hw; 161 146 162 147 snd_assert(vp, return); … … 164 149 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); 165 150 if (vp->block) { 166 emu10k1_memblk_t*emem;167 emem = ( emu10k1_memblk_t*)vp->block;151 struct snd_emu10k1_memblk *emem; 152 emem = (struct snd_emu10k1_memblk *)vp->block; 168 153 if (emem->map_locked > 0) 169 154 emem->map_locked--; … … 175 160 */ 176 161 static void 177 free_voice(s nd_emux_voice_t*vp)178 { 179 emu10k1_t*hw;162 free_voice(struct snd_emux_voice *vp) 163 { 164 struct snd_emu10k1 *hw; 180 165 181 166 hw = vp->hw; … … 197 182 */ 198 183 static void 199 update_voice(s nd_emux_voice_t*vp, int update)200 { 201 emu10k1_t*hw;184 update_voice(struct snd_emux_voice *vp, int update) 185 { 186 struct snd_emu10k1 *hw; 202 187 203 188 hw = vp->hw; … … 226 211 /* spinlock held! */ 227 212 static void 228 lookup_voices(s nd_emux_t *emu, emu10k1_t*hw, best_voice_t *best, int active_only)229 { 230 s nd_emux_voice_t*vp;213 lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw, best_voice_t *best, int active_only) 214 { 215 struct snd_emux_voice *vp; 231 216 best_voice_t *bp; 232 217 int i; … … 290 275 * emu->voice_lock is already held. 291 276 */ 292 static s nd_emux_voice_t*293 get_voice(s nd_emux_t *emu, snd_emux_port_t *port)294 { 295 emu10k1_t*hw;296 s nd_emux_voice_t*vp;277 static struct snd_emux_voice * 278 get_voice(struct snd_emux *emu, struct snd_emux_port *port) 279 { 280 struct snd_emu10k1 *hw; 281 struct snd_emux_voice *vp; 297 282 best_voice_t best[V_END]; 298 283 int i; … … 306 291 if (vp->ch < 0) { 307 292 /* allocate a voice */ 308 emu10k1_voice_t*hwvoice;293 struct snd_emu10k1_voice *hwvoice; 309 294 if (snd_emu10k1_voice_alloc(hw, EMU10K1_SYNTH, 1, &hwvoice) < 0 || hwvoice == NULL) 310 295 continue; … … 324 309 */ 325 310 static int 326 start_voice(s nd_emux_voice_t*vp)311 start_voice(struct snd_emux_voice *vp) 327 312 { 328 313 unsigned int temp; … … 330 315 unsigned int addr, mapped_offset; 331 316 snd_midi_channel_t *chan; 332 emu10k1_t*hw;333 emu10k1_memblk_t*emem;317 struct snd_emu10k1 *hw; 318 struct snd_emu10k1_memblk *emem; 334 319 335 320 hw = vp->hw; … … 338 323 chan = vp->chan; 339 324 340 emem = ( emu10k1_memblk_t*)vp->block;325 emem = (struct snd_emu10k1_memblk *)vp->block; 341 326 if (emem == NULL) 342 327 return -EINVAL; … … 480 465 */ 481 466 static void 482 trigger_voice(s nd_emux_voice_t*vp)467 trigger_voice(struct snd_emux_voice *vp) 483 468 { 484 469 unsigned int temp, ptarget; 485 emu10k1_t*hw;486 emu10k1_memblk_t*emem;470 struct snd_emu10k1 *hw; 471 struct snd_emu10k1_memblk *emem; 487 472 488 473 hw = vp->hw; 489 474 490 emem = ( emu10k1_memblk_t*)vp->block;475 emem = (struct snd_emu10k1_memblk *)vp->block; 491 476 if (! emem || emem->mapped_page < 0) 492 477 return; /* not mapped */ … … 512 497 /* set lfo1 modulation height and cutoff */ 513 498 static void 514 set_fmmod( emu10k1_t *hw, snd_emux_voice_t*vp)499 set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) 515 500 { 516 501 unsigned short fmmod; … … 530 515 /* set lfo2 pitch & frequency */ 531 516 static void 532 set_fm2frq2( emu10k1_t *hw, snd_emux_voice_t*vp)517 set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) 533 518 { 534 519 unsigned short fm2frq2; … … 548 533 /* set filterQ */ 549 534 static void 550 set_filterQ( emu10k1_t *hw, snd_emux_voice_t*vp)535 set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) 551 536 { 552 537 unsigned int val; -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_main.c
r33 r34 46 46 *************************************************************************/ 47 47 48 void snd_emu10k1_voice_init( emu10k1_t* emu, int ch)48 void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int ch) 49 49 { 50 50 snd_emu10k1_ptr_write(emu, DCYSUSV, ch, 0); … … 91 91 } 92 92 93 static int __devinit snd_emu10k1_init( emu10k1_t* emu, int enable_ir)93 static int __devinit snd_emu10k1_init(struct snd_emu10k1 * emu, int enable_ir) 94 94 { 95 95 int ch, idx, err; … … 329 329 snd_emu10k1_intr_enable(emu, INTE_PCIERRORENABLE); 330 330 331 emu->reserved_page = ( emu10k1_memblk_t*)snd_emu10k1_synth_alloc(emu, 4096);331 emu->reserved_page = (struct snd_emu10k1_memblk *)snd_emu10k1_synth_alloc(emu, 4096); 332 332 if (emu->reserved_page) 333 333 emu->reserved_page->map_locked = 1; … … 336 336 } 337 337 338 static int snd_emu10k1_done( emu10k1_t* emu)338 static int snd_emu10k1_done(struct snd_emu10k1 * emu) 339 339 { 340 340 int ch; … … 467 467 */ 468 468 469 static void snd_emu10k1_ecard_write( emu10k1_t* emu, unsigned int value)469 static void snd_emu10k1_ecard_write(struct snd_emu10k1 * emu, unsigned int value) 470 470 { 471 471 unsigned short count; … … 505 505 */ 506 506 507 static void snd_emu10k1_ecard_setadcgain( emu10k1_t* emu,507 static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu, 508 508 unsigned short gain) 509 509 { … … 533 533 } 534 534 535 static int __devinit snd_emu10k1_ecard_init( emu10k1_t* emu)535 static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu) 536 536 { 537 537 unsigned int hc_value; … … 573 573 } 574 574 575 static int __devinit snd_emu10k1_cardbus_init( emu10k1_t* emu)575 static int __devinit snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu) 576 576 { 577 577 unsigned long special_port; … … 601 601 */ 602 602 603 static int snd_emu10k1_free( emu10k1_t*emu)603 static int snd_emu10k1_free(struct snd_emu10k1 *emu) 604 604 { 605 605 if (emu->port) { /* avoid access to already used hardware */ … … 629 629 static int snd_emu10k1_dev_free(snd_device_t *device) 630 630 { 631 emu10k1_t*emu = device->device_data;631 struct snd_emu10k1 *emu = device->device_data; 632 632 return snd_emu10k1_free(emu); 633 633 } 634 634 635 635 /* vendor, device, subsystem, emu10k1_chip, emu10k2_chip, ca0102_chip, ca0108_chip, ca0151_chip, spk71, spdif_bug, ac97_chip, ecard, driver, name */ 636 static emu_chip_details_temu_chip_details[] = {636 static struct snd_emu_chip_details emu_chip_details[] = { 637 637 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/ 638 638 /* Tested by James@superbug.co.uk 3rd July 2005 */ … … 880 880 int enable_ir, 881 881 uint subsystem, 882 emu10k1_t** remu)882 struct snd_emu10k1 ** remu) 883 883 { 884 emu10k1_t*emu;884 struct snd_emu10k1 *emu; 885 885 int err; 886 886 int is_audigy; 887 887 unsigned char revision; 888 const emu_chip_details_t*c;888 const struct snd_emu_chip_details *c; 889 889 #ifdef TARGET_OS2 890 890 static snd_device_ops_t ops = { … … 902 902 return err; 903 903 904 emu = kzalloc(sizeof(*emu), GFP_KERNEL);904 emu = (struct snd_emu10k1 *)kzalloc(sizeof(*emu), GFP_KERNEL); 905 905 if (emu == NULL) 906 906 return -ENOMEM; … … 1003 1003 return -ENOMEM; 1004 1004 } 1005 emu->memhdr->block_extra_size = sizeof( emu10k1_memblk_t) - sizeof(snd_util_memblk_t);1005 emu->memhdr->block_extra_size = sizeof(struct snd_emu10k1_memblk) - sizeof(snd_util_memblk_t); 1006 1006 1007 1007 pci_set_master(pci); -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_patch.c
r33 r34 37 37 */ 38 38 int 39 snd_emu10k1_sample_new(s nd_emux_t *rec, snd_sf_sample_t*sp,39 snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp, 40 40 snd_util_memhdr_t *hdr, const void *data, long count) 41 41 { … … 44 44 int loopend, sampleend; 45 45 unsigned int start_addr; 46 emu10k1_t*emu;46 struct snd_emu10k1 *emu; 47 47 48 48 emu = rec->hw; … … 210 210 */ 211 211 int 212 snd_emu10k1_sample_free(s nd_emux_t *rec, snd_sf_sample_t*sp,212 snd_emu10k1_sample_free(struct snd_emux *rec, struct snd_sf_sample *sp, 213 213 snd_util_memhdr_t *hdr) 214 214 { 215 emu10k1_t*emu;215 struct snd_emu10k1 *emu; 216 216 217 217 emu = rec->hw; -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_synth.c
r33 r34 31 31 int snd_emu10k1_synth_new_device(snd_seq_device_t *dev) 32 32 { 33 s nd_emux_t*emu;34 emu10k1_t*hw;35 s nd_emu10k1_synth_arg_t*arg;33 struct snd_emux *emu; 34 struct snd_emu10k1 *hw; 35 struct snd_emu10k1_synth_arg *arg; 36 36 unsigned long flags; 37 37 … … 79 79 int snd_emu10k1_synth_delete_device(snd_seq_device_t *dev) 80 80 { 81 s nd_emux_t*emu;82 emu10k1_t*hw;81 struct snd_emux *emu; 82 struct snd_emu10k1 *hw; 83 83 unsigned long flags; 84 84 … … 110 110 snd_emu10k1_synth_delete_device, 111 111 }; 112 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops, sizeof(s nd_emu10k1_synth_arg_t));112 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops, sizeof(struct snd_emu10k1_synth_arg)); 113 113 } 114 114 -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_synth_local.h
r33 r34 27 27 28 28 /* emu10k1_patch.c */ 29 int snd_emu10k1_sample_new(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *_data, long count); 30 int snd_emu10k1_sample_free(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr); 31 int snd_emu10k1_memhdr_init(snd_emux_t *emu); 29 int snd_emu10k1_sample_new(struct snd_emux *private_data, 30 struct snd_sf_sample *sp, 31 struct snd_util_memhdr *hdr, 32 const void __user *_data, long count); 33 int snd_emu10k1_sample_free(struct snd_emux *private_data, 34 struct snd_sf_sample *sp, 35 struct snd_util_memhdr *hdr); 36 int snd_emu10k1_memhdr_init(struct snd_emux *emu); 32 37 33 38 /* emu10k1_callback.c */ 34 void snd_emu10k1_ops_setup(s nd_emux_t*emu);35 int snd_emu10k1_synth_get_voice( emu10k1_t*hw);39 void snd_emu10k1_ops_setup(struct snd_emux *emu); 40 int snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw); 36 41 37 42 -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1x.c
r33 r34 196 196 */ 197 197 198 typedef struct snd_emu10k1x_voice emu10k1x_voice_t; 199 typedef struct snd_emu10k1x emu10k1x_t; 200 typedef struct snd_emu10k1x_pcm emu10k1x_pcm_t; 201 202 struct snd_emu10k1x_voice { 203 emu10k1x_t *emu; 198 struct emu10k1x_voice { 199 struct emu10k1x *emu; 204 200 int number; 205 201 int use; 206 202 207 emu10k1x_pcm_t*epcm;203 struct emu10k1x_pcm *epcm; 208 204 }; 209 205 210 struct snd_emu10k1x_pcm {211 emu10k1x_t*emu;212 s nd_pcm_substream_t*substream;213 emu10k1x_voice_t*voice;206 struct emu10k1x_pcm { 207 struct emu10k1x *emu; 208 struct snd_pcm_substream *substream; 209 struct emu10k1x_voice *voice; 214 210 unsigned short running; 215 211 }; 216 212 217 typedef struct{218 struct snd_emu10k1x *emu;219 s nd_rawmidi_t*rmidi;220 s nd_rawmidi_substream_t*substream_input;221 s nd_rawmidi_substream_t*substream_output;213 struct emu10k1x_midi { 214 struct emu10k1x *emu; 215 struct snd_rawmidi *rmidi; 216 struct snd_rawmidi_substream *substream_input; 217 struct snd_rawmidi_substream *substream_output; 222 218 unsigned int midi_mode; 223 219 spinlock_t input_lock; … … 227 223 int port; 228 224 int ipr_tx, ipr_rx; 229 void (*interrupt)( emu10k1x_t*emu, unsigned int status);230 } emu10k1x_midi_t;225 void (*interrupt)(struct emu10k1x *emu, unsigned int status); 226 }; 231 227 232 228 // definition of the chip-specific record 233 struct snd_emu10k1x {234 s nd_card_t*card;229 struct emu10k1x { 230 struct snd_card *card; 235 231 struct pci_dev *pci; 236 232 … … 246 242 spinlock_t voice_lock; 247 243 248 ac97_t*ac97;249 s nd_pcm_t*pcm;250 251 emu10k1x_voice_tvoices[3];252 emu10k1x_voice_tcapture_voice;244 struct snd_ac97 *ac97; 245 struct snd_pcm *pcm; 246 247 struct emu10k1x_voice voices[3]; 248 struct emu10k1x_voice capture_voice; 253 249 u32 spdif_bits[3]; // SPDIF out setup 254 250 255 251 struct snd_dma_buffer dma_buffer; 256 252 257 emu10k1x_midi_tmidi;253 struct emu10k1x_midi midi; 258 254 }; 259 255 260 256 /* hardware definition */ 261 static s nd_pcm_hardware_tsnd_emu10k1x_playback_hw = {262 /*.info = */ (SNDRV_PCM_INFO_MMAP |257 static struct snd_pcm_hardware snd_emu10k1x_playback_hw = { 258 .info = (SNDRV_PCM_INFO_MMAP | 263 259 SNDRV_PCM_INFO_INTERLEAVED | 264 260 SNDRV_PCM_INFO_BLOCK_TRANSFER | 265 261 SNDRV_PCM_INFO_MMAP_VALID), 266 /*.formats = */SNDRV_PCM_FMTBIT_S16_LE,267 /*.rates = */SNDRV_PCM_RATE_48000,268 /*.rate_min = */48000,269 /*.rate_max = */48000,270 /*.channels_min = */2,271 /*.channels_max = */2,272 /*.buffer_bytes_max = */(32*1024),273 /*.period_bytes_min = */64,274 /*.period_bytes_max = */(16*1024),275 /*.periods_min = */2,276 /*.periods_max = */8,277 /*.fifo_size = */ 0262 .formats = SNDRV_PCM_FMTBIT_S16_LE, 263 .rates = SNDRV_PCM_RATE_48000, 264 .rate_min = 48000, 265 .rate_max = 48000, 266 .channels_min = 2, 267 .channels_max = 2, 268 .buffer_bytes_max = (32*1024), 269 .period_bytes_min = 64, 270 .period_bytes_max = (16*1024), 271 .periods_min = 2, 272 .periods_max = 8, 273 .fifo_size = 0, 278 274 }; 279 275 280 static s nd_pcm_hardware_tsnd_emu10k1x_capture_hw = {281 /*.info = */(SNDRV_PCM_INFO_MMAP |276 static struct snd_pcm_hardware snd_emu10k1x_capture_hw = { 277 .info = (SNDRV_PCM_INFO_MMAP | 282 278 SNDRV_PCM_INFO_INTERLEAVED | 283 279 SNDRV_PCM_INFO_BLOCK_TRANSFER | 284 280 SNDRV_PCM_INFO_MMAP_VALID), 285 /*.formats = */SNDRV_PCM_FMTBIT_S16_LE,286 /*.rates = */SNDRV_PCM_RATE_48000,287 /*.rate_min = */48000,288 /*.rate_max = */48000,289 /*.channels_min = */2,290 /*.channels_max = */2,291 /*.buffer_bytes_max = */(32*1024),292 /*.period_bytes_min = */64,293 /*.period_bytes_max = */(16*1024),294 /*.periods_min = */2,295 /*.periods_max = */2,296 /*.fifo_size = */ 0281 .formats = SNDRV_PCM_FMTBIT_S16_LE, 282 .rates = SNDRV_PCM_RATE_48000, 283 .rate_min = 48000, 284 .rate_max = 48000, 285 .channels_min = 2, 286 .channels_max = 2, 287 .buffer_bytes_max = (32*1024), 288 .period_bytes_min = 64, 289 .period_bytes_max = (16*1024), 290 .periods_min = 2, 291 .periods_max = 2, 292 .fifo_size = 0, 297 293 }; 298 294 299 static unsigned int snd_emu10k1x_ptr_read( emu10k1x_t* emu,295 static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu, 300 296 unsigned int reg, 301 297 unsigned int chn) … … 313 309 } 314 310 315 static void snd_emu10k1x_ptr_write( emu10k1x_t*emu,311 static void snd_emu10k1x_ptr_write(struct emu10k1x *emu, 316 312 unsigned int reg, 317 313 unsigned int chn, … … 329 325 } 330 326 331 static void snd_emu10k1x_intr_enable( emu10k1x_t*emu, unsigned int intrenb)327 static void snd_emu10k1x_intr_enable(struct emu10k1x *emu, unsigned int intrenb) 332 328 { 333 329 unsigned long flags; … … 340 336 } 341 337 342 static void snd_emu10k1x_intr_disable( emu10k1x_t*emu, unsigned int intrenb)338 static void snd_emu10k1x_intr_disable(struct emu10k1x *emu, unsigned int intrenb) 343 339 { 344 340 unsigned long flags; … … 351 347 } 352 348 353 static void snd_emu10k1x_gpio_write( emu10k1x_t*emu, unsigned int value)349 static void snd_emu10k1x_gpio_write(struct emu10k1x *emu, unsigned int value) 354 350 { 355 351 unsigned long flags; … … 360 356 } 361 357 362 static void snd_emu10k1x_pcm_free_substream(snd_pcm_runtime_t *runtime) 363 { 364 emu10k1x_pcm_t *epcm = runtime->private_data; 365 366 if (epcm) 367 kfree(epcm); 368 } 369 370 static void snd_emu10k1x_pcm_interrupt(emu10k1x_t *emu, emu10k1x_voice_t *voice) 371 { 372 emu10k1x_pcm_t *epcm; 358 static void snd_emu10k1x_pcm_free_substream(struct snd_pcm_runtime *runtime) 359 { 360 kfree(runtime->private_data); 361 } 362 363 static void snd_emu10k1x_pcm_interrupt(struct emu10k1x *emu, struct emu10k1x_voice *voice) 364 { 365 struct emu10k1x_pcm *epcm; 373 366 374 367 if ((epcm = voice->epcm) == NULL) … … 386 379 387 380 /* open callback */ 388 static int snd_emu10k1x_playback_open(s nd_pcm_substream_t*substream)389 { 390 emu10k1x_t*chip = snd_pcm_substream_chip(substream);391 emu10k1x_pcm_t*epcm;392 s nd_pcm_runtime_t*runtime = substream->runtime;381 static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream) 382 { 383 struct emu10k1x *chip = snd_pcm_substream_chip(substream); 384 struct emu10k1x_pcm *epcm; 385 struct snd_pcm_runtime *runtime = substream->runtime; 393 386 int err; 394 387 … … 399 392 return err; 400 393 401 epcm =kzalloc(sizeof(*epcm), GFP_KERNEL);394 epcm = (struct emu10k1x_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 402 395 if (epcm == NULL) 403 396 return -ENOMEM; … … 414 407 415 408 /* close callback */ 416 static int snd_emu10k1x_playback_close(s nd_pcm_substream_t*substream)409 static int snd_emu10k1x_playback_close(struct snd_pcm_substream *substream) 417 410 { 418 411 return 0; … … 420 413 421 414 /* hw_params callback */ 422 static int snd_emu10k1x_pcm_hw_params(s nd_pcm_substream_t*substream,423 s nd_pcm_hw_params_t *hw_params)424 { 425 s nd_pcm_runtime_t*runtime = substream->runtime;426 emu10k1x_pcm_t*epcm = runtime->private_data;415 static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream, 416 struct snd_pcm_hw_params *hw_params) 417 { 418 struct snd_pcm_runtime *runtime = substream->runtime; 419 struct emu10k1x_pcm *epcm = runtime->private_data; 427 420 428 421 if (! epcm->voice) { … … 437 430 438 431 /* hw_free callback */ 439 static int snd_emu10k1x_pcm_hw_free(s nd_pcm_substream_t*substream)440 { 441 s nd_pcm_runtime_t*runtime = substream->runtime;442 emu10k1x_pcm_t*epcm;432 static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream) 433 { 434 struct snd_pcm_runtime *runtime = substream->runtime; 435 struct emu10k1x_pcm *epcm; 443 436 444 437 if (runtime->private_data == NULL) … … 457 450 458 451 /* prepare callback */ 459 static int snd_emu10k1x_pcm_prepare(s nd_pcm_substream_t*substream)460 { 461 emu10k1x_t*emu = snd_pcm_substream_chip(substream);462 s nd_pcm_runtime_t*runtime = substream->runtime;463 emu10k1x_pcm_t*epcm = runtime->private_data;452 static int snd_emu10k1x_pcm_prepare(struct snd_pcm_substream *substream) 453 { 454 struct emu10k1x *emu = snd_pcm_substream_chip(substream); 455 struct snd_pcm_runtime *runtime = substream->runtime; 456 struct emu10k1x_pcm *epcm = runtime->private_data; 464 457 int voice = epcm->voice->number; 465 458 u32 *table_base = (u32 *)(emu->dma_buffer.area+1024*voice); … … 486 479 487 480 /* trigger callback */ 488 static int snd_emu10k1x_pcm_trigger(s nd_pcm_substream_t*substream,481 static int snd_emu10k1x_pcm_trigger(struct snd_pcm_substream *substream, 489 482 int cmd) 490 483 { 491 emu10k1x_t*emu = snd_pcm_substream_chip(substream);492 s nd_pcm_runtime_t*runtime = substream->runtime;493 emu10k1x_pcm_t*epcm = runtime->private_data;484 struct emu10k1x *emu = snd_pcm_substream_chip(substream); 485 struct snd_pcm_runtime *runtime = substream->runtime; 486 struct emu10k1x_pcm *epcm = runtime->private_data; 494 487 int channel = epcm->voice->number; 495 488 int result = 0; … … 520 513 /* pointer callback */ 521 514 static snd_pcm_uframes_t 522 snd_emu10k1x_pcm_pointer(s nd_pcm_substream_t*substream)523 { 524 emu10k1x_t*emu = snd_pcm_substream_chip(substream);525 s nd_pcm_runtime_t*runtime = substream->runtime;526 emu10k1x_pcm_t*epcm = runtime->private_data;515 snd_emu10k1x_pcm_pointer(struct snd_pcm_substream *substream) 516 { 517 struct emu10k1x *emu = snd_pcm_substream_chip(substream); 518 struct snd_pcm_runtime *runtime = substream->runtime; 519 struct emu10k1x_pcm *epcm = runtime->private_data; 527 520 int channel = epcm->voice->number; 528 521 snd_pcm_uframes_t ptr = 0, ptr1 = 0, ptr2= 0,ptr3 = 0,ptr4 = 0; … … 551 544 552 545 /* operators */ 553 static snd_pcm_ops_t snd_emu10k1x_playback_ops = { 554 /*.open = */ snd_emu10k1x_playback_open, 555 /*.close = */ snd_emu10k1x_playback_close, 556 /*.ioctl = */ snd_pcm_lib_ioctl, 557 /*.hw_params = */ snd_emu10k1x_pcm_hw_params, 558 /*.hw_free = */ snd_emu10k1x_pcm_hw_free, 559 /*.prepare = */ snd_emu10k1x_pcm_prepare, 560 /*.trigger = */ snd_emu10k1x_pcm_trigger, 561 /*.pointer = */ snd_emu10k1x_pcm_pointer, 562 0,0,0,0 546 static struct snd_pcm_ops snd_emu10k1x_playback_ops = { 547 .open = snd_emu10k1x_playback_open, 548 .close = snd_emu10k1x_playback_close, 549 .ioctl = snd_pcm_lib_ioctl, 550 .hw_params = snd_emu10k1x_pcm_hw_params, 551 .hw_free = snd_emu10k1x_pcm_hw_free, 552 .prepare = snd_emu10k1x_pcm_prepare, 553 .trigger = snd_emu10k1x_pcm_trigger, 554 .pointer = snd_emu10k1x_pcm_pointer, 563 555 }; 564 556 565 557 /* open_capture callback */ 566 static int snd_emu10k1x_pcm_open_capture(s nd_pcm_substream_t*substream)567 { 568 emu10k1x_t*chip = snd_pcm_substream_chip(substream);569 emu10k1x_pcm_t*epcm;570 s nd_pcm_runtime_t*runtime = substream->runtime;558 static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream) 559 { 560 struct emu10k1x *chip = snd_pcm_substream_chip(substream); 561 struct emu10k1x_pcm *epcm; 562 struct snd_pcm_runtime *runtime = substream->runtime; 571 563 int err; 572 564 … … 576 568 return err; 577 569 578 epcm =kzalloc(sizeof(*epcm), GFP_KERNEL);570 epcm = (struct emu10k1x_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 579 571 if (epcm == NULL) 580 572 return -ENOMEM; … … 592 584 593 585 /* close callback */ 594 static int snd_emu10k1x_pcm_close_capture(s nd_pcm_substream_t*substream)586 static int snd_emu10k1x_pcm_close_capture(struct snd_pcm_substream *substream) 595 587 { 596 588 return 0; … … 598 590 599 591 /* hw_params callback */ 600 static int snd_emu10k1x_pcm_hw_params_capture(s nd_pcm_substream_t*substream,601 s nd_pcm_hw_params_t *hw_params)602 { 603 s nd_pcm_runtime_t*runtime = substream->runtime;604 emu10k1x_pcm_t*epcm = runtime->private_data;592 static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substream, 593 struct snd_pcm_hw_params *hw_params) 594 { 595 struct snd_pcm_runtime *runtime = substream->runtime; 596 struct emu10k1x_pcm *epcm = runtime->private_data; 605 597 606 598 if (! epcm->voice) { … … 617 609 618 610 /* hw_free callback */ 619 static int snd_emu10k1x_pcm_hw_free_capture(s nd_pcm_substream_t*substream)620 { 621 s nd_pcm_runtime_t*runtime = substream->runtime;622 623 emu10k1x_pcm_t*epcm;611 static int snd_emu10k1x_pcm_hw_free_capture(struct snd_pcm_substream *substream) 612 { 613 struct snd_pcm_runtime *runtime = substream->runtime; 614 615 struct emu10k1x_pcm *epcm; 624 616 625 617 if (runtime->private_data == NULL) … … 637 629 638 630 /* prepare capture callback */ 639 static int snd_emu10k1x_pcm_prepare_capture(s nd_pcm_substream_t*substream)640 { 641 emu10k1x_t*emu = snd_pcm_substream_chip(substream);642 s nd_pcm_runtime_t*runtime = substream->runtime;631 static int snd_emu10k1x_pcm_prepare_capture(struct snd_pcm_substream *substream) 632 { 633 struct emu10k1x *emu = snd_pcm_substream_chip(substream); 634 struct snd_pcm_runtime *runtime = substream->runtime; 643 635 644 636 snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr); … … 651 643 652 644 /* trigger_capture callback */ 653 static int snd_emu10k1x_pcm_trigger_capture(s nd_pcm_substream_t*substream,645 static int snd_emu10k1x_pcm_trigger_capture(struct snd_pcm_substream *substream, 654 646 int cmd) 655 647 { 656 emu10k1x_t*emu = snd_pcm_substream_chip(substream);657 s nd_pcm_runtime_t*runtime = substream->runtime;658 emu10k1x_pcm_t*epcm = runtime->private_data;648 struct emu10k1x *emu = snd_pcm_substream_chip(substream); 649 struct snd_pcm_runtime *runtime = substream->runtime; 650 struct emu10k1x_pcm *epcm = runtime->private_data; 659 651 int result = 0; 660 652 … … 681 673 /* pointer_capture callback */ 682 674 static snd_pcm_uframes_t 683 snd_emu10k1x_pcm_pointer_capture(s nd_pcm_substream_t*substream)684 { 685 emu10k1x_t*emu = snd_pcm_substream_chip(substream);686 s nd_pcm_runtime_t*runtime = substream->runtime;687 emu10k1x_pcm_t*epcm = runtime->private_data;675 snd_emu10k1x_pcm_pointer_capture(struct snd_pcm_substream *substream) 676 { 677 struct emu10k1x *emu = snd_pcm_substream_chip(substream); 678 struct snd_pcm_runtime *runtime = substream->runtime; 679 struct emu10k1x_pcm *epcm = runtime->private_data; 688 680 snd_pcm_uframes_t ptr; 689 681 … … 698 690 } 699 691 700 static snd_pcm_ops_t snd_emu10k1x_capture_ops = { 701 /*.open = */ snd_emu10k1x_pcm_open_capture, 702 /*.close = */ snd_emu10k1x_pcm_close_capture, 703 /*.ioctl = */ snd_pcm_lib_ioctl, 704 /*.hw_params = */ snd_emu10k1x_pcm_hw_params_capture, 705 /*.hw_free = */ snd_emu10k1x_pcm_hw_free_capture, 706 /*.prepare = */ snd_emu10k1x_pcm_prepare_capture, 707 /*.trigger = */ snd_emu10k1x_pcm_trigger_capture, 708 /*.pointer = */ snd_emu10k1x_pcm_pointer_capture, 709 0,0,0,0 692 static struct snd_pcm_ops snd_emu10k1x_capture_ops = { 693 .open = snd_emu10k1x_pcm_open_capture, 694 .close = snd_emu10k1x_pcm_close_capture, 695 .ioctl = snd_pcm_lib_ioctl, 696 .hw_params = snd_emu10k1x_pcm_hw_params_capture, 697 .hw_free = snd_emu10k1x_pcm_hw_free_capture, 698 .prepare = snd_emu10k1x_pcm_prepare_capture, 699 .trigger = snd_emu10k1x_pcm_trigger_capture, 700 .pointer = snd_emu10k1x_pcm_pointer_capture, 710 701 }; 711 702 712 static unsigned short snd_emu10k1x_ac97_read( ac97_t*ac97,703 static unsigned short snd_emu10k1x_ac97_read(struct snd_ac97 *ac97, 713 704 unsigned short reg) 714 705 { 715 emu10k1x_t*emu = ac97->private_data;706 struct emu10k1x *emu = ac97->private_data; 716 707 unsigned long flags; 717 708 unsigned short val; … … 724 715 } 725 716 726 static void snd_emu10k1x_ac97_write( ac97_t*ac97,717 static void snd_emu10k1x_ac97_write(struct snd_ac97 *ac97, 727 718 unsigned short reg, unsigned short val) 728 719 { 729 emu10k1x_t*emu = ac97->private_data;720 struct emu10k1x *emu = ac97->private_data; 730 721 unsigned long flags; 731 722 … … 736 727 } 737 728 738 static int snd_emu10k1x_ac97( emu10k1x_t*chip)739 { 740 ac97_bus_t*pbus;741 ac97_template_tac97;729 static int snd_emu10k1x_ac97(struct emu10k1x *chip) 730 { 731 struct snd_ac97_bus *pbus; 732 struct snd_ac97_template ac97; 742 733 int err; 743 static ac97_bus_ops_t ops = { 744 0, 745 /*.write = */snd_emu10k1x_ac97_write, 746 /*.read = */snd_emu10k1x_ac97_read, 0,0 734 static struct snd_ac97_bus_ops ops = { 735 .write = snd_emu10k1x_ac97_write, 736 .read = snd_emu10k1x_ac97_read, 747 737 }; 748 738 … … 757 747 } 758 748 759 static int snd_emu10k1x_free( emu10k1x_t*chip)749 static int snd_emu10k1x_free(struct emu10k1x *chip) 760 750 { 761 751 snd_emu10k1x_ptr_write(chip, TRIGGER_CHANNEL, 0, 0); … … 766 756 767 757 // release the i/o port 768 if (chip->res_port) { 769 release_resource(chip->res_port); 770 kfree_nocheck(chip->res_port); 771 } 758 release_and_free_resource(chip->res_port); 759 772 760 // release the irq 773 761 if (chip->irq >= 0) … … 786 774 } 787 775 788 static int snd_emu10k1x_dev_free(s nd_device_t*device)789 { 790 emu10k1x_t*chip = device->device_data;776 static int snd_emu10k1x_dev_free(struct snd_device *device) 777 { 778 struct emu10k1x *chip = device->device_data; 791 779 return snd_emu10k1x_free(chip); 792 780 } … … 797 785 unsigned int status; 798 786 799 emu10k1x_t*chip = dev_id;800 emu10k1x_voice_t*pvoice = chip->voices;787 struct emu10k1x *chip = dev_id; 788 struct emu10k1x_voice *pvoice = chip->voices; 801 789 int i; 802 790 int mask; … … 804 792 status = inl(chip->port + IPR); 805 793 806 if(status) { 807 // capture interrupt 808 if(status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { 809 emu10k1x_voice_t *pvoice = &chip->capture_voice; 810 if(pvoice->use) 794 if (! status) 795 return IRQ_NONE; 796 797 // capture interrupt 798 if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { 799 struct emu10k1x_voice *pvoice = &chip->capture_voice; 800 if (pvoice->use) 801 snd_emu10k1x_pcm_interrupt(chip, pvoice); 802 else 803 snd_emu10k1x_intr_disable(chip, 804 INTE_CAP_0_LOOP | 805 INTE_CAP_0_HALF_LOOP); 806 } 807 808 mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP; 809 for (i = 0; i < 3; i++) { 810 if (status & mask) { 811 if (pvoice->use) 811 812 snd_emu10k1x_pcm_interrupt(chip, pvoice); 812 else 813 snd_emu10k1x_intr_disable(chip, 814 INTE_CAP_0_LOOP | 815 INTE_CAP_0_HALF_LOOP); 813 else 814 snd_emu10k1x_intr_disable(chip, mask); 816 815 } 816 pvoice++; 817 mask <<= 1; 818 } 817 819 818 mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP; 819 for(i = 0; i < 3; i++) { 820 if(status & mask) { 821 if(pvoice->use) 822 snd_emu10k1x_pcm_interrupt(chip, pvoice); 823 else 824 snd_emu10k1x_intr_disable(chip, mask); 825 } 826 pvoice++; 827 mask <<= 1; 828 } 820 if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { 821 if (chip->midi.interrupt) 822 chip->midi.interrupt(chip, status); 823 else 824 snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); 825 } 829 826 830 if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { 831 if (chip->midi.interrupt) 832 chip->midi.interrupt(chip, status); 833 else 834 snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); 835 } 836 837 // acknowledge the interrupt if necessary 838 if(status) 839 outl(status, chip->port+IPR); 840 841 // snd_printk(KERN_INFO "interrupt %08x\n", status); 842 } 843 827 // acknowledge the interrupt if necessary 828 outl(status, chip->port + IPR); 829 830 // snd_printk(KERN_INFO "interrupt %08x\n", status); 844 831 return IRQ_HANDLED; 845 832 } 846 833 847 static void snd_emu10k1x_pcm_free(snd_pcm_t *pcm) 848 { 849 emu10k1x_t *emu = pcm->private_data; 850 emu->pcm = NULL; 851 snd_pcm_lib_preallocate_free_for_all(pcm); 852 } 853 854 static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **rpcm) 855 { 856 snd_pcm_t *pcm; 834 static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct snd_pcm **rpcm) 835 { 836 struct snd_pcm *pcm; 857 837 int err; 858 838 int capture = 0; … … 867 847 868 848 pcm->private_data = emu; 869 pcm->private_free = snd_emu10k1x_pcm_free;870 849 871 850 switch(device) { … … 905 884 } 906 885 907 static int __devinit snd_emu10k1x_create(s nd_card_t*card,886 static int __devinit snd_emu10k1x_create(struct snd_card *card, 908 887 struct pci_dev *pci, 909 emu10k1x_t**rchip)910 { 911 emu10k1x_t*chip;888 struct emu10k1x **rchip) 889 { 890 struct emu10k1x *chip; 912 891 int err; 913 892 int ch; 914 static s nd_device_ops_tops = {915 /*.dev_free = */snd_emu10k1x_dev_free,0,0,0893 static struct snd_device_ops ops = { 894 .dev_free = snd_emu10k1x_dev_free, 916 895 }; 917 896 … … 920 899 if ((err = pci_enable_device(pci)) < 0) 921 900 return err; 922 pci_set_dma_mask(pci, 0x0fffffff);923 924 chip =kzalloc(sizeof(*chip), GFP_KERNEL);901 pci_set_dma_mask(pci, 0x0fffffff); 902 903 chip = (struct emu10k1x *)kzalloc(sizeof(*chip), GFP_KERNEL); 925 904 if (chip == NULL) { 926 905 pci_disable_device(pci); … … 1021 1000 } 1022 1001 1023 static void snd_emu10k1x_proc_reg_read(s nd_info_entry_t*entry,1024 s nd_info_buffer_t *buffer)1025 { 1026 emu10k1x_t*emu = entry->private_data;1002 static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry, 1003 struct snd_info_buffer *buffer) 1004 { 1005 struct emu10k1x *emu = entry->private_data; 1027 1006 unsigned long value,value1,value2; 1028 1007 unsigned long flags; … … 1049 1028 } 1050 1029 1051 static void snd_emu10k1x_proc_reg_write(s nd_info_entry_t*entry,1052 s nd_info_buffer_t*buffer)1053 { 1054 emu10k1x_t*emu = entry->private_data;1030 static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry, 1031 struct snd_info_buffer *buffer) 1032 { 1033 struct emu10k1x *emu = entry->private_data; 1055 1034 char line[64]; 1056 1035 unsigned int reg, channel_id , val; 1057 1036 #if 0 1058 1037 while (!snd_info_get_line(buffer, line, sizeof(line))) { 1059 1038 if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3) … … 1063 1042 && (channel_id >=0) && (channel_id <= 2) ) 1064 1043 snd_emu10k1x_ptr_write(emu, reg, channel_id, val); 1065 } 1066 } 1067 1068 static int __devinit snd_emu10k1x_proc_init(emu10k1x_t * emu) 1069 { 1070 snd_info_entry_t *entry; 1044 } 1045 #endif 1046 } 1047 1048 static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu) 1049 { 1050 struct snd_info_entry *entry; 1071 1051 1072 1052 if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) { … … 1074 1054 entry->c.text.write_size = 64; 1075 1055 entry->c.text.write = snd_emu10k1x_proc_reg_write; 1056 entry->mode |= S_IWUSR; 1076 1057 entry->private_data = emu; 1077 1058 } … … 1080 1061 } 1081 1062 1082 static int snd_emu10k1x_shared_spdif_info(s nd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)1063 static int snd_emu10k1x_shared_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1083 1064 { 1084 1065 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; … … 1089 1070 } 1090 1071 1091 static int snd_emu10k1x_shared_spdif_get(s nd_kcontrol_t *kcontrol,1092 s nd_ctl_elem_value_t *ucontrol)1093 { 1094 emu10k1x_t*emu = snd_kcontrol_chip(kcontrol);1072 static int snd_emu10k1x_shared_spdif_get(struct snd_kcontrol *kcontrol, 1073 struct snd_ctl_elem_value *ucontrol) 1074 { 1075 struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); 1095 1076 1096 1077 ucontrol->value.integer.value[0] = (snd_emu10k1x_ptr_read(emu, SPDIF_SELECT, 0) == 0x700) ? 0 : 1; … … 1099 1080 } 1100 1081 1101 static int snd_emu10k1x_shared_spdif_put(s nd_kcontrol_t *kcontrol,1102 s nd_ctl_elem_value_t *ucontrol)1103 { 1104 emu10k1x_t*emu = snd_kcontrol_chip(kcontrol);1082 static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol, 1083 struct snd_ctl_elem_value *ucontrol) 1084 { 1085 struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); 1105 1086 unsigned int val; 1106 1087 int change = 0; … … 1122 1103 } 1123 1104 1124 static s nd_kcontrol_new_tsnd_emu10k1x_shared_spdif __devinitdata =1125 { 1126 /*.iface = */ SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1127 /*.name = */ "Analog/Digital Output Jack",0,0,0,1128 /*.info = */snd_emu10k1x_shared_spdif_info,1129 /*.get = */snd_emu10k1x_shared_spdif_get,1130 /*.put = */ snd_emu10k1x_shared_spdif_put,01105 static struct snd_kcontrol_new snd_emu10k1x_shared_spdif __devinitdata = 1106 { 1107 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1108 .name = "Analog/Digital Output Jack", 1109 .info = snd_emu10k1x_shared_spdif_info, 1110 .get = snd_emu10k1x_shared_spdif_get, 1111 .put = snd_emu10k1x_shared_spdif_put 1131 1112 }; 1132 1113 1133 static int snd_emu10k1x_spdif_info(s nd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)1114 static int snd_emu10k1x_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1134 1115 { 1135 1116 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; … … 1138 1119 } 1139 1120 1140 static int snd_emu10k1x_spdif_get(s nd_kcontrol_t *kcontrol,1141 s nd_ctl_elem_value_t *ucontrol)1142 { 1143 emu10k1x_t*emu = snd_kcontrol_chip(kcontrol);1121 static int snd_emu10k1x_spdif_get(struct snd_kcontrol *kcontrol, 1122 struct snd_ctl_elem_value *ucontrol) 1123 { 1124 struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); 1144 1125 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1145 1126 … … 1151 1132 } 1152 1133 1153 static int snd_emu10k1x_spdif_get_mask(s nd_kcontrol_t *kcontrol,1154 s nd_ctl_elem_value_t *ucontrol)1134 static int snd_emu10k1x_spdif_get_mask(struct snd_kcontrol *kcontrol, 1135 struct snd_ctl_elem_value *ucontrol) 1155 1136 { 1156 1137 ucontrol->value.iec958.status[0] = 0xff; … … 1161 1142 } 1162 1143 1163 static int snd_emu10k1x_spdif_put(s nd_kcontrol_t *kcontrol,1164 s nd_ctl_elem_value_t *ucontrol)1165 { 1166 emu10k1x_t*emu = snd_kcontrol_chip(kcontrol);1144 static int snd_emu10k1x_spdif_put(struct snd_kcontrol *kcontrol, 1145 struct snd_ctl_elem_value *ucontrol) 1146 { 1147 struct emu10k1x *emu = snd_kcontrol_chip(kcontrol); 1167 1148 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1168 1149 int change; … … 1181 1162 } 1182 1163 1183 static s nd_kcontrol_new_tsnd_emu10k1x_spdif_mask_control =1184 { 1185 /*.iface = */ SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1186 /*.name = */ SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),0,1187 /*.access =*/ SNDRV_CTL_ELEM_ACCESS_READ,1188 /*.count = */3,1189 /*.info = */snd_emu10k1x_spdif_info,1190 /*.get = */ snd_emu10k1x_spdif_get_mask,0,01164 static struct snd_kcontrol_new snd_emu10k1x_spdif_mask_control = 1165 { 1166 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1167 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1168 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK), 1169 .count = 3, 1170 .info = snd_emu10k1x_spdif_info, 1171 .get = snd_emu10k1x_spdif_get_mask 1191 1172 }; 1192 1173 1193 static s nd_kcontrol_new_tsnd_emu10k1x_spdif_control =1194 { 1195 /*.iface = */ SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1196 /*.name = */ SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,1197 /*.count = */3,1198 /*.info = */snd_emu10k1x_spdif_info,1199 /*.get = */snd_emu10k1x_spdif_get,1200 /*.put = */ snd_emu10k1x_spdif_put,01174 static struct snd_kcontrol_new snd_emu10k1x_spdif_control = 1175 { 1176 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1177 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1178 .count = 3, 1179 .info = snd_emu10k1x_spdif_info, 1180 .get = snd_emu10k1x_spdif_get, 1181 .put = snd_emu10k1x_spdif_put 1201 1182 }; 1202 1183 1203 static int __devinit snd_emu10k1x_mixer( emu10k1x_t*emu)1184 static int __devinit snd_emu10k1x_mixer(struct emu10k1x *emu) 1204 1185 { 1205 1186 int err; 1206 s nd_kcontrol_t*kctl;1207 s nd_card_t*card = emu->card;1187 struct snd_kcontrol *kctl; 1188 struct snd_card *card = emu->card; 1208 1189 1209 1190 if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu)) == NULL) … … 1226 1207 #define EMU10K1X_MIDI_MODE_OUTPUT (1<<1) 1227 1208 1228 static inline unsigned char mpu401_read( emu10k1x_t *emu, emu10k1x_midi_t*mpu, int idx)1209 static inline unsigned char mpu401_read(struct emu10k1x *emu, struct emu10k1x_midi *mpu, int idx) 1229 1210 { 1230 1211 return (unsigned char)snd_emu10k1x_ptr_read(emu, mpu->port + idx, 0); 1231 1212 } 1232 1213 1233 static inline void mpu401_write( emu10k1x_t *emu, emu10k1x_midi_t*mpu, int data, int idx)1214 static inline void mpu401_write(struct emu10k1x *emu, struct emu10k1x_midi *mpu, int data, int idx) 1234 1215 { 1235 1216 snd_emu10k1x_ptr_write(emu, mpu->port + idx, 0, data); … … 1248 1229 #define MPU401_ACK 0xfe 1249 1230 1250 static void mpu401_clear_rx( emu10k1x_t *emu, emu10k1x_midi_t*mpu)1231 static void mpu401_clear_rx(struct emu10k1x *emu, struct emu10k1x_midi *mpu) 1251 1232 { 1252 1233 int timeout = 100000; … … 1263 1244 */ 1264 1245 1265 static void do_emu10k1x_midi_interrupt(emu10k1x_t *emu, emu10k1x_midi_t *midi, unsigned int status) 1246 static void do_emu10k1x_midi_interrupt(struct emu10k1x *emu, 1247 struct emu10k1x_midi *midi, unsigned int status) 1266 1248 { 1267 1249 unsigned char byte; … … 1296 1278 } 1297 1279 1298 static void snd_emu10k1x_midi_interrupt( emu10k1x_t*emu, unsigned int status)1280 static void snd_emu10k1x_midi_interrupt(struct emu10k1x *emu, unsigned int status) 1299 1281 { 1300 1282 do_emu10k1x_midi_interrupt(emu, &emu->midi, status); 1301 1283 } 1302 1284 1303 static void snd_emu10k1x_midi_cmd(emu10k1x_t * emu, emu10k1x_midi_t *midi, unsigned char cmd, int ack) 1285 static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu, 1286 struct emu10k1x_midi *midi, unsigned char cmd, int ack) 1304 1287 { 1305 1288 unsigned long flags; … … 1333 1316 } 1334 1317 1335 static int snd_emu10k1x_midi_input_open(s nd_rawmidi_substream_t *substream)1336 { 1337 emu10k1x_t*emu;1338 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;1318 static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream) 1319 { 1320 struct emu10k1x *emu; 1321 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1339 1322 unsigned long flags; 1340 1323 … … 1354 1337 } 1355 1338 1356 static int snd_emu10k1x_midi_output_open(s nd_rawmidi_substream_t *substream)1357 { 1358 emu10k1x_t*emu;1359 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;1339 static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream) 1340 { 1341 struct emu10k1x *emu; 1342 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1360 1343 unsigned long flags; 1361 1344 … … 1375 1358 } 1376 1359 1377 static int snd_emu10k1x_midi_input_close(s nd_rawmidi_substream_t *substream)1378 { 1379 emu10k1x_t*emu;1380 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;1360 static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream) 1361 { 1362 struct emu10k1x *emu; 1363 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1381 1364 unsigned long flags; 1382 1365 … … 1396 1379 } 1397 1380 1398 static int snd_emu10k1x_midi_output_close(s nd_rawmidi_substream_t *substream)1399 { 1400 emu10k1x_t*emu;1401 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;1381 static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream) 1382 { 1383 struct emu10k1x *emu; 1384 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1402 1385 unsigned long flags; 1403 1386 … … 1417 1400 } 1418 1401 1419 static void snd_emu10k1x_midi_input_trigger(s nd_rawmidi_substream_t *substream, int up)1420 { 1421 emu10k1x_t*emu;1422 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;1402 static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) 1403 { 1404 struct emu10k1x *emu; 1405 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1423 1406 emu = midi->emu; 1424 1407 snd_assert(emu, return); … … 1430 1413 } 1431 1414 1432 static void snd_emu10k1x_midi_output_trigger(s nd_rawmidi_substream_t *substream, int up)1433 { 1434 emu10k1x_t*emu;1435 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;1415 static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) 1416 { 1417 struct emu10k1x *emu; 1418 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1436 1419 unsigned long flags; 1437 1420 … … 1470 1453 */ 1471 1454 1472 static s nd_rawmidi_ops_tsnd_emu10k1x_midi_output =1473 { 1474 snd_emu10k1x_midi_output_open,1475 snd_emu10k1x_midi_output_close,1476 snd_emu10k1x_midi_output_trigger,01455 static struct snd_rawmidi_ops snd_emu10k1x_midi_output = 1456 { 1457 .open = snd_emu10k1x_midi_output_open, 1458 .close = snd_emu10k1x_midi_output_close, 1459 .trigger = snd_emu10k1x_midi_output_trigger, 1477 1460 }; 1478 1461 1479 static s nd_rawmidi_ops_tsnd_emu10k1x_midi_input =1480 { 1481 snd_emu10k1x_midi_input_open,1482 snd_emu10k1x_midi_input_close,1483 snd_emu10k1x_midi_input_trigger,01462 static struct snd_rawmidi_ops snd_emu10k1x_midi_input = 1463 { 1464 .open = snd_emu10k1x_midi_input_open, 1465 .close = snd_emu10k1x_midi_input_close, 1466 .trigger = snd_emu10k1x_midi_input_trigger, 1484 1467 }; 1485 1468 1486 static void snd_emu10k1x_midi_free(s nd_rawmidi_t*rmidi)1487 { 1488 emu10k1x_midi_t *midi = (emu10k1x_midi_t *)rmidi->private_data;1469 static void snd_emu10k1x_midi_free(struct snd_rawmidi *rmidi) 1470 { 1471 struct emu10k1x_midi *midi = rmidi->private_data; 1489 1472 midi->interrupt = NULL; 1490 1473 midi->rmidi = NULL; 1491 1474 } 1492 1475 1493 static int __devinit emu10k1x_midi_init(emu10k1x_t *emu, emu10k1x_midi_t *midi, int device, char *name) 1494 { 1495 snd_rawmidi_t *rmidi; 1476 static int __devinit emu10k1x_midi_init(struct emu10k1x *emu, 1477 struct emu10k1x_midi *midi, int device, char *name) 1478 { 1479 struct snd_rawmidi *rmidi; 1496 1480 int err; 1497 1481 … … 1514 1498 } 1515 1499 1516 static int __devinit snd_emu10k1x_midi( emu10k1x_t*emu)1517 { 1518 emu10k1x_midi_t*midi = &emu->midi;1500 static int __devinit snd_emu10k1x_midi(struct emu10k1x *emu) 1501 { 1502 struct emu10k1x_midi *midi = &emu->midi; 1519 1503 int err; 1520 1504 … … 1535 1519 { 1536 1520 static int dev; 1537 s nd_card_t*card;1538 emu10k1x_t*chip;1521 struct snd_card *card; 1522 struct emu10k1x *chip; 1539 1523 int err; 1540 1524 … … 1615 1599 // pci_driver definition 1616 1600 static struct pci_driver driver = { 1617 0,0,0, 1618 /*.name = */"EMU10K1X", 1619 /*.id_table = */snd_emu10k1x_ids, 1620 /*.probe = */snd_emu10k1x_probe, 1621 /*.remove = */snd_emu10k1x_remove, 1622 0,0 1601 .name = "EMU10K1X", 1602 .id_table = snd_emu10k1x_ids, 1603 .probe = snd_emu10k1x_probe, 1604 .remove = snd_emu10k1x_remove, 1623 1605 }; 1624 1606 … … 1628 1610 int err; 1629 1611 1630 if ((err = pci_ module_init(&driver)) > 0)1612 if ((err = pci_register_driver(&driver)) > 0) 1631 1613 return err; 1632 1614 -
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; -
GPL/trunk/alsa-kernel/pci/emu10k1/emumixer.c
r33 r34 46 46 snd_ctl_elem_value_t * ucontrol) 47 47 { 48 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);48 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 49 49 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 50 50 unsigned long flags; … … 85 85 snd_ctl_elem_value_t * ucontrol) 86 86 { 87 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);87 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 88 88 unsigned int tmp; 89 89 unsigned long flags; … … 112 112 snd_ctl_elem_value_t * ucontrol) 113 113 { 114 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);114 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 115 115 int change; 116 116 unsigned int reg, val, tmp; … … 157 157 snd_ctl_elem_value_t * ucontrol) 158 158 { 159 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);159 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 160 160 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 161 161 int change; … … 195 195 }; 196 196 197 static void update_emu10k1_fxrt( emu10k1_t*emu, int voice, unsigned char *route)197 static void update_emu10k1_fxrt(struct snd_emu10k1 *emu, int voice, unsigned char *route) 198 198 { 199 199 if (emu->audigy) { … … 208 208 } 209 209 210 static void update_emu10k1_send_volume( emu10k1_t*emu, int voice, unsigned char *volume)210 static void update_emu10k1_send_volume(struct snd_emu10k1 *emu, int voice, unsigned char *volume) 211 211 { 212 212 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_A, voice, volume[0]); … … 227 227 static int snd_emu10k1_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 228 228 { 229 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);229 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 230 230 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 231 231 uinfo->count = emu->audigy ? 3*8 : 3*4; … … 239 239 { 240 240 unsigned long flags; 241 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);242 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];241 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 242 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 243 243 int voice, idx; 244 244 int num_efx = emu->audigy ? 8 : 4; … … 258 258 { 259 259 unsigned long flags; 260 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);261 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];260 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 261 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 262 262 int change = 0, voice, idx, val; 263 263 int num_efx = emu->audigy ? 8 : 4; … … 300 300 static int snd_emu10k1_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 301 301 { 302 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);302 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 303 303 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 304 304 uinfo->count = emu->audigy ? 3*8 : 3*4; … … 312 312 { 313 313 unsigned long flags; 314 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);315 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];314 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 315 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 316 316 int idx; 317 317 int num_efx = emu->audigy ? 8 : 4; … … 328 328 { 329 329 unsigned long flags; 330 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);331 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];330 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 331 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 332 332 int change = 0, idx, val; 333 333 int num_efx = emu->audigy ? 8 : 4; … … 378 378 snd_ctl_elem_value_t * ucontrol) 379 379 { 380 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);381 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];380 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 381 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 382 382 unsigned long flags; 383 383 int idx; … … 394 394 { 395 395 unsigned long flags; 396 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);397 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];396 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 397 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 398 398 int change = 0, idx, val; 399 399 … … 432 432 static int snd_emu10k1_efx_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 433 433 { 434 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);434 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 435 435 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 436 436 uinfo->count = emu->audigy ? 8 : 4; … … 444 444 { 445 445 unsigned long flags; 446 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);447 emu10k1_pcm_mixer_t*mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];446 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 447 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 448 448 int idx; 449 449 int num_efx = emu->audigy ? 8 : 4; … … 462 462 { 463 463 unsigned long flags; 464 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);464 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 465 465 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 466 emu10k1_pcm_mixer_t*mix = &emu->efx_pcm_mixer[ch];466 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; 467 467 int change = 0, idx, val; 468 468 int num_efx = emu->audigy ? 8 : 4; … … 500 500 static int snd_emu10k1_efx_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 501 501 { 502 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);502 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 503 503 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 504 504 uinfo->count = emu->audigy ? 8 : 4; … … 512 512 { 513 513 unsigned long flags; 514 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);515 emu10k1_pcm_mixer_t*mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];514 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 515 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 516 516 int idx; 517 517 int num_efx = emu->audigy ? 8 : 4; … … 528 528 { 529 529 unsigned long flags; 530 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);530 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 531 531 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 532 emu10k1_pcm_mixer_t*mix = &emu->efx_pcm_mixer[ch];532 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; 533 533 int change = 0, idx, val; 534 534 int num_efx = emu->audigy ? 8 : 4; … … 576 576 snd_ctl_elem_value_t * ucontrol) 577 577 { 578 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);579 emu10k1_pcm_mixer_t*mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];578 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 579 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 580 580 unsigned long flags; 581 581 … … 590 590 { 591 591 unsigned long flags; 592 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);592 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 593 593 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 594 emu10k1_pcm_mixer_t*mix = &emu->efx_pcm_mixer[ch];594 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; 595 595 int change = 0, val; 596 596 … … 633 633 snd_ctl_elem_value_t * ucontrol) 634 634 { 635 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);635 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 636 636 637 637 if (emu->audigy) … … 646 646 { 647 647 unsigned long flags; 648 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);648 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 649 649 unsigned int reg, val; 650 650 int change = 0; … … 695 695 static void snd_emu10k1_mixer_free_ac97(ac97_t *ac97) 696 696 { 697 emu10k1_t*emu = ac97->private_data;697 struct snd_emu10k1 *emu = ac97->private_data; 698 698 emu->ac97 = NULL; 699 699 } … … 729 729 } 730 730 731 int __devinit snd_emu10k1_mixer( emu10k1_t*emu,731 int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, 732 732 int pcm_device, int multi_device) 733 733 { … … 881 881 /* initialize the routing and volume table for each pcm playback stream */ 882 882 for (pcm = 0; pcm < 32; pcm++) { 883 emu10k1_pcm_mixer_t*mix;883 struct snd_emu10k1_pcm_mixer *mix; 884 884 int v; 885 885 … … 901 901 /* initialize the routing and volume table for the multichannel playback stream */ 902 902 for (pcm = 0; pcm < NUM_EFX_PLAYBACK; pcm++) { 903 emu10k1_pcm_mixer_t*mix;903 struct snd_emu10k1_pcm_mixer *mix; 904 904 int v; 905 905 -
GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c
r33 r34 29 29 #define EMU10K1_MIDI_MODE_OUTPUT (1<<1) 30 30 31 static inline unsigned char mpu401_read( emu10k1_t *emu, emu10k1_midi_t*mpu, int idx)31 static inline unsigned char mpu401_read(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *mpu, int idx) 32 32 { 33 33 if (emu->audigy) … … 37 37 } 38 38 39 static inline void mpu401_write( emu10k1_t *emu, emu10k1_midi_t*mpu, int data, int idx)39 static inline void mpu401_write(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *mpu, int data, int idx) 40 40 { 41 41 if (emu->audigy) … … 57 57 #define MPU401_ACK 0xfe 58 58 59 static void mpu401_clear_rx( emu10k1_t *emu, emu10k1_midi_t*mpu)59 static void mpu401_clear_rx(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *mpu) 60 60 { 61 61 int timeout = 100000; … … 72 72 */ 73 73 74 static void do_emu10k1_midi_interrupt( emu10k1_t *emu, emu10k1_midi_t*midi, unsigned int status)74 static void do_emu10k1_midi_interrupt(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *midi, unsigned int status) 75 75 { 76 76 unsigned char byte; … … 107 107 } 108 108 109 static void snd_emu10k1_midi_interrupt( emu10k1_t*emu, unsigned int status)109 static void snd_emu10k1_midi_interrupt(struct snd_emu10k1 *emu, unsigned int status) 110 110 { 111 111 do_emu10k1_midi_interrupt(emu, &emu->midi, status); 112 112 } 113 113 114 static void snd_emu10k1_midi_interrupt2( emu10k1_t*emu, unsigned int status)114 static void snd_emu10k1_midi_interrupt2(struct snd_emu10k1 *emu, unsigned int status) 115 115 { 116 116 do_emu10k1_midi_interrupt(emu, &emu->midi2, status); 117 117 } 118 118 119 static void snd_emu10k1_midi_cmd( emu10k1_t * emu, emu10k1_midi_t*midi, unsigned char cmd, int ack)119 static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack) 120 120 { 121 121 unsigned long flags; … … 151 151 static int snd_emu10k1_midi_input_open(snd_rawmidi_substream_t * substream) 152 152 { 153 emu10k1_t*emu;154 emu10k1_midi_t *midi = (emu10k1_midi_t*)substream->rmidi->private_data;153 struct snd_emu10k1 *emu; 154 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 155 155 unsigned long flags; 156 156 … … 172 172 static int snd_emu10k1_midi_output_open(snd_rawmidi_substream_t * substream) 173 173 { 174 emu10k1_t*emu;175 emu10k1_midi_t *midi = (emu10k1_midi_t*)substream->rmidi->private_data;174 struct snd_emu10k1 *emu; 175 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 176 176 unsigned long flags; 177 177 … … 193 193 static int snd_emu10k1_midi_input_close(snd_rawmidi_substream_t * substream) 194 194 { 195 emu10k1_t*emu;196 emu10k1_midi_t *midi = (emu10k1_midi_t*)substream->rmidi->private_data;195 struct snd_emu10k1 *emu; 196 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 197 197 unsigned long flags; 198 198 … … 214 214 static int snd_emu10k1_midi_output_close(snd_rawmidi_substream_t * substream) 215 215 { 216 emu10k1_t*emu;217 emu10k1_midi_t *midi = (emu10k1_midi_t*)substream->rmidi->private_data;216 struct snd_emu10k1 *emu; 217 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 218 218 unsigned long flags; 219 219 … … 235 235 static void snd_emu10k1_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) 236 236 { 237 emu10k1_t*emu;238 emu10k1_midi_t *midi = (emu10k1_midi_t*)substream->rmidi->private_data;237 struct snd_emu10k1 *emu; 238 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 239 239 emu = midi->emu; 240 240 snd_assert(emu, return); … … 248 248 static void snd_emu10k1_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) 249 249 { 250 emu10k1_t*emu;251 emu10k1_midi_t *midi = (emu10k1_midi_t*)substream->rmidi->private_data;250 struct snd_emu10k1 *emu; 251 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 252 252 unsigned long flags; 253 253 … … 318 318 static void snd_emu10k1_midi_free(snd_rawmidi_t *rmidi) 319 319 { 320 emu10k1_midi_t *midi = (emu10k1_midi_t*)rmidi->private_data;320 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)rmidi->private_data; 321 321 midi->interrupt = NULL; 322 322 midi->rmidi = NULL; 323 323 } 324 324 325 static int __devinit emu10k1_midi_init( emu10k1_t *emu, emu10k1_midi_t*midi, int device, char *name)325 static int __devinit emu10k1_midi_init(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *midi, int device, char *name) 326 326 { 327 327 snd_rawmidi_t *rmidi; … … 346 346 } 347 347 348 int __devinit snd_emu10k1_midi( emu10k1_t*emu)349 { 350 emu10k1_midi_t*midi = &emu->midi;348 int __devinit snd_emu10k1_midi(struct snd_emu10k1 *emu) 349 { 350 struct snd_emu10k1_midi *midi = &emu->midi; 351 351 int err; 352 352 … … 363 363 } 364 364 365 int __devinit snd_emu10k1_audigy_midi( emu10k1_t*emu)366 { 367 emu10k1_midi_t*midi;365 int __devinit snd_emu10k1_audigy_midi(struct snd_emu10k1 *emu) 366 { 367 struct snd_emu10k1_midi *midi; 368 368 int err; 369 369 -
GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c
r33 r34 43 43 } 44 44 45 static void snd_emu10k1_pcm_interrupt( emu10k1_t *emu, emu10k1_voice_t*voice)46 { 47 emu10k1_pcm_t*epcm;45 static void snd_emu10k1_pcm_interrupt(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *voice) 46 { 47 struct snd_emu10k1_pcm *epcm; 48 48 49 49 if ((epcm = voice->epcm) == NULL) … … 60 60 } 61 61 62 static void snd_emu10k1_pcm_ac97adc_interrupt( emu10k1_t*emu, unsigned int status)62 static void snd_emu10k1_pcm_ac97adc_interrupt(struct snd_emu10k1 *emu, unsigned int status) 63 63 { 64 64 #if 0 … … 71 71 } 72 72 73 static void snd_emu10k1_pcm_ac97mic_interrupt( emu10k1_t*emu, unsigned int status)73 static void snd_emu10k1_pcm_ac97mic_interrupt(struct snd_emu10k1 *emu, unsigned int status) 74 74 { 75 75 #if 0 … … 82 82 } 83 83 84 static void snd_emu10k1_pcm_efx_interrupt( emu10k1_t*emu, unsigned int status)84 static void snd_emu10k1_pcm_efx_interrupt(struct snd_emu10k1 *emu, unsigned int status) 85 85 { 86 86 #if 0 … … 95 95 static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(snd_pcm_substream_t * substream) 96 96 { 97 emu10k1_t*emu = snd_pcm_substream_chip(substream);98 snd_pcm_runtime_t *runtime = substream->runtime; 99 emu10k1_pcm_t*epcm = runtime->private_data;97 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 98 snd_pcm_runtime_t *runtime = substream->runtime; 99 struct snd_emu10k1_pcm *epcm = runtime->private_data; 100 100 unsigned int ptr; 101 101 … … 110 110 } 111 111 112 static int snd_emu10k1_pcm_channel_alloc( emu10k1_pcm_t* epcm, int voices)112 static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voices) 113 113 { 114 114 int err, i; … … 277 277 } 278 278 279 static void snd_emu10k1_pcm_init_voice( emu10k1_t*emu,279 static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu, 280 280 int master, int extra, 281 emu10k1_voice_t*evoice,281 struct snd_emu10k1_voice *evoice, 282 282 unsigned int start_addr, 283 283 unsigned int end_addr, 284 emu10k1_pcm_mixer_t*mix)284 struct snd_emu10k1_pcm_mixer *mix) 285 285 { 286 286 snd_pcm_substream_t *substream = evoice->epcm->substream; … … 401 401 snd_pcm_hw_params_t * hw_params) 402 402 { 403 emu10k1_t*emu = snd_pcm_substream_chip(substream);404 snd_pcm_runtime_t *runtime = substream->runtime; 405 emu10k1_pcm_t*epcm = runtime->private_data;403 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 404 snd_pcm_runtime_t *runtime = substream->runtime; 405 struct snd_emu10k1_pcm *epcm = runtime->private_data; 406 406 int err; 407 407 … … 415 415 snd_emu10k1_free_pages(emu, epcm->memblk); 416 416 memblk = snd_emu10k1_alloc_pages(emu, substream); 417 if ((epcm->memblk = memblk) == NULL || (( emu10k1_memblk_t*)memblk)->mapped_page < 0) {417 if ((epcm->memblk = memblk) == NULL || ((struct snd_emu10k1_memblk *)memblk)->mapped_page < 0) { 418 418 epcm->start_addr = 0; 419 419 return -ENOMEM; 420 420 } 421 epcm->start_addr = (( emu10k1_memblk_t*)memblk)->mapped_page << PAGE_SHIFT;421 epcm->start_addr = ((struct snd_emu10k1_memblk *)memblk)->mapped_page << PAGE_SHIFT; 422 422 } 423 423 return 0; … … 426 426 static int snd_emu10k1_playback_hw_free(snd_pcm_substream_t * substream) 427 427 { 428 emu10k1_t*emu = snd_pcm_substream_chip(substream);429 snd_pcm_runtime_t *runtime = substream->runtime; 430 emu10k1_pcm_t*epcm;428 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 429 snd_pcm_runtime_t *runtime = substream->runtime; 430 struct snd_emu10k1_pcm *epcm; 431 431 432 432 if (runtime->private_data == NULL) … … 456 456 static int snd_emu10k1_efx_playback_hw_free(snd_pcm_substream_t * substream) 457 457 { 458 emu10k1_t*emu = snd_pcm_substream_chip(substream);459 snd_pcm_runtime_t *runtime = substream->runtime; 460 emu10k1_pcm_t*epcm;458 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 459 snd_pcm_runtime_t *runtime = substream->runtime; 460 struct snd_emu10k1_pcm *epcm; 461 461 int i; 462 462 … … 485 485 static int snd_emu10k1_playback_prepare(snd_pcm_substream_t * substream) 486 486 { 487 emu10k1_t*emu = snd_pcm_substream_chip(substream);488 snd_pcm_runtime_t *runtime = substream->runtime; 489 emu10k1_pcm_t*epcm = runtime->private_data;487 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 488 snd_pcm_runtime_t *runtime = substream->runtime; 489 struct snd_emu10k1_pcm *epcm = runtime->private_data; 490 490 unsigned int start_addr, end_addr; 491 491 … … 513 513 static int snd_emu10k1_efx_playback_prepare(snd_pcm_substream_t * substream) 514 514 { 515 emu10k1_t*emu = snd_pcm_substream_chip(substream);516 snd_pcm_runtime_t *runtime = substream->runtime; 517 emu10k1_pcm_t*epcm = runtime->private_data;515 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 516 snd_pcm_runtime_t *runtime = substream->runtime; 517 struct snd_emu10k1_pcm *epcm = runtime->private_data; 518 518 unsigned int start_addr, end_addr; 519 519 unsigned int channel_size; … … 579 579 static int snd_emu10k1_capture_prepare(snd_pcm_substream_t * substream) 580 580 { 581 emu10k1_t*emu = snd_pcm_substream_chip(substream);582 snd_pcm_runtime_t *runtime = substream->runtime; 583 emu10k1_pcm_t*epcm = runtime->private_data;581 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 582 snd_pcm_runtime_t *runtime = substream->runtime; 583 struct snd_emu10k1_pcm *epcm = runtime->private_data; 584 584 int idx; 585 585 … … 624 624 } 625 625 626 static void snd_emu10k1_playback_invalidate_cache( emu10k1_t *emu, int extra, emu10k1_voice_t*evoice)626 static void snd_emu10k1_playback_invalidate_cache(struct snd_emu10k1 *emu, int extra, struct snd_emu10k1_voice *evoice) 627 627 { 628 628 snd_pcm_runtime_t *runtime; … … 659 659 } 660 660 661 static void snd_emu10k1_playback_prepare_voice( emu10k1_t *emu, emu10k1_voice_t*evoice,661 static void snd_emu10k1_playback_prepare_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice, 662 662 int master, int extra, 663 emu10k1_pcm_mixer_t*mix)663 struct snd_emu10k1_pcm_mixer *mix) 664 664 { 665 665 snd_pcm_substream_t *substream; … … 683 683 } 684 684 685 static void snd_emu10k1_playback_trigger_voice( emu10k1_t *emu, emu10k1_voice_t*evoice, int master, int extra)685 static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice, int master, int extra) 686 686 { 687 687 snd_pcm_substream_t *substream; … … 705 705 } 706 706 707 static void snd_emu10k1_playback_stop_voice( emu10k1_t *emu, emu10k1_voice_t*evoice)707 static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice) 708 708 { 709 709 unsigned int voice; … … 724 724 int cmd) 725 725 { 726 emu10k1_t*emu = snd_pcm_substream_chip(substream);727 snd_pcm_runtime_t *runtime = substream->runtime; 728 emu10k1_pcm_t*epcm = runtime->private_data;729 emu10k1_pcm_mixer_t*mix;726 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 727 snd_pcm_runtime_t *runtime = substream->runtime; 728 struct snd_emu10k1_pcm *epcm = runtime->private_data; 729 struct snd_emu10k1_pcm_mixer *mix; 730 730 int result = 0; 731 731 … … 765 765 int cmd) 766 766 { 767 emu10k1_t*emu = snd_pcm_substream_chip(substream);768 snd_pcm_runtime_t *runtime = substream->runtime; 769 emu10k1_pcm_t*epcm = runtime->private_data;767 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 768 snd_pcm_runtime_t *runtime = substream->runtime; 769 struct snd_emu10k1_pcm *epcm = runtime->private_data; 770 770 int result = 0; 771 771 … … 824 824 static snd_pcm_uframes_t snd_emu10k1_playback_pointer(snd_pcm_substream_t * substream) 825 825 { 826 emu10k1_t*emu = snd_pcm_substream_chip(substream);827 snd_pcm_runtime_t *runtime = substream->runtime; 828 emu10k1_pcm_t*epcm = runtime->private_data;826 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 827 snd_pcm_runtime_t *runtime = substream->runtime; 828 struct snd_emu10k1_pcm *epcm = runtime->private_data; 829 829 unsigned int ptr; 830 830 … … 852 852 int cmd) 853 853 { 854 emu10k1_t*emu = snd_pcm_substream_chip(substream);855 snd_pcm_runtime_t *runtime = substream->runtime; 856 emu10k1_pcm_t*epcm = runtime->private_data;854 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 855 snd_pcm_runtime_t *runtime = substream->runtime; 856 struct snd_emu10k1_pcm *epcm = runtime->private_data; 857 857 int i; 858 858 int result = 0; … … 899 899 static snd_pcm_uframes_t snd_emu10k1_capture_pointer(snd_pcm_substream_t * substream) 900 900 { 901 emu10k1_t*emu = snd_pcm_substream_chip(substream);902 snd_pcm_runtime_t *runtime = substream->runtime; 903 emu10k1_pcm_t*epcm = runtime->private_data;901 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 902 snd_pcm_runtime_t *runtime = substream->runtime; 903 struct snd_emu10k1_pcm *epcm = runtime->private_data; 904 904 unsigned int ptr; 905 905 … … 924 924 case SNDRV_PCM_IOCTL1_SETVOLUME: 925 925 { 926 emu10k1_pcm_mixer_t*mix;926 struct snd_emu10k1_pcm_mixer *mix; 927 927 snd_pcm_volume_t *volume = (snd_pcm_volume_t *)arg; 928 emu10k1_t*emu = snd_pcm_substream_chip(substream);928 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 929 929 snd_ctl_elem_value_t *ucontrol; 930 930 snd_ctl_elem_info_t *uinfo; … … 959 959 case SNDRV_PCM_IOCTL1_GETVOLUME: 960 960 { 961 emu10k1_pcm_mixer_t*mix;961 struct snd_emu10k1_pcm_mixer *mix; 962 962 snd_pcm_volume_t *volume = (snd_pcm_volume_t *)arg; 963 emu10k1_t*emu = snd_pcm_substream_chip(substream);963 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 964 964 int range; 965 965 snd_ctl_elem_value_t *ucontrol; … … 1053 1053 */ 1054 1054 1055 static void snd_emu10k1_pcm_mixer_notify1( emu10k1_t*emu, snd_kcontrol_t *kctl, int idx, int activate)1055 static void snd_emu10k1_pcm_mixer_notify1(struct snd_emu10k1 *emu, snd_kcontrol_t *kctl, int idx, int activate) 1056 1056 { 1057 1057 snd_ctl_elem_id_t id; … … 1068 1068 } 1069 1069 1070 static void snd_emu10k1_pcm_mixer_notify( emu10k1_t*emu, int idx, int activate)1070 static void snd_emu10k1_pcm_mixer_notify(struct snd_emu10k1 *emu, int idx, int activate) 1071 1071 { 1072 1072 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_send_routing, idx, activate); … … 1075 1075 } 1076 1076 1077 static void snd_emu10k1_pcm_efx_mixer_notify( emu10k1_t*emu, int idx, int activate)1077 static void snd_emu10k1_pcm_efx_mixer_notify(struct snd_emu10k1 *emu, int idx, int activate) 1078 1078 { 1079 1079 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_send_routing, idx, activate); … … 1084 1084 static void snd_emu10k1_pcm_free_substream(snd_pcm_runtime_t *runtime) 1085 1085 { 1086 emu10k1_pcm_t*epcm = runtime->private_data;1086 struct snd_emu10k1_pcm *epcm = runtime->private_data; 1087 1087 if (epcm) 1088 1088 kfree(epcm); … … 1091 1091 static int snd_emu10k1_efx_playback_close(snd_pcm_substream_t * substream) 1092 1092 { 1093 emu10k1_t*emu = snd_pcm_substream_chip(substream);1094 emu10k1_pcm_mixer_t*mix;1093 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1094 struct snd_emu10k1_pcm_mixer *mix; 1095 1095 int i; 1096 1096 … … 1105 1105 static int snd_emu10k1_efx_playback_open(snd_pcm_substream_t * substream) 1106 1106 { 1107 emu10k1_t*emu = snd_pcm_substream_chip(substream);1108 emu10k1_pcm_t*epcm;1109 emu10k1_pcm_mixer_t*mix;1107 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1108 struct snd_emu10k1_pcm *epcm; 1109 struct snd_emu10k1_pcm_mixer *mix; 1110 1110 snd_pcm_runtime_t *runtime = substream->runtime; 1111 1111 int i; 1112 1112 1113 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);1113 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 1114 1114 if (epcm == NULL) 1115 1115 return -ENOMEM; … … 1138 1138 static int snd_emu10k1_playback_open(snd_pcm_substream_t * substream) 1139 1139 { 1140 emu10k1_t*emu = snd_pcm_substream_chip(substream);1141 emu10k1_pcm_t*epcm;1142 emu10k1_pcm_mixer_t*mix;1140 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1141 struct snd_emu10k1_pcm *epcm; 1142 struct snd_emu10k1_pcm_mixer *mix; 1143 1143 snd_pcm_runtime_t *runtime = substream->runtime; 1144 1144 int i, err; 1145 1145 1146 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);1146 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 1147 1147 if (epcm == NULL) 1148 1148 return -ENOMEM; … … 1175 1175 static int snd_emu10k1_playback_close(snd_pcm_substream_t * substream) 1176 1176 { 1177 emu10k1_t*emu = snd_pcm_substream_chip(substream);1178 emu10k1_pcm_mixer_t*mix = &emu->pcm_mixer[substream->number];1177 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1178 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[substream->number]; 1179 1179 1180 1180 mix->epcm = NULL; … … 1185 1185 static int snd_emu10k1_capture_open(snd_pcm_substream_t * substream) 1186 1186 { 1187 emu10k1_t*emu = snd_pcm_substream_chip(substream);1188 snd_pcm_runtime_t *runtime = substream->runtime; 1189 emu10k1_pcm_t*epcm;1190 1191 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);1187 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1188 snd_pcm_runtime_t *runtime = substream->runtime; 1189 struct snd_emu10k1_pcm *epcm; 1190 1191 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 1192 1192 if (epcm == NULL) 1193 1193 return -ENOMEM; … … 1212 1212 static int snd_emu10k1_capture_close(snd_pcm_substream_t * substream) 1213 1213 { 1214 emu10k1_t*emu = snd_pcm_substream_chip(substream);1214 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1215 1215 1216 1216 emu->capture_interrupt = NULL; … … 1221 1221 static int snd_emu10k1_capture_mic_open(snd_pcm_substream_t * substream) 1222 1222 { 1223 emu10k1_t*emu = snd_pcm_substream_chip(substream);1224 emu10k1_pcm_t*epcm;1225 snd_pcm_runtime_t *runtime = substream->runtime; 1226 1227 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);1223 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1224 struct snd_emu10k1_pcm *epcm; 1225 snd_pcm_runtime_t *runtime = substream->runtime; 1226 1227 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 1228 1228 if (epcm == NULL) 1229 1229 return -ENOMEM; … … 1250 1250 static int snd_emu10k1_capture_mic_close(snd_pcm_substream_t * substream) 1251 1251 { 1252 emu10k1_t*emu = snd_pcm_substream_chip(substream);1252 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1253 1253 1254 1254 emu->capture_interrupt = NULL; … … 1259 1259 static int snd_emu10k1_capture_efx_open(snd_pcm_substream_t * substream) 1260 1260 { 1261 emu10k1_t*emu = snd_pcm_substream_chip(substream);1262 emu10k1_pcm_t*epcm;1261 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1262 struct snd_emu10k1_pcm *epcm; 1263 1263 snd_pcm_runtime_t *runtime = substream->runtime; 1264 1264 int nefx = emu->audigy ? 64 : 32; 1265 1265 int idx; 1266 1266 1267 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);1267 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 1268 1268 if (epcm == NULL) 1269 1269 return -ENOMEM; … … 1300 1300 static int snd_emu10k1_capture_efx_close(snd_pcm_substream_t * substream) 1301 1301 { 1302 emu10k1_t*emu = snd_pcm_substream_chip(substream);1302 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1303 1303 1304 1304 emu->capture_interrupt = NULL; … … 1347 1347 static void snd_emu10k1_pcm_free(snd_pcm_t *pcm) 1348 1348 { 1349 emu10k1_t*emu = pcm->private_data;1349 struct snd_emu10k1 *emu = pcm->private_data; 1350 1350 emu->pcm = NULL; 1351 1351 snd_pcm_lib_preallocate_free_for_all(pcm); 1352 1352 } 1353 1353 1354 int __devinit snd_emu10k1_pcm( emu10k1_t* emu, int device, snd_pcm_t ** rpcm)1354 int __devinit snd_emu10k1_pcm(struct snd_emu10k1 * emu, int device, snd_pcm_t ** rpcm) 1355 1355 { 1356 1356 snd_pcm_t *pcm; … … 1388 1388 } 1389 1389 1390 int __devinit snd_emu10k1_pcm_multi( emu10k1_t* emu, int device, snd_pcm_t ** rpcm)1390 int __devinit snd_emu10k1_pcm_multi(struct snd_emu10k1 * emu, int device, snd_pcm_t ** rpcm) 1391 1391 { 1392 1392 snd_pcm_t *pcm; … … 1433 1433 static void snd_emu10k1_pcm_mic_free(snd_pcm_t *pcm) 1434 1434 { 1435 emu10k1_t*emu = pcm->private_data;1435 struct snd_emu10k1 *emu = pcm->private_data; 1436 1436 emu->pcm_mic = NULL; 1437 1437 snd_pcm_lib_preallocate_free_for_all(pcm); 1438 1438 } 1439 1439 1440 int __devinit snd_emu10k1_pcm_mic( emu10k1_t* emu, int device, snd_pcm_t ** rpcm)1440 int __devinit snd_emu10k1_pcm_mic(struct snd_emu10k1 * emu, int device, snd_pcm_t ** rpcm) 1441 1441 { 1442 1442 snd_pcm_t *pcm; … … 1468 1468 static int snd_emu10k1_pcm_efx_voices_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1469 1469 { 1470 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);1470 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1471 1471 int nefx = emu->audigy ? 64 : 32; 1472 1472 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; … … 1479 1479 static int snd_emu10k1_pcm_efx_voices_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1480 1480 { 1481 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);1481 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1482 1482 int nefx = emu->audigy ? 64 : 32; 1483 1483 int idx; … … 1492 1492 static int snd_emu10k1_pcm_efx_voices_mask_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1493 1493 { 1494 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);1494 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1495 1495 unsigned int nval[2], bits; 1496 1496 int nefx = emu->audigy ? 64 : 32; … … 1543 1543 #define INITIAL_TRAM_POS(size) ((((size) / 2) - INITIAL_TRAM_SHIFT) - 1) 1544 1544 1545 static void snd_emu10k1_fx8010_playback_irq( emu10k1_t*emu, void *private_data)1545 static void snd_emu10k1_fx8010_playback_irq(struct snd_emu10k1 *emu, void *private_data) 1546 1546 { 1547 1547 snd_pcm_substream_t *substream = private_data; … … 1571 1571 1572 1572 static void fx8010_pb_trans_copy(snd_pcm_substream_t *substream, 1573 s nd_pcm_indirect_t *rec, size_t bytes)1574 { 1575 emu10k1_t*emu = snd_pcm_substream_chip(substream);1576 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1573 struct snd_pcm_indirect *rec, size_t bytes) 1574 { 1575 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1576 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1577 1577 unsigned int tram_size = pcm->buffer_size; 1578 1578 unsigned short *src = (unsigned short *)(substream->runtime->dma_area + rec->sw_data); … … 1601 1601 static int snd_emu10k1_fx8010_playback_transfer(snd_pcm_substream_t *substream) 1602 1602 { 1603 emu10k1_t*emu = snd_pcm_substream_chip(substream);1604 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1603 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1604 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1605 1605 1606 1606 snd_pcm_indirect_playback_transfer(substream, &pcm->pcm_rec, fx8010_pb_trans_copy); … … 1616 1616 static int snd_emu10k1_fx8010_playback_hw_free(snd_pcm_substream_t * substream) 1617 1617 { 1618 emu10k1_t*emu = snd_pcm_substream_chip(substream);1619 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1618 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1619 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1620 1620 unsigned int i; 1621 1621 … … 1628 1628 static int snd_emu10k1_fx8010_playback_prepare(snd_pcm_substream_t * substream) 1629 1629 { 1630 emu10k1_t*emu = snd_pcm_substream_chip(substream);1631 snd_pcm_runtime_t *runtime = substream->runtime; 1632 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1630 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1631 snd_pcm_runtime_t *runtime = substream->runtime; 1632 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1633 1633 unsigned int i; 1634 1634 … … 1652 1652 static int snd_emu10k1_fx8010_playback_trigger(snd_pcm_substream_t * substream, int cmd) 1653 1653 { 1654 emu10k1_t*emu = snd_pcm_substream_chip(substream);1655 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1654 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1655 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1656 1656 int result = 0; 1657 1657 … … 1697 1697 static snd_pcm_uframes_t snd_emu10k1_fx8010_playback_pointer(snd_pcm_substream_t * substream) 1698 1698 { 1699 emu10k1_t*emu = snd_pcm_substream_chip(substream);1700 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1699 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1700 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1701 1701 size_t ptr; /* byte pointer */ 1702 1702 … … 1707 1707 } 1708 1708 1709 static snd_pcm_hardware_t snd_emu10k1_fx8010_playback = 1710 { 1711 /* .info = */ (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1712 /* /* SNDRV_PCM_INFO_MMAP_VALID | */ SNDRV_PCM_INFO_PAUSE), 1713 /* .formats = */ SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 1714 /* .rates = */ SNDRV_PCM_RATE_48000, 1715 /* .rate_min = */ 48000, 1716 /* .rate_max = */ 48000, 1717 /* .channels_min = */ 1, 1718 /* .channels_max = */ 1, 1719 /* .buffer_bytes_max = */ (128*1024), 1720 /* .period_bytes_min = */ 1024, 1721 /* .period_bytes_max = */ (128*1024), 1722 /* .periods_min = */ 1, 1723 /* .periods_max = */ 1024, 1724 /* .fifo_size = */ 0, 1709 static struct snd_pcm_hardware snd_emu10k1_fx8010_playback = 1710 { 1711 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1712 SNDRV_PCM_INFO_RESUME | 1713 /* SNDRV_PCM_INFO_MMAP_VALID | */ SNDRV_PCM_INFO_PAUSE), 1714 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 1715 .rates = SNDRV_PCM_RATE_48000, 1716 .rate_min = 48000, 1717 .rate_max = 48000, 1718 .channels_min = 1, 1719 .channels_max = 1, 1720 .buffer_bytes_max = (128*1024), 1721 .period_bytes_min = 1024, 1722 .period_bytes_max = (128*1024), 1723 .periods_min = 1, 1724 .periods_max = 1024, 1725 .fifo_size = 0, 1725 1726 }; 1726 1727 1727 1728 static int snd_emu10k1_fx8010_playback_open(snd_pcm_substream_t * substream) 1728 1729 { 1729 emu10k1_t*emu = snd_pcm_substream_chip(substream);1730 snd_pcm_runtime_t *runtime = substream->runtime; 1731 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1730 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1731 snd_pcm_runtime_t *runtime = substream->runtime; 1732 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1732 1733 1733 1734 runtime->hw = snd_emu10k1_fx8010_playback; … … 1746 1747 static int snd_emu10k1_fx8010_playback_close(snd_pcm_substream_t * substream) 1747 1748 { 1748 emu10k1_t*emu = snd_pcm_substream_chip(substream);1749 s nd_emu10k1_fx8010_pcm_t*pcm = &emu->fx8010.pcm[substream->number];1749 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1750 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1750 1751 1751 1752 spin_lock_irq(&emu->reg_lock); … … 1755 1756 } 1756 1757 1757 static snd_pcm_ops_t snd_emu10k1_fx8010_playback_ops = { 1758 /*.open = */ snd_emu10k1_fx8010_playback_open, 1759 /*.close = */ snd_emu10k1_fx8010_playback_close, 1760 /*.ioctl = */ snd_pcm_lib_ioctl, 1761 /*.hw_params = */ snd_emu10k1_fx8010_playback_hw_params, 1762 /*.hw_free = */ snd_emu10k1_fx8010_playback_hw_free, 1763 /*.prepare = */ snd_emu10k1_fx8010_playback_prepare, 1764 /*.trigger = */ snd_emu10k1_fx8010_playback_trigger, 1765 /*.pointer = */ snd_emu10k1_fx8010_playback_pointer, 1766 NULL, NULL, NULL, 1767 /*.ack = */ snd_emu10k1_fx8010_playback_transfer, 1758 static struct snd_pcm_ops snd_emu10k1_fx8010_playback_ops = { 1759 .open = snd_emu10k1_fx8010_playback_open, 1760 .close = snd_emu10k1_fx8010_playback_close, 1761 .ioctl = snd_pcm_lib_ioctl, 1762 .hw_params = snd_emu10k1_fx8010_playback_hw_params, 1763 .hw_free = snd_emu10k1_fx8010_playback_hw_free, 1764 .prepare = snd_emu10k1_fx8010_playback_prepare, 1765 .trigger = snd_emu10k1_fx8010_playback_trigger, 1766 .pointer = snd_emu10k1_fx8010_playback_pointer, 1767 .ack = snd_emu10k1_fx8010_playback_transfer, 1768 1768 }; 1769 1769 1770 1770 static void snd_emu10k1_pcm_efx_free(snd_pcm_t *pcm) 1771 1771 { 1772 emu10k1_t*emu = pcm->private_data;1772 struct snd_emu10k1 *emu = pcm->private_data; 1773 1773 emu->pcm_efx = NULL; 1774 1774 snd_pcm_lib_preallocate_free_for_all(pcm); 1775 1775 } 1776 1776 1777 int __devinit snd_emu10k1_pcm_efx( emu10k1_t* emu, int device, snd_pcm_t ** rpcm)1777 int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, snd_pcm_t ** rpcm) 1778 1778 { 1779 1779 snd_pcm_t *pcm; -
GPL/trunk/alsa-kernel/pci/emu10k1/emuproc.c
r33 r34 32 32 #include <sound/emu10k1.h> 33 33 34 static void snd_emu10k1_proc_spdif_status( emu10k1_t* emu,34 static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu, 35 35 snd_info_buffer_t * buffer, 36 36 char *title, … … 175 175 }; 176 176 177 emu10k1_t*emu = entry->private_data;177 struct snd_emu10k1 *emu = entry->private_data; 178 178 unsigned int val; 179 179 int nefx = emu->audigy ? 64 : 32; … … 223 223 { 224 224 u32 pc; 225 emu10k1_t*emu = entry->private_data;225 struct snd_emu10k1 *emu = entry->private_data; 226 226 227 227 snd_iprintf(buffer, "FX8010 Instruction List '%s'\n", emu->fx8010.name); … … 267 267 { 268 268 long size; 269 emu10k1_t*emu = entry->private_data;269 struct snd_emu10k1 *emu = entry->private_data; 270 270 unsigned int offset; 271 271 int tram_addr = 0; … … 310 310 snd_info_buffer_t * buffer) 311 311 { 312 emu10k1_t*emu = entry->private_data;313 emu10k1_voice_t*voice;312 struct snd_emu10k1 *emu = entry->private_data; 313 struct snd_emu10k1_voice *voice; 314 314 int idx; 315 315 … … 331 331 snd_info_buffer_t * buffer) 332 332 { 333 emu10k1_t*emu = entry->private_data;333 struct snd_emu10k1 *emu = entry->private_data; 334 334 unsigned long value; 335 335 unsigned long flags; … … 347 347 snd_info_buffer_t * buffer) 348 348 { 349 emu10k1_t*emu = entry->private_data;349 struct snd_emu10k1 *emu = entry->private_data; 350 350 unsigned long flags; 351 351 char line[64]; 352 352 u32 reg, val; 353 #if 0 353 354 while (!snd_info_get_line(buffer, line, sizeof(line))) { 354 355 if (sscanf(line, "%x %x", ®, &val) != 2) … … 360 361 } 361 362 } 362 } 363 364 static unsigned int snd_ptr_read(emu10k1_t * emu, 363 #endif 364 } 365 366 static unsigned int snd_ptr_read(struct snd_emu10k1 * emu, 365 367 unsigned int iobase, 366 368 unsigned int reg, … … 379 381 } 380 382 381 static void snd_ptr_write( emu10k1_t*emu,383 static void snd_ptr_write(struct snd_emu10k1 *emu, 382 384 unsigned int iobase, 383 385 unsigned int reg, … … 400 402 snd_info_buffer_t * buffer, int iobase, int offset, int length) 401 403 { 402 emu10k1_t*emu = entry->private_data;404 struct snd_emu10k1 *emu = entry->private_data; 403 405 unsigned long value; 404 406 int i,j; … … 424 426 snd_info_buffer_t * buffer, int iobase) 425 427 { 426 emu10k1_t*emu = entry->private_data;428 struct snd_emu10k1 *emu = entry->private_data; 427 429 char line[64]; 428 430 unsigned int reg, channel_id , val; 431 #if 0 429 432 while (!snd_info_get_line(buffer, line, sizeof(line))) { 430 433 if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3) … … 433 436 snd_ptr_write(emu, iobase, reg, channel_id, val); 434 437 } 438 #endif 435 439 } 436 440 … … 483 487 }; 484 488 #endif 485 int __devinit snd_emu10k1_proc_init( emu10k1_t* emu)489 int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu) 486 490 { 487 491 snd_info_entry_t *entry; -
GPL/trunk/alsa-kernel/pci/emu10k1/io.c
r33 r34 32 32 #include <sound/emu10k1.h> 33 33 34 unsigned int snd_emu10k1_ptr_read( emu10k1_t* emu, unsigned int reg, unsigned int chn)34 unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn) 35 35 { 36 36 unsigned long flags; … … 63 63 } 64 64 65 void snd_emu10k1_ptr_write( emu10k1_t*emu, unsigned int reg, unsigned int chn, unsigned int data)65 void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data) 66 66 { 67 67 unsigned int regptr; … … 93 93 } 94 94 95 unsigned int snd_emu10k1_ptr20_read( emu10k1_t* emu,95 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 96 96 unsigned int reg, 97 97 unsigned int chn) … … 109 109 } 110 110 111 void snd_emu10k1_ptr20_write( emu10k1_t*emu,111 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 112 112 unsigned int reg, 113 113 unsigned int chn, … … 125 125 } 126 126 127 void snd_emu10k1_intr_enable( emu10k1_t*emu, unsigned int intrenb)127 void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) 128 128 { 129 129 unsigned long flags; … … 136 136 } 137 137 138 void snd_emu10k1_intr_disable( emu10k1_t*emu, unsigned int intrenb)138 void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb) 139 139 { 140 140 unsigned long flags; … … 147 147 } 148 148 149 void snd_emu10k1_voice_intr_enable( emu10k1_t*emu, unsigned int voicenum)149 void snd_emu10k1_voice_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum) 150 150 { 151 151 unsigned long flags; … … 167 167 } 168 168 169 void snd_emu10k1_voice_intr_disable( emu10k1_t*emu, unsigned int voicenum)169 void snd_emu10k1_voice_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum) 170 170 { 171 171 unsigned long flags; … … 187 187 } 188 188 189 void snd_emu10k1_voice_intr_ack( emu10k1_t*emu, unsigned int voicenum)189 void snd_emu10k1_voice_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum) 190 190 { 191 191 unsigned long flags; … … 204 204 } 205 205 206 void snd_emu10k1_voice_half_loop_intr_enable( emu10k1_t*emu, unsigned int voicenum)206 void snd_emu10k1_voice_half_loop_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum) 207 207 { 208 208 unsigned long flags; … … 224 224 } 225 225 226 void snd_emu10k1_voice_half_loop_intr_disable( emu10k1_t*emu, unsigned int voicenum)226 void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum) 227 227 { 228 228 unsigned long flags; … … 244 244 } 245 245 246 void snd_emu10k1_voice_half_loop_intr_ack( emu10k1_t*emu, unsigned int voicenum)246 void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum) 247 247 { 248 248 unsigned long flags; … … 261 261 } 262 262 263 void snd_emu10k1_voice_set_loop_stop( emu10k1_t*emu, unsigned int voicenum)263 void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum) 264 264 { 265 265 unsigned long flags; … … 281 281 } 282 282 283 void snd_emu10k1_voice_clear_loop_stop( emu10k1_t*emu, unsigned int voicenum)283 void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum) 284 284 { 285 285 unsigned long flags; … … 301 301 } 302 302 303 void snd_emu10k1_wait( emu10k1_t*emu, unsigned int wait)303 void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait) 304 304 { 305 305 volatile unsigned count; … … 322 322 unsigned short snd_emu10k1_ac97_read(ac97_t *ac97, unsigned short reg) 323 323 { 324 emu10k1_t*emu = ac97->private_data;324 struct snd_emu10k1 *emu = ac97->private_data; 325 325 unsigned long flags; 326 326 unsigned short val; … … 335 335 void snd_emu10k1_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short data) 336 336 { 337 emu10k1_t*emu = ac97->private_data;337 struct snd_emu10k1 *emu = ac97->private_data; 338 338 unsigned long flags; 339 339 -
GPL/trunk/alsa-kernel/pci/emu10k1/irq.c
r33 r34 34 34 irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) 35 35 { 36 emu10k1_t*emu = dev_id;36 struct snd_emu10k1 *emu = dev_id; 37 37 unsigned int status, status2, orig_status, orig_status2; 38 38 int handled = 0; … … 76 76 int voice_max = status & IPR_CHANNELNUMBERMASK; 77 77 u32 val; 78 emu10k1_voice_t*pvoice = emu->voices;78 struct snd_emu10k1_voice *pvoice = emu->voices; 79 79 80 80 val = snd_emu10k1_ptr_read(emu, CLIPL, 0); … … 170 170 while ((status2 = inl(emu->port + IPR2)) != 0) { 171 171 u32 mask = INTE2_PLAYBACK_CH_0_LOOP; /* Full Loop */ 172 emu10k1_voice_t*pvoice = &(emu->p16v_voices[0]);173 emu10k1_voice_t*cvoice = &(emu->p16v_capture_voice);172 struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]); 173 struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice); 174 174 175 175 //printk(KERN_INFO "status2=0x%x\n", status2); … … 219 219 220 220 } 221 222 #ifdef TARGET_OS2223 if (fOurIrq) {224 eoi_irq(irq);225 }226 #endif //TARGET_OS2227 228 221 return IRQ_RETVAL(handled); 229 222 } -
GPL/trunk/alsa-kernel/pci/emu10k1/memory.c
r33 r34 49 49 #else 50 50 /* fill PTB entries -- we need to fill UNIT_PAGES entries */ 51 static inline void set_ptb_entry( emu10k1_t*emu, int page, dma_addr_t addr)51 static inline void set_ptb_entry(struct snd_emu10k1 *emu, int page, dma_addr_t addr) 52 52 { 53 53 int i; … … 58 58 } 59 59 } 60 static inline void set_silent_ptb( emu10k1_t*emu, int page)60 static inline void set_silent_ptb(struct snd_emu10k1 *emu, int page) 61 61 { 62 62 int i; … … 72 72 /* 73 73 */ 74 static int synth_alloc_pages( emu10k1_t *hw, emu10k1_memblk_t*blk);75 static int synth_free_pages( emu10k1_t *hw, emu10k1_memblk_t*blk);76 77 #define get_emu10k1_memblk(l,member) list_entry(l, emu10k1_memblk_t, member)74 static int synth_alloc_pages(struct snd_emu10k1 *hw, struct snd_emu10k1_memblk *blk); 75 static int synth_free_pages(struct snd_emu10k1 *hw, struct snd_emu10k1_memblk *blk); 76 77 #define get_emu10k1_memblk(l,member) list_entry(l, struct snd_emu10k1_memblk, member) 78 78 79 79 80 80 /* initialize emu10k1 part */ 81 static void emu10k1_memblk_init( emu10k1_memblk_t*blk)81 static void emu10k1_memblk_init(struct snd_emu10k1_memblk *blk) 82 82 { 83 83 blk->mapped_page = -1; … … 98 98 * if not found, return a negative error code. 99 99 */ 100 static int search_empty_map_area( emu10k1_t*emu, int npages, struct list_head **nextp)100 static int search_empty_map_area(struct snd_emu10k1 *emu, int npages, struct list_head **nextp) 101 101 { 102 102 int page = 0, found_page = -ENOMEM; … … 107 107 108 108 list_for_each (pos, &emu->mapped_link_head) { 109 emu10k1_memblk_t*blk = get_emu10k1_memblk(pos, mapped_link);109 struct snd_emu10k1_memblk *blk = get_emu10k1_memblk(pos, mapped_link); 110 110 snd_assert(blk->mapped_page >= 0, continue); 111 111 size = blk->mapped_page - page; … … 136 136 * call with memblk_lock held 137 137 */ 138 static int map_memblk( emu10k1_t *emu, emu10k1_memblk_t*blk)138 static int map_memblk(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk) 139 139 { 140 140 int page, pg; … … 163 163 * call with memblk_lock held 164 164 */ 165 static int unmap_memblk( emu10k1_t *emu, emu10k1_memblk_t*blk)165 static int unmap_memblk(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk) 166 166 { 167 167 int start_page, end_page, mpage, pg; 168 168 struct list_head *p; 169 emu10k1_memblk_t*q;169 struct snd_emu10k1_memblk *q; 170 170 171 171 /* calculate the expected size of empty region */ … … 199 199 * unlike synth_alloc the memory block is aligned to the page start 200 200 */ 201 static emu10k1_memblk_t*202 search_empty( emu10k1_t*emu, int size)201 static struct snd_emu10k1_memblk * 202 search_empty(struct snd_emu10k1 *emu, int size) 203 203 { 204 204 struct list_head *p; 205 emu10k1_memblk_t*blk;205 struct snd_emu10k1_memblk *blk; 206 206 int page, psize; 207 207 … … 219 219 __found_pages: 220 220 /* create a new memory block */ 221 blk = ( emu10k1_memblk_t*)__snd_util_memblk_new(emu->memhdr, psize << PAGE_SHIFT, p->prev);221 blk = (struct snd_emu10k1_memblk *)__snd_util_memblk_new(emu->memhdr, psize << PAGE_SHIFT, p->prev); 222 222 if (blk == NULL) 223 223 return NULL; … … 231 231 * check if the given pointer is valid for pages 232 232 */ 233 static int is_valid_page( emu10k1_t*emu, dma_addr_t addr)233 static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr) 234 234 { 235 235 if (addr & ~emu->dma_mask) { … … 250 250 * and retry the mapping. 251 251 */ 252 int snd_emu10k1_memblk_map( emu10k1_t *emu, emu10k1_memblk_t*blk)252 int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk) 253 253 { 254 254 int err; 255 255 int size; 256 256 struct list_head *p, *nextp; 257 emu10k1_memblk_t*deleted;257 struct snd_emu10k1_memblk *deleted; 258 258 unsigned long flags; 259 259 … … 291 291 */ 292 292 snd_util_memblk_t * 293 snd_emu10k1_alloc_pages( emu10k1_t*emu, snd_pcm_substream_t *substream)293 snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, snd_pcm_substream_t *substream) 294 294 { 295 295 snd_pcm_runtime_t *runtime = substream->runtime; 296 296 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); 297 297 snd_util_memhdr_t *hdr; 298 emu10k1_memblk_t*blk;298 struct snd_emu10k1_memblk *blk; 299 299 int page, err, idx; 300 300 … … 350 350 * release DMA buffer from page table 351 351 */ 352 int snd_emu10k1_free_pages( emu10k1_t*emu, snd_util_memblk_t *blk)352 int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, snd_util_memblk_t *blk) 353 353 { 354 354 snd_assert(emu && blk, return -EINVAL); … … 366 366 */ 367 367 snd_util_memblk_t * 368 snd_emu10k1_synth_alloc( emu10k1_t*hw, unsigned int size)369 { 370 emu10k1_memblk_t*blk;368 snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size) 369 { 370 struct snd_emu10k1_memblk *blk; 371 371 snd_util_memhdr_t *hdr = hw->memhdr; 372 372 373 373 down(&hdr->block_mutex); 374 blk = ( emu10k1_memblk_t*)__snd_util_mem_alloc(hdr, size);374 blk = (struct snd_emu10k1_memblk *)__snd_util_mem_alloc(hdr, size); 375 375 if (blk == NULL) { 376 376 up(&hdr->block_mutex); … … 392 392 */ 393 393 int 394 snd_emu10k1_synth_free( emu10k1_t*emu, snd_util_memblk_t *memblk)394 snd_emu10k1_synth_free(struct snd_emu10k1 *emu, snd_util_memblk_t *memblk) 395 395 { 396 396 snd_util_memhdr_t *hdr = emu->memhdr; 397 emu10k1_memblk_t *blk = (emu10k1_memblk_t*)memblk;397 struct snd_emu10k1_memblk *blk = (struct snd_emu10k1_memblk *)memblk; 398 398 unsigned long flags; 399 399 … … 411 411 412 412 /* check new allocation range */ 413 static void get_single_page_range(snd_util_memhdr_t *hdr, emu10k1_memblk_t*blk, int *first_page_ret, int *last_page_ret)413 static void get_single_page_range(snd_util_memhdr_t *hdr, struct snd_emu10k1_memblk *blk, int *first_page_ret, int *last_page_ret) 414 414 { 415 415 struct list_head *p; 416 emu10k1_memblk_t*q;416 struct snd_emu10k1_memblk *q; 417 417 int first_page, last_page; 418 418 first_page = blk->first_page; … … 435 435 * allocate kernel pages 436 436 */ 437 static int synth_alloc_pages( emu10k1_t *emu, emu10k1_memblk_t*blk)437 static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk) 438 438 { 439 439 int page, first_page, last_page; … … 474 474 * free pages 475 475 */ 476 static int synth_free_pages( emu10k1_t *emu, emu10k1_memblk_t*blk)476 static int synth_free_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk) 477 477 { 478 478 int page, first_page, last_page; … … 497 497 498 498 /* calculate buffer pointer from offset address */ 499 inline static void *offset_ptr( emu10k1_t*emu, int page, int offset)499 inline static void *offset_ptr(struct snd_emu10k1 *emu, int page, int offset) 500 500 { 501 501 char *ptr; … … 513 513 * bzero(blk + offset, size) 514 514 */ 515 int snd_emu10k1_synth_bzero( emu10k1_t*emu, snd_util_memblk_t *blk, int offset, int size)515 int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, snd_util_memblk_t *blk, int offset, int size) 516 516 { 517 517 int page, nextofs, end_offset, temp, temp1; 518 518 void *ptr; 519 emu10k1_memblk_t *p = (emu10k1_memblk_t*)blk;519 struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk; 520 520 521 521 offset += blk->offset & (PAGE_SIZE - 1); … … 540 540 * copy_from_user(blk + offset, data, size) 541 541 */ 542 int snd_emu10k1_synth_copy_from_user( emu10k1_t*emu, snd_util_memblk_t *blk, int offset, const char *data, int size)542 int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, snd_util_memblk_t *blk, int offset, const char *data, int size) 543 543 { 544 544 int page, nextofs, end_offset, temp, temp1; 545 545 void *ptr; 546 emu10k1_memblk_t *p = (emu10k1_memblk_t*)blk;546 struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk; 547 547 548 548 offset += blk->offset & (PAGE_SIZE - 1); -
GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c
r33 r34 162 162 static void snd_p16v_pcm_free_substream(snd_pcm_runtime_t *runtime) 163 163 { 164 emu10k1_pcm_t*epcm = runtime->private_data;164 struct snd_emu10k1_pcm *epcm = runtime->private_data; 165 165 166 166 if (epcm) { … … 173 173 static int snd_p16v_pcm_open_playback_channel(snd_pcm_substream_t *substream, int channel_id) 174 174 { 175 emu10k1_t*emu = snd_pcm_substream_chip(substream);176 emu10k1_voice_t*channel = &(emu->p16v_voices[channel_id]);177 emu10k1_pcm_t*epcm;175 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 176 struct snd_emu10k1_voice *channel = &(emu->p16v_voices[channel_id]); 177 struct snd_emu10k1_pcm *epcm; 178 178 snd_pcm_runtime_t *runtime = substream->runtime; 179 179 int err; 180 180 181 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);181 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 182 182 //snd_printk("epcm kcalloc: %p\n", epcm); 183 183 … … 210 210 static int snd_p16v_pcm_open_capture_channel(snd_pcm_substream_t *substream, int channel_id) 211 211 { 212 emu10k1_t*emu = snd_pcm_substream_chip(substream);213 emu10k1_voice_t*channel = &(emu->p16v_capture_voice);214 emu10k1_pcm_t*epcm;212 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 213 struct snd_emu10k1_voice *channel = &(emu->p16v_capture_voice); 214 struct snd_emu10k1_pcm *epcm; 215 215 snd_pcm_runtime_t *runtime = substream->runtime; 216 216 int err; 217 217 218 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);218 epcm = (struct snd_emu10k1_pcm *)kzalloc(sizeof(*epcm), GFP_KERNEL); 219 219 //snd_printk("epcm kcalloc: %p\n", epcm); 220 220 … … 248 248 static int snd_p16v_pcm_close_playback(snd_pcm_substream_t *substream) 249 249 { 250 emu10k1_t*emu = snd_pcm_substream_chip(substream);250 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 251 251 //snd_pcm_runtime_t *runtime = substream->runtime; 252 // emu10k1_pcm_t*epcm = runtime->private_data;252 //struct snd_emu10k1_pcm *epcm = runtime->private_data; 253 253 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use=0; 254 254 /* FIXME: maybe zero others */ … … 259 259 static int snd_p16v_pcm_close_capture(snd_pcm_substream_t *substream) 260 260 { 261 emu10k1_t*emu = snd_pcm_substream_chip(substream);261 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 262 262 //snd_pcm_runtime_t *runtime = substream->runtime; 263 // emu10k1_pcm_t*epcm = runtime->private_data;263 //struct snd_emu10k1_pcm *epcm = runtime->private_data; 264 264 emu->p16v_capture_voice.use=0; 265 265 /* FIXME: maybe zero others */ … … 319 319 static int snd_p16v_pcm_prepare_playback(snd_pcm_substream_t *substream) 320 320 { 321 emu10k1_t*emu = snd_pcm_substream_chip(substream);321 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 322 322 snd_pcm_runtime_t *runtime = substream->runtime; 323 323 int channel = substream->pcm->device - emu->p16v_device_offset; … … 368 368 static int snd_p16v_pcm_prepare_capture(snd_pcm_substream_t *substream) 369 369 { 370 emu10k1_t*emu = snd_pcm_substream_chip(substream);370 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 371 371 snd_pcm_runtime_t *runtime = substream->runtime; 372 372 int channel = substream->pcm->device - emu->p16v_device_offset; … … 400 400 } 401 401 402 static void snd_p16v_intr_enable( emu10k1_t*emu, unsigned int intrenb)402 static void snd_p16v_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) 403 403 { 404 404 unsigned long flags; … … 411 411 } 412 412 413 static void snd_p16v_intr_disable( emu10k1_t*emu, unsigned int intrenb)413 static void snd_p16v_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb) 414 414 { 415 415 unsigned long flags; … … 426 426 int cmd) 427 427 { 428 emu10k1_t*emu = snd_pcm_substream_chip(substream);428 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 429 429 snd_pcm_runtime_t *runtime; 430 emu10k1_pcm_t*epcm;430 struct snd_emu10k1_pcm *epcm; 431 431 int channel; 432 432 int result = 0; … … 479 479 int cmd) 480 480 { 481 emu10k1_t*emu = snd_pcm_substream_chip(substream);481 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 482 482 snd_pcm_runtime_t *runtime = substream->runtime; 483 emu10k1_pcm_t*epcm = runtime->private_data;483 struct snd_emu10k1_pcm *epcm = runtime->private_data; 484 484 int channel = 0; 485 485 int result = 0; … … 509 509 snd_p16v_pcm_pointer_playback(snd_pcm_substream_t *substream) 510 510 { 511 emu10k1_t*emu = snd_pcm_substream_chip(substream);511 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 512 512 snd_pcm_runtime_t *runtime = substream->runtime; 513 emu10k1_pcm_t*epcm = runtime->private_data;513 struct snd_emu10k1_pcm *epcm = runtime->private_data; 514 514 snd_pcm_uframes_t ptr, ptr1, ptr2,ptr3,ptr4 = 0; 515 515 int channel = substream->pcm->device - emu->p16v_device_offset; … … 534 534 snd_p16v_pcm_pointer_capture(snd_pcm_substream_t *substream) 535 535 { 536 emu10k1_t*emu = snd_pcm_substream_chip(substream);536 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 537 537 snd_pcm_runtime_t *runtime = substream->runtime; 538 emu10k1_pcm_t*epcm = runtime->private_data;538 struct snd_emu10k1_pcm *epcm = runtime->private_data; 539 539 snd_pcm_uframes_t ptr, ptr1, ptr2 = 0; 540 540 int channel = 0; … … 580 580 }; 581 581 582 int snd_p16v_free( emu10k1_t*chip)582 int snd_p16v_free(struct snd_emu10k1 *chip) 583 583 { 584 584 // release the data … … 592 592 static void snd_p16v_pcm_free(snd_pcm_t *pcm) 593 593 { 594 emu10k1_t*emu = pcm->private_data;594 struct snd_emu10k1 *emu = pcm->private_data; 595 595 //snd_printk("snd_p16v_pcm_free pcm: called\n"); 596 596 snd_pcm_lib_preallocate_free_for_all(pcm); … … 598 598 } 599 599 600 int snd_p16v_pcm( emu10k1_t*emu, int device, snd_pcm_t **rpcm)600 int snd_p16v_pcm(struct snd_emu10k1 *emu, int device, snd_pcm_t **rpcm) 601 601 { 602 602 snd_pcm_t *pcm; … … 664 664 snd_ctl_elem_value_t * ucontrol, int reg, int high_low) 665 665 { 666 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);666 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 667 667 u32 value; 668 668 … … 742 742 snd_ctl_elem_value_t * ucontrol, int reg, int high_low) 743 743 { 744 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);744 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 745 745 u32 value; 746 746 value = snd_emu10k1_ptr20_read(emu, reg, 0); … … 909 909 snd_ctl_elem_value_t * ucontrol) 910 910 { 911 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);911 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 912 912 913 913 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source; … … 918 918 snd_ctl_elem_value_t * ucontrol) 919 919 { 920 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);920 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 921 921 unsigned int val; 922 922 int change = 0; … … 960 960 snd_ctl_elem_value_t * ucontrol) 961 961 { 962 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);962 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 963 963 964 964 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel; … … 969 969 snd_ctl_elem_value_t * ucontrol) 970 970 { 971 emu10k1_t*emu = snd_kcontrol_chip(kcontrol);971 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 972 972 unsigned int val; 973 973 int change = 0; … … 993 993 }; 994 994 995 int snd_p16v_mixer( emu10k1_t*emu)995 int snd_p16v_mixer(struct snd_emu10k1 *emu) 996 996 { 997 997 int err; -
GPL/trunk/alsa-kernel/pci/emu10k1/timer.c
r33 r34 1 1 /* 2 2 * Copyright (c) by Lee Revell <rlrevell@joe-job.com> 3 * 3 * 4 4 * Routines for control of EMU10K1 chips 5 5 * 6 6 * Copied from similar code by Clemens Ladisch in the ymfpci driver 7 * 7 * 8 8 * BUGS: 9 9 * -- … … 35 35 static int snd_emu10k1_timer_start(snd_timer_t *timer) 36 36 { 37 emu10k1_t*emu;37 struct snd_emu10k1 *emu; 38 38 unsigned long flags; 39 39 unsigned int delay; … … 52 52 static int snd_emu10k1_timer_stop(snd_timer_t *timer) 53 53 { 54 emu10k1_t*emu;54 struct snd_emu10k1 *emu; 55 55 unsigned long flags; 56 56 … … 70 70 } 71 71 72 static struct _snd_timer_hardware snd_emu10k1_timer_hw = { 73 /*.flags = */SNDRV_TIMER_HW_AUTO, 74 /*.resolution = */20833, /* 1 sample @ 48KHZ = 20.833...us */ 75 0, 0, 76 /*.ticks = */1024, 77 NULL, NULL, NULL, 78 /*.start = */snd_emu10k1_timer_start, 79 /*.stop = */snd_emu10k1_timer_stop, 80 NULL, 81 /*.precise_resolution = */snd_emu10k1_timer_precise_resolution 72 static struct snd_timer_hardware snd_emu10k1_timer_hw = { 73 .flags = SNDRV_TIMER_HW_AUTO, 74 .resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */ 75 .ticks = 1024, 76 .start = snd_emu10k1_timer_start, 77 .stop = snd_emu10k1_timer_stop, 78 .precise_resolution = snd_emu10k1_timer_precise_resolution, 82 79 }; 83 80 84 int __devinit snd_emu10k1_timer( emu10k1_t*emu, int device)81 int __devinit snd_emu10k1_timer(struct snd_emu10k1 *emu, int device) 85 82 { 86 83 snd_timer_t *timer = NULL; -
GPL/trunk/alsa-kernel/pci/emu10k1/voice.c
r33 r34 47 47 */ 48 48 49 static int voice_alloc( emu10k1_t *emu, emu10k1_voice_type_t type, int number, emu10k1_voice_t**rvoice)49 static int voice_alloc(struct snd_emu10k1 *emu, int type, int number, struct snd_emu10k1_voice **rvoice) 50 50 { 51 emu10k1_voice_t*voice;51 struct snd_emu10k1_voice *voice; 52 52 int i, j, k, first_voice, last_voice, skip; 53 53 … … 109 109 } 110 110 111 int snd_emu10k1_voice_alloc( emu10k1_t *emu, emu10k1_voice_type_t type, int number, emu10k1_voice_t**rvoice)111 int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int number, struct snd_emu10k1_voice **rvoice) 112 112 { 113 113 unsigned long flags; … … 127 127 result = emu->get_synth_voice(emu); 128 128 if (result >= 0) { 129 emu10k1_voice_t*pvoice = &emu->voices[result];129 struct snd_emu10k1_voice *pvoice = &emu->voices[result]; 130 130 pvoice->interrupt = NULL; 131 131 pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = pvoice->efx = 0; … … 141 141 } 142 142 143 int snd_emu10k1_voice_free( emu10k1_t *emu, emu10k1_voice_t*pvoice)143 int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice) 144 144 { 145 145 unsigned long flags;
Note:
See TracChangeset
for help on using the changeset viewer.
