• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/pci/trident/

Lines Matching defs:trident

28 #include <sound/trident.h>
72 * the most precision offered by the trident hardware.
195 static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
196 static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode);
197 static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq);
198 static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume);
199 static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop);
200 static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
201 static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data);
223 static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
232 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
238 spin_lock_irqsave(&trident->reg_lock, flags);
240 if (trident->device == TRIDENT_DEVICE_ID_SI7018)
287 snd_trident_stop_voice(trident, voice->number);
292 value = inl(TRID_REG(trident, T4D_SIGN_CSO_A));
298 outl(value,TRID_REG(trident, T4D_SIGN_CSO_A));
301 snd_trident_write_voice_regs(trident, voice);
302 snd_trident_start_voice(trident, voice->number);
304 spin_unlock_irqrestore(&trident->reg_lock, flags);
305 snd_seq_instr_free_use(trident->synth.ilist, instr);
308 static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode)
317 spin_lock_irqsave(&trident->reg_lock, flags);
318 snd_trident_stop_voice(trident, voice->number);
320 spin_unlock_irqrestore(&trident->reg_lock, flags);
324 spin_lock_irqsave(&trident->reg_lock, flags);
325 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
327 spin_unlock_irqrestore(&trident->reg_lock, flags);
332 static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq)
337 spin_lock_irqsave(&trident->reg_lock, flags);
347 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
348 if (trident->device == TRIDENT_DEVICE_ID_NX) {
349 outb((unsigned char) voice->Delta, TRID_REG(trident, CH_NX_DELTA_CSO + 3));
350 outb((unsigned char) (voice->Delta >> 8), TRID_REG(trident, CH_NX_DELTA_ESO + 3));
352 outw((unsigned short) voice->Delta, TRID_REG(trident, CH_DX_ESO_DELTA));
355 spin_unlock_irqrestore(&trident->reg_lock, flags);
358 static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume)
363 spin_lock_irqsave(&trident->reg_lock, flags);
401 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
404 (voice->EC & 0x00000fff), TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
406 outw(value, TRID_REG(trident, CH_DX_FMC_RVOL_CVOL));
407 spin_unlock_irqrestore(&trident->reg_lock, flags);
410 static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop)
417 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
426 spin_lock_irqsave(&trident->reg_lock, flags);
432 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
433 outb((voice->LBA >> 16), TRID_REG(trident, CH_LBA + 2));
434 outw((voice->LBA & 0xffff), TRID_REG(trident, CH_LBA));
435 if (trident->device == TRIDENT_DEVICE_ID_NX) {
436 outb((voice->ESO >> 16), TRID_REG(trident, CH_NX_DELTA_ESO + 2));
437 outw((voice->ESO & 0xffff), TRID_REG(trident, CH_NX_DELTA_ESO));
438 outb((voice->CSO >> 16), TRID_REG(trident, CH_NX_DELTA_CSO + 2));
439 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_NX_DELTA_CSO));
441 outw((voice->ESO & 0xffff), TRID_REG(trident, CH_DX_ESO_DELTA + 2));
442 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_DX_CSO_ALPHA_FMS + 2));
445 spin_unlock_irqrestore(&trident->reg_lock, flags);
446 snd_seq_instr_free_use(trident->synth.ilist, instr);
449 static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
456 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
462 spin_lock_irqsave(&trident->reg_lock, flags);
478 value = inl(TRID_REG(trident, T4D_SIGN_CSO_A));
484 outl(value,TRID_REG(trident, T4D_SIGN_CSO_A));
487 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
488 if (trident->device == TRIDENT_DEVICE_ID_NX) {
489 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_NX_DELTA_CSO));
490 outb((voice->CSO >> 16), TRID_REG(trident, CH_NX_DELTA_CSO + 2));
492 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2);
495 spin_unlock_irqrestore(&trident->reg_lock, flags);
496 snd_seq_instr_free_use(trident->synth.ilist, instr);
499 static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data)
511 struct snd_trident *trident = private_data;
526 if (trident->synth.current_size + size > trident->synth.max_size)
532 if (trident->tlb.entries) {
534 memblk = snd_trident_synth_alloc(trident, size);
537 if (snd_trident_synth_copy_from_user(trident, memblk, 0, data, size) ) {
538 snd_trident_synth_free(trident, memblk);
545 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci),
557 trident->synth.current_size += size;
565 //struct snd_trident *trident = private_data;
586 struct snd_trident *trident = private_data;
594 if (trident->tlb.entries) {
597 snd_trident_synth_free(trident, memblk);
603 dmab.dev.dev = snd_dma_pci_data(trident->pci);
610 trident->synth.current_size -= size;
611 if (trident->synth.current_size < 0) /* shouldn't need this check... */
612 trident->synth.current_size = 0;
617 static void select_instrument(struct snd_trident * trident, struct snd_trident_voice * v)
620 instr = snd_seq_instr_find(trident->synth.ilist, &v->instr, 0, 1);
626 snd_seq_instr_free_use(trident->synth.ilist, instr);
637 v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY);
645 select_instrument(p->trident, v);
651 v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY);
653 select_instrument(p->trident, v);
659 v->sample_ops->sample_start(p->trident, v, ev->data.sample.param.position);
665 v->sample_ops->sample_stop(p->trident, v, ev->data.sample.param.stop_mode);
671 v->sample_ops->sample_freq(p->trident, v, ev->data.sample.param.frequency);
677 v->sample_ops->sample_volume(p->trident, v, &ev->data.sample.param.volume);
683 v->sample_ops->sample_loop(p->trident, v, &ev->data.sample.param.loop);
689 v->sample_ops->sample_pos(p->trident, v, ev->data.sample.param.position);
695 v->sample_ops->sample_private1(p->trident, v, (unsigned char *) &ev->data.sample.param.raw8);
716 struct snd_trident *trident = p->trident;
724 v = &trident->synth.voices[voice];
728 spin_lock_irqsave(&trident->event_lock, flags);
730 spin_unlock_irqrestore(&trident->event_lock, flags);
740 static void snd_trident_synth_free_voices(struct snd_trident * trident, int client, int port)
746 voice = &trident->synth.voices[idx];
748 snd_trident_free_voice(trident, voice);
755 struct snd_trident *trident = port->trident;
762 spin_lock_irqsave(&trident->reg_lock, flags);
764 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_SYNTH, info->sender.client, info->sender.port);
766 snd_trident_synth_free_voices(trident, info->sender.client, info->sender.port);
767 spin_unlock_irqrestore(&trident->reg_lock, flags);
774 spin_unlock_irqrestore(&trident->reg_lock, flags);
781 struct snd_trident *trident = port->trident;
784 spin_lock_irqsave(&trident->reg_lock, flags);
785 snd_trident_synth_free_voices(trident, info->sender.client, info->sender.port);
786 spin_unlock_irqrestore(&trident->reg_lock, flags);
800 snd_seq_instr_list_free_cond(p->trident->synth.ilist, &ifree, client, 0);
823 snd_seq_instr_event(&p->trident->synth.simple_ops.kops,
824 p->trident->synth.ilist, ev,
825 p->trident->synth.seq_client, atomic, hop);
837 struct snd_trident *trident = private_data;
841 spin_lock_irqsave(&trident->event_lock, flags);
843 pvoice = &trident->synth.voices[idx];
846 pvoice->sample_ops->sample_stop(trident, pvoice, SAMPLE_STOP_IMMEDIATELY);
848 snd_trident_stop_voice(trident, pvoice->number);
853 spin_unlock_irqrestore(&trident->event_lock, flags);
868 static int snd_trident_synth_create_port(struct snd_trident * trident, int idx)
876 p = &trident->synth.seq_ports[idx];
881 p->trident = trident;
882 p->client = trident->synth.seq_client;
893 switch (trident->device) {
899 p->chset->port = snd_seq_event_port_attach(trident->synth.seq_client,
923 struct snd_trident *trident;
929 trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
930 if (trident == NULL)
933 trident->synth.seq_client = -1;
937 switch (trident->device) {
942 client = trident->synth.seq_client =
943 snd_seq_create_kernel_client(trident->card, 1, str);
948 snd_trident_synth_create_port(trident, i);
950 trident->synth.ilist = snd_seq_instr_list_new();
951 if (trident->synth.ilist == NULL) {
953 trident->synth.seq_client = -1;
956 trident->synth.ilist->flags = SNDRV_SEQ_INSTR_FLG_DIRECT;
958 simpleops = &trident->synth.simple_ops;
959 snd_seq_simple_init(simpleops, trident, NULL);
977 struct snd_trident *trident;
979 trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
980 if (trident == NULL)
983 if (trident->synth.seq_client >= 0) {
984 snd_seq_delete_kernel_client(trident->synth.seq_client);
985 trident->synth.seq_client = -1;
987 if (trident->synth.ilist)
988 snd_seq_instr_list_free(&trident->synth.ilist);