Changeset 34 for GPL/trunk/alsa-kernel/include/sound/trident.h
- Timestamp:
 - Dec 11, 2005, 5:57:39 PM (20 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  GPL/trunk/alsa-kernel/include/sound/trident.h (modified) (11 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
GPL/trunk/alsa-kernel/include/sound/trident.h
r33 r34 34 34 #include "ainstr_simple.h" 35 35 36 #ifndef PCI_ VENDOR_ID_TRIDENT37 #define PCI_ VENDOR_ID_TRIDENT 0x102336 #ifndef PCI_DEVICE_ID_SI_7018 37 #define PCI_DEVICE_ID_SI_7018 0x7018 38 38 #endif 39 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 40 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x200039 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 40 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 41 41 #endif 42 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 43 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 44 #endif 45 46 #ifndef PCI_VENDOR_ID_SI 47 #define PCI_VENDOR_ID_SI 0x1039 48 #endif 49 #ifndef PCI_DEVICE_ID_SI_7018 50 #define PCI_DEVICE_ID_SI_7018 0x7018 42 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 43 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 51 44 #endif 52 45 … … 263 256 SI_AC97_POWERDOWN = 0x04000000, 264 257 }; 265 258 266 259 /* PCM defaults */ 267 260 … … 271 264 #define T4D_DEFAULT_PCM_CVOL 127 /* 0 - 127 */ 272 265 273 typedef struct _snd_trident trident_t;274 typedef struct _snd_trident_voice snd_trident_voice_t;275 typedef struct _snd_trident_pcm_mixer snd_trident_pcm_mixer_t;276 277 typedef struct{278 void (*sample_start)( trident_t *gus, snd_trident_voice_t*voice, snd_seq_position_t position);279 void (*sample_stop)( trident_t *gus, snd_trident_voice_t *voice, snd_seq_stop_mode_t mode);280 void (*sample_freq)( trident_t *gus, snd_trident_voice_t*voice, snd_seq_frequency_t freq);281 void (*sample_volume)( trident_t *gus, snd_trident_voice_t *voice, snd_seq_ev_volume_t*volume);282 void (*sample_loop)( trident_t *card, snd_trident_voice_t *voice, snd_seq_ev_loop_t*loop);283 void (*sample_pos)( trident_t *card, snd_trident_voice_t*voice, snd_seq_position_t position);284 void (*sample_private1)( trident_t *card, snd_trident_voice_t*voice, unsigned char *data);285 } snd_trident_sample_ops_t;286 287 typedef struct {288 s nd_midi_channel_set_t * chset;289 trident_t * trident;266 struct snd_trident; 267 struct snd_trident_voice; 268 struct snd_trident_pcm_mixer; 269 270 struct snd_trident_sample_ops { 271 void (*sample_start)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_position_t position); 272 void (*sample_stop)(struct snd_trident *gus, struct snd_trident_voice *voice, int mode); 273 void (*sample_freq)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_frequency_t freq); 274 void (*sample_volume)(struct snd_trident *gus, struct snd_trident_voice *voice, struct snd_seq_ev_volume *volume); 275 void (*sample_loop)(struct snd_trident *card, struct snd_trident_voice *voice, struct snd_seq_ev_loop *loop); 276 void (*sample_pos)(struct snd_trident *card, struct snd_trident_voice *voice, snd_seq_position_t position); 277 void (*sample_private1)(struct snd_trident *card, struct snd_trident_voice *voice, unsigned char *data); 278 }; 279 280 struct snd_trident_port { 281 struct snd_midi_channel_set * chset; 282 struct snd_trident * trident; 290 283 int mode; /* operation mode */ 291 284 int client; /* sequencer client number */ 292 285 int port; /* sequencer port number */ 293 int midi_has_voices: 1;294 } snd_trident_port_t;295 296 typedefstruct snd_trident_memblk_arg {286 unsigned int midi_has_voices: 1; 287 }; 288 289 struct snd_trident_memblk_arg { 297 290 short first_page, last_page; 298 } snd_trident_memblk_arg_t;299 300 typedef struct{291 }; 292 293 struct snd_trident_tlb { 301 294 unsigned int * entries; /* 16k-aligned TLB table */ 302 295 dma_addr_t entries_dmaaddr; /* 16k-aligned PCI address to TLB table */ 303 unsigned long * shadow_entries; /* shadow entries with virtual addresses */304 struct snd_dma_buffer buffer;305 snd_util_memhdr_t* memhdr; /* page allocation list */306 struct snd_dma_buffer silent_page;307 } snd_trident_tlb_t;308 309 struct _snd_trident_voice {296 unsigned long * shadow_entries; /* shadow entries with virtual addresses */ 297 struct snd_dma_buffer buffer; 298 struct snd_util_memhdr * memhdr; /* page allocation list */ 299 struct snd_dma_buffer silent_page; 300 }; 301 302 struct snd_trident_voice { 310 303 unsigned int number; 311 int use: 1,304 unsigned int use: 1, 312 305 pcm: 1, 313 306 synth:1, … … 318 311 unsigned char index; 319 312 320 s nd_seq_instr_tinstr;321 s nd_trident_sample_ops_t*sample_ops;313 struct snd_seq_instr instr; 314 struct snd_trident_sample_ops *sample_ops; 322 315 323 316 /* channel parameters */ … … 341 334 unsigned int negCSO; /* nonzero - use negative CSO */ 342 335 343 s nd_util_memblk_t*memblk; /* memory block if TLB enabled */336 struct snd_util_memblk *memblk; /* memory block if TLB enabled */ 344 337 345 338 /* PCM data */ 346 339 347 trident_t *trident;348 s nd_pcm_substream_t*substream;349 s nd_trident_voice_t*extra; /* extra PCM voice (acts as interrupt generator) */350 int running: 1,340 struct snd_trident *trident; 341 struct snd_pcm_substream *substream; 342 struct snd_trident_voice *extra; /* extra PCM voice (acts as interrupt generator) */ 343 unsigned int running: 1, 351 344 capture: 1, 352 345 spdif: 1, … … 365 358 366 359 void *private_data; 367 void (*private_free)(s nd_trident_voice_t*voice);368 }; 369 370 struct _snd_4dwave {360 void (*private_free)(struct snd_trident_voice *voice); 361 }; 362 363 struct snd_4dwave { 371 364 int seq_client; 372 365 373 s nd_trident_port_t seq_ports[4];374 s nd_simple_ops_tsimple_ops;375 s nd_seq_kinstr_list_t *ilist;376 377 s nd_trident_voice_tvoices[64];366 struct snd_trident_port seq_ports[4]; 367 struct snd_simple_ops simple_ops; 368 struct snd_seq_kinstr_list *ilist; 369 370 struct snd_trident_voice voices[64]; 378 371 379 372 int ChanSynthCount; /* number of allocated synth channels */ … … 382 375 }; 383 376 384 struct _snd_trident_pcm_mixer {385 s nd_trident_voice_t*voice; /* active voice */377 struct snd_trident_pcm_mixer { 378 struct snd_trident_voice *voice; /* active voice */ 386 379 unsigned short vol; /* front volume */ 387 380 unsigned char pan; /* pan control */ … … 391 384 }; 392 385 393 struct _snd_trident {386 struct snd_trident { 394 387 int irq; 395 388 … … 404 397 unsigned int spurious_irq_max_delta; 405 398 406 s nd_trident_tlb_ttlb; /* TLB entries for NX cards */399 struct snd_trident_tlb tlb; /* TLB entries for NX cards */ 407 400 408 401 unsigned char spdif_ctrl; … … 410 403 unsigned int spdif_bits; 411 404 unsigned int spdif_pcm_bits; 412 s nd_kcontrol_t*spdif_pcm_ctl; /* S/PDIF settings */405 struct snd_kcontrol *spdif_pcm_ctl; /* S/PDIF settings */ 413 406 unsigned int ac97_ctrl; 414 407 … … 421 414 unsigned int in_suspend: 1; /* 1 during suspend/resume */ 422 415 423 struct _snd_4dwave synth; /* synth specific variables */416 struct snd_4dwave synth; /* synth specific variables */ 424 417 425 418 spinlock_t event_lock; 426 419 spinlock_t voice_alloc; 427 420 428 struct snd_dma_device dma_dev; 421 struct snd_dma_device dma_dev; 422 429 423 struct pci_dev *pci; 430 s nd_card_t*card;431 s nd_pcm_t*pcm; /* ADC/DAC PCM */432 s nd_pcm_t*foldback; /* Foldback PCM */433 s nd_pcm_t*spdif; /* SPDIF PCM */434 s nd_rawmidi_t*rmidi;435 s nd_seq_device_t*seq_dev;436 437 ac97_bus_t*ac97_bus;438 ac97_t*ac97;439 ac97_t*ac97_sec;424 struct snd_card *card; 425 struct snd_pcm *pcm; /* ADC/DAC PCM */ 426 struct snd_pcm *foldback; /* Foldback PCM */ 427 struct snd_pcm *spdif; /* SPDIF PCM */ 428 struct snd_rawmidi *rmidi; 429 struct snd_seq_device *seq_dev; 430 431 struct snd_ac97_bus *ac97_bus; 432 struct snd_ac97 *ac97; 433 struct snd_ac97 *ac97_sec; 440 434 441 435 unsigned int musicvol_wavevol; 442 s nd_trident_pcm_mixer_tpcm_mixer[32];443 s nd_kcontrol_t*ctl_vol; /* front volume */444 s nd_kcontrol_t*ctl_pan; /* pan */445 s nd_kcontrol_t*ctl_rvol; /* rear volume */446 s nd_kcontrol_t*ctl_cvol; /* center volume */436 struct snd_trident_pcm_mixer pcm_mixer[32]; 437 struct snd_kcontrol *ctl_vol; /* front volume */ 438 struct snd_kcontrol *ctl_pan; /* pan */ 439 struct snd_kcontrol *ctl_rvol; /* rear volume */ 440 struct snd_kcontrol *ctl_cvol; /* center volume */ 447 441 448 442 spinlock_t reg_lock; 449 443 450 struct snd_trident_gameport *gameport;451 }; 452 453 int snd_trident_create(s nd_card_t *card,444 struct gameport *gameport; 445 }; 446 447 int snd_trident_create(struct snd_card *card, 454 448 struct pci_dev *pci, 455 449 int pcm_streams, 456 450 int pcm_spdif_device, 457 451 int max_wavetable_size, 458 trident_t ** rtrident);459 int snd_trident_ free(trident_t *trident);460 void snd_trident_gameport(trident_t *trident); 461 462 int snd_trident_ pcm(trident_t * trident, int device, snd_pcm_t**rpcm);463 int snd_trident_ foldback_pcm(trident_t * trident, int device, snd_pcm_t**rpcm);464 int snd_trident_ spdif_pcm(trident_t * trident, int device, snd_pcm_t **rpcm);465 int snd_trident_attach_synthesizer(trident_t * trident); 466 int snd_trident_detach_synthesizer(trident_t * trident);467 snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port);468 void snd_trident_ free_voice(trident_t * trident, snd_trident_voice_t *voice);469 void snd_trident_st art_voice(trident_t * trident, unsigned int voice);470 void snd_trident_ stop_voice(trident_t * trident, unsigned intvoice);471 void snd_trident_write_voice_regs(trident_t * trident, snd_trident_voice_t *voice);472 void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max);452 struct snd_trident ** rtrident); 453 int snd_trident_create_gameport(struct snd_trident *trident); 454 455 int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 456 int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 457 int snd_trident_spdif_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 458 int snd_trident_attach_synthesizer(struct snd_trident * trident); 459 struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, 460 int client, int port); 461 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice); 462 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice); 463 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice); 464 void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice); 465 int snd_trident_suspend(struct pci_dev *pci, pm_message_t state); 466 int snd_trident_resume(struct pci_dev *pci); 473 467 474 468 /* TLB memory allocation */ 475 snd_util_memblk_t *snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream); 476 int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk); 477 snd_util_memblk_t *snd_trident_synth_alloc(trident_t *trident, unsigned int size); 478 int snd_trident_synth_free(trident_t *trident, snd_util_memblk_t *blk); 479 int snd_trident_synth_bzero(trident_t *trident, snd_util_memblk_t *blk, int offset, int size); 480 int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char *data, int size); 469 struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident, 470 struct snd_pcm_substream *substream); 471 int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk); 472 struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size); 473 int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk); 474 int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk, 475 int offset, const char __user *data, int size); 481 476 482 477 #endif /* __SOUND_TRIDENT_H */  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  