• 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 refs:voice

50 				       struct snd_trident_voice * voice,
53 struct snd_trident_voice * voice,
247 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
249 Description: Start a voice, any channel 0 thru 63.
253 Parameters : voice - Voice number 0 thru n.
260 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
262 unsigned int mask = 1 << (voice & 0x1f);
263 unsigned int reg = (voice & 0x20) ? T4D_START_B : T4D_START_A;
271 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
273 Description: Stop a voice, any channel 0 thru 63.
277 Parameters : voice - Voice number 0 thru n.
284 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
286 unsigned int mask = 1 << (voice & 0x1f);
287 unsigned int reg = (voice & 0x20) ? T4D_STOP_B : T4D_STOP_A;
399 voice - synthesizer voice structure
405 struct snd_trident_voice * voice)
410 regs[1] = voice->LBA;
411 regs[4] = (voice->GVSel << 31) |
412 ((voice->Pan & 0x0000007f) << 24) |
413 ((voice->CTRL & 0x0000000f) << 12);
414 FmcRvolCvol = ((voice->FMC & 3) << 14) |
415 ((voice->RVol & 0x7f) << 7) |
416 (voice->CVol & 0x7f);
420 regs[4] |= voice->number > 31 ?
421 (voice->Vol & 0x000003ff) :
422 ((voice->Vol & 0x00003fc) << (16-2)) |
423 (voice->EC & 0x00000fff);
424 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) |
425 (voice->FMS & 0x0000000f);
426 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff);
427 regs[3] = (voice->Attribute << 16) | FmcRvolCvol;
430 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) |
431 (voice->EC & 0x00000fff);
432 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) |
433 (voice->FMS & 0x0000000f);
434 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff);
438 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) |
439 (voice->EC & 0x00000fff);
440 regs[0] = (voice->Delta << 24) | (voice->CSO & 0x00ffffff);
441 regs[2] = ((voice->Delta << 16) & 0xff000000) |
442 (voice->ESO & 0x00ffffff);
443 regs[3] = (voice->Alpha << 20) |
444 ((voice->FMS & 0x0000000f) << 16) | FmcRvolCvol;
451 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
469 voice - synthesizer voice structure
475 struct snd_trident_voice * voice,
478 voice->CSO = CSO;
479 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
481 outw(voice->CSO, TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2);
483 outl((voice->Delta << 24) |
484 (voice->CSO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_CSO));
495 voice - synthesizer voice structure
501 struct snd_trident_voice * voice,
504 voice->ESO = ESO;
505 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
507 outw(voice->ESO, TRID_REG(trident, CH_DX_ESO_DELTA) + 2);
509 outl(((voice->Delta << 16) & 0xff000000) | (voice->ESO & 0x00ffffff),
517 Description: This routine will write the new voice volume
521 voice - synthesizer voice structure
522 Vol - new voice volume
527 struct snd_trident_voice * voice,
530 voice->Vol = Vol;
531 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
535 outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2));
538 // printk("voice->Vol = 0x%x\n", voice->Vol);
539 outw((voice->CTRL << 12) | voice->Vol,
548 Description: This routine will write the new voice pan
552 voice - synthesizer voice structure
558 struct snd_trident_voice * voice,
561 voice->Pan = Pan;
562 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
563 outb(((voice->GVSel & 0x01) << 7) | (voice->Pan & 0x7f),
574 voice - synthesizer voice structure
580 struct snd_trident_voice * voice,
583 voice->RVol = RVol;
584 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
585 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) |
586 (voice->CVol & 0x007f),
598 voice - synthesizer voice structure
604 struct snd_trident_voice * voice,
607 voice->CVol = CVol;
608 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
609 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) |
610 (voice->CVol & 0x007f),
767 struct snd_trident_voice *voice = runtime->private_data;
774 if (voice->memblk)
775 snd_trident_free_pages(trident, voice->memblk);
776 voice->memblk = snd_trident_alloc_pages(trident, substream);
777 if (voice->memblk == NULL)
787 Description: Allocate extra voice as interrupt generator
801 struct snd_trident_voice *voice = runtime->private_data;
802 struct snd_trident_voice *evoice = voice->extra;
804 /* voice management */
811 voice->extra = evoice;
817 voice->extra = evoice = NULL;
862 struct snd_trident_voice *voice = runtime->private_data;
863 struct snd_trident_voice *evoice = voice ? voice->extra : NULL;
866 if (voice && voice->memblk) {
867 snd_trident_free_pages(trident, voice->memblk);
868 voice->memblk = NULL;
874 voice->extra = NULL;
894 struct snd_trident_voice *voice = runtime->private_data;
895 struct snd_trident_voice *evoice = voice->extra;
901 voice->Delta = snd_trident_convert_rate(runtime->rate);
902 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
905 if (voice->memblk)
906 voice->LBA = voice->memblk->offset;
908 voice->LBA = runtime->dma_addr;
910 voice->CSO = 0;
911 voice->ESO = runtime->buffer_size - 1; /* in samples */
912 voice->CTRL = snd_trident_control_mode(substream);
913 voice->FMC = 3;
914 voice->GVSel = 1;
915 voice->EC = 0;
916 voice->Alpha = 0;
917 voice->FMS = 0;
918 voice->Vol = mix->vol;
919 voice->RVol = mix->rvol;
920 voice->CVol = mix->cvol;
921 voice->Pan = mix->pan;
922 voice->Attribute = 0;
923 voice->Attribute = 0;
925 snd_trident_write_voice_regs(trident, voice);
928 evoice->Delta = voice->Delta;
929 evoice->spurious_threshold = voice->spurious_threshold;
930 evoice->LBA = voice->LBA;
933 evoice->CTRL = voice->CTRL;
987 struct snd_trident_voice *voice = runtime->private_data;
999 voice->LBA = runtime->dma_addr;
1000 outl(voice->LBA, TRID_REG(trident, LEGACY_DMAR0));
1001 if (voice->memblk)
1002 voice->LBA = voice->memblk->offset;
1036 voice->Delta = snd_trident_convert_rate(runtime->rate);
1037 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
1038 voice->isync = 1;
1039 voice->isync_mark = runtime->period_size;
1040 voice->isync_max = runtime->buffer_size;
1042 // Set voice parameters
1043 voice->CSO = 0;
1044 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1;
1045 voice->CTRL = snd_trident_control_mode(substream);
1046 voice->FMC = 3;
1047 voice->RVol = 0x7f;
1048 voice->CVol = 0x7f;
1049 voice->GVSel = 1;
1050 voice->Pan = 0x7f; /* mute */
1051 voice->Vol = 0x3ff; /* mute */
1052 voice->EC = 0;
1053 voice->Alpha = 0;
1054 voice->FMS = 0;
1055 voice->Attribute = 0;
1057 snd_trident_write_voice_regs(trident, voice);
1101 struct snd_trident_voice *voice = runtime->private_data;
1102 struct snd_trident_voice *evoice = voice ? voice->extra : NULL;
1107 voice->extra = NULL;
1127 struct snd_trident_voice *voice = runtime->private_data;
1128 struct snd_trident_voice *evoice = voice->extra;
1132 voice->LBA = runtime->dma_addr;
1133 voice->Delta = snd_trident_convert_adc_rate(runtime->rate);
1134 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
1136 // Set voice parameters
1137 voice->CSO = 0;
1138 voice->ESO = runtime->buffer_size - 1; /* in samples */
1139 voice->CTRL = snd_trident_control_mode(substream);
1140 voice->FMC = 0;
1141 voice->RVol = 0;
1142 voice->CVol = 0;
1143 voice->GVSel = 1;
1144 voice->Pan = T4D_DEFAULT_PCM_PAN;
1145 voice->Vol = 0;
1146 voice->EC = 0;
1147 voice->Alpha = 0;
1148 voice->FMS = 0;
1150 voice->Attribute = (2 << (30-16)) |
1155 snd_trident_write_voice_regs(trident, voice);
1159 evoice->spurious_threshold = voice->spurious_threshold;
1160 evoice->LBA = voice->LBA;
1163 evoice->CTRL = voice->CTRL;
1198 struct snd_trident_voice *voice = runtime->private_data;
1199 struct snd_trident_voice *evoice = voice->extra;
1204 if (voice->memblk)
1205 voice->LBA = voice->memblk->offset;
1207 voice->LBA = runtime->dma_addr;
1210 voice->ESO = runtime->buffer_size - 1; /* in samples */
1213 voice->Delta = 0x1000;
1214 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size);
1216 voice->CSO = 0;
1217 voice->CTRL = snd_trident_control_mode(substream);
1218 voice->FMC = 3;
1219 voice->RVol = 0x7f;
1220 voice->CVol = 0x7f;
1221 voice->GVSel = 1;
1222 voice->Pan = 0x7f; /* mute */
1223 voice->Vol = 0x3ff; /* mute */
1224 voice->EC = 0;
1225 voice->Alpha = 0;
1226 voice->FMS = 0;
1227 voice->Attribute = 0;
1230 outb(((voice->number & 0x3f) | 0x80), TRID_REG(trident, T4D_RCI + voice->foldback_chan));
1232 snd_trident_write_voice_regs(trident, voice);
1235 evoice->Delta = voice->Delta;
1236 evoice->spurious_threshold = voice->spurious_threshold;
1237 evoice->LBA = voice->LBA;
1240 evoice->CTRL = voice->CTRL;
1341 struct snd_trident_voice *voice = runtime->private_data;
1342 struct snd_trident_voice *evoice = voice->extra;
1352 voice->Delta = snd_trident_convert_rate(runtime->rate);
1353 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
1357 if (voice->memblk)
1358 voice->LBA = voice->memblk->offset;
1360 voice->LBA = LBAO;
1362 voice->isync = 1;
1363 voice->isync3 = 1;
1364 voice->isync_mark = runtime->period_size;
1365 voice->isync_max = runtime->buffer_size;
1369 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1;
1372 voice->CTRL = snd_trident_control_mode(substream);
1374 voice->FMC = 3;
1375 voice->RVol = 0x7f;
1376 voice->CVol = 0x7f;
1377 voice->GVSel = 1;
1378 voice->Pan = 0x7f;
1379 voice->Vol = 0x3ff;
1380 voice->EC = 0;
1381 voice->CSO = 0;
1382 voice->Alpha = 0;
1383 voice->FMS = 0;
1384 voice->Attribute = 0;
1387 snd_trident_write_voice_regs(trident, voice);
1392 outw((voice->CSO & 0xffff), TRID_REG(trident, NX_SPCTRL_SPCSO));
1393 outb((voice->CSO >> 16), TRID_REG(trident, NX_SPCTRL_SPCSO + 2));
1402 voice->Delta = 0x800;
1403 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size);
1406 if (voice->memblk)
1407 voice->LBA = voice->memblk->offset;
1409 voice->LBA = runtime->dma_addr;
1411 voice->CSO = 0;
1412 voice->ESO = runtime->buffer_size - 1; /* in samples */
1413 voice->CTRL = snd_trident_control_mode(substream);
1414 voice->FMC = 3;
1415 voice->GVSel = 1;
1416 voice->EC = 0;
1417 voice->Alpha = 0;
1418 voice->FMS = 0;
1419 voice->Vol = mix->vol;
1420 voice->RVol = mix->rvol;
1421 voice->CVol = mix->cvol;
1422 voice->Pan = mix->pan;
1423 voice->Attribute = (1<<(30-16))|(7<<(26-16))|
1426 snd_trident_write_voice_regs(trident, voice);
1429 evoice->Delta = voice->Delta;
1430 evoice->spurious_threshold = voice->spurious_threshold;
1431 evoice->LBA = voice->LBA;
1434 evoice->CTRL = voice->CTRL;
1483 struct snd_trident_voice *voice, *evoice;
1505 voice = s->runtime->private_data;
1506 evoice = voice->extra;
1507 what |= 1 << (voice->number & 0x1f);
1509 whati |= 1 << (voice->number & 0x1f);
1517 voice->running = 1;
1518 voice->stimer = val;
1520 voice->running = 0;
1523 if (voice->capture)
1525 if (voice->spdif)
1576 struct snd_trident_voice *voice = runtime->private_data;
1579 if (!voice->running)
1584 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
1615 struct snd_trident_voice *voice = runtime->private_data;
1618 if (!voice->running)
1645 struct snd_trident_voice *voice = runtime->private_data;
1648 if (!voice->running)
1777 struct snd_trident_voice *voice = runtime->private_data;
1780 if (voice) {
1781 trident = voice->trident;
1782 snd_trident_free_voice(trident, voice);
1790 struct snd_trident_voice *voice;
1792 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1793 if (voice == NULL)
1795 snd_trident_pcm_mixer_build(trident, voice, substream);
1796 voice->substream = substream;
1797 runtime->private_data = voice;
1818 struct snd_trident_voice *voice = runtime->private_data;
1820 snd_trident_pcm_mixer_free(trident, voice, substream);
1838 struct snd_trident_voice *voice;
1841 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1842 if (voice == NULL)
1844 voice->spdif = 1;
1845 voice->substream = substream;
1850 runtime->private_data = voice;
1917 struct snd_trident_voice *voice;
1920 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1921 if (voice == NULL)
1923 voice->capture = 1;
1924 voice->substream = substream;
1925 runtime->private_data = voice;
1961 struct snd_trident_voice *voice;
1964 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
1965 if (voice == NULL)
1967 voice->foldback_chan = substream->number;
1968 voice->substream = substream;
1969 runtime->private_data = voice;
1988 struct snd_trident_voice *voice;
1990 voice = runtime->private_data;
1994 outb(0x00, TRID_REG(trident, T4D_RCI + voice->foldback_chan));
2658 if (mix->voice != NULL)
2659 snd_trident_write_vol_reg(trident, mix->voice, val);
2721 if (mix->voice != NULL)
2722 snd_trident_write_pan_reg(trident, mix->voice, val);
2776 if (mix->voice != NULL)
2777 snd_trident_write_rvol_reg(trident, mix->voice, val);
2834 if (mix->voice != NULL)
2835 snd_trident_write_cvol_reg(trident, mix->voice, val);
2880 struct snd_trident_voice *voice,
2885 snd_assert(trident != NULL && voice != NULL && substream != NULL, return -EINVAL);
2887 tmix->voice = voice;
2896 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice *voice, struct snd_pcm_substream *substream)
2902 tmix->voice = NULL;
2980 tmix->voice = NULL;
3489 struct snd_trident_voice *voice;
3589 voice = &trident->synth.voices[i];
3590 voice->number = i;
3591 voice->trident = trident;
3672 struct snd_trident_voice *voice;
3693 voice = &trident->synth.voices[channel];
3694 if (!voice->pcm || voice->substream == NULL) {
3698 delta = (int)stimer - (int)voice->stimer;
3701 if ((unsigned int)delta < voice->spurious_threshold) {
3708 voice->stimer = stimer;
3709 if (voice->isync) {
3710 if (!voice->isync3) {
3715 tmp = voice->isync_max - tmp;
3719 if (tmp < voice->isync_mark) {
3721 tmp = voice->isync_ESO - 7;
3723 tmp = voice->isync_ESO + 2;
3724 /* update ESO for IRQ voice to preserve sync */
3725 snd_trident_stop_voice(trident, voice->number);
3726 snd_trident_write_eso_reg(trident, voice, tmp);
3727 snd_trident_start_voice(trident, voice->number);
3729 } else if (voice->isync2) {
3730 voice->isync2 = 0;
3731 /* write original ESO and update CSO for IRQ voice to preserve sync */
3732 snd_trident_stop_voice(trident, voice->number);
3733 snd_trident_write_cso_reg(trident, voice, voice->isync_mark);
3734 snd_trident_write_eso_reg(trident, voice, voice->ESO);
3735 snd_trident_start_voice(trident, voice->number);
3738 snd_pcm_period_elapsed(voice->substream);
3825 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice)
3831 if (voice == NULL || !voice->use)
3833 snd_trident_clear_voices(trident, voice->number, voice->number);
3835 private_free = voice->private_free;
3836 private_data = voice->private_data;
3837 voice->private_free = NULL;
3838 voice->private_data = NULL;
3839 if (voice->pcm)
3840 snd_trident_free_pcm_channel(trident, voice->number);
3841 if (voice->synth)
3842 snd_trident_free_synth_channel(trident, voice->number);
3843 voice->use = voice->pcm = voice->synth = voice->midi = 0;
3844 voice->capture = voice->spdif = 0;
3845 voice->sample_ops = NULL;
3846 voice->substream = NULL;
3847 voice->extra = NULL;
3850 private_free(voice);