Lines Matching refs:voice
35 struct snd_trident_voice * voice,
38 struct snd_trident_voice * voice,
53 static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
57 dev_dbg(trident->card->dev, "Trident voice %i:\n", voice);
58 outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR));
287 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice) in snd_trident_start_voice() argument
289 unsigned int mask = 1 << (voice & 0x1f); in snd_trident_start_voice()
290 unsigned int reg = (voice & 0x20) ? T4D_START_B : T4D_START_A; in snd_trident_start_voice()
311 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice) in snd_trident_stop_voice() argument
313 unsigned int mask = 1 << (voice & 0x1f); in snd_trident_stop_voice()
314 unsigned int reg = (voice & 0x20) ? T4D_STOP_B : T4D_STOP_A; in snd_trident_stop_voice()
432 struct snd_trident_voice * voice) in snd_trident_write_voice_regs() argument
437 regs[1] = voice->LBA; in snd_trident_write_voice_regs()
438 regs[4] = (voice->GVSel << 31) | in snd_trident_write_voice_regs()
439 ((voice->Pan & 0x0000007f) << 24) | in snd_trident_write_voice_regs()
440 ((voice->CTRL & 0x0000000f) << 12); in snd_trident_write_voice_regs()
441 FmcRvolCvol = ((voice->FMC & 3) << 14) | in snd_trident_write_voice_regs()
442 ((voice->RVol & 0x7f) << 7) | in snd_trident_write_voice_regs()
443 (voice->CVol & 0x7f); in snd_trident_write_voice_regs()
447 regs[4] |= voice->number > 31 ? in snd_trident_write_voice_regs()
448 (voice->Vol & 0x000003ff) : in snd_trident_write_voice_regs()
449 ((voice->Vol & 0x00003fc) << (16-2)) | in snd_trident_write_voice_regs()
450 (voice->EC & 0x00000fff); in snd_trident_write_voice_regs()
451 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) | in snd_trident_write_voice_regs()
452 (voice->FMS & 0x0000000f); in snd_trident_write_voice_regs()
453 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff); in snd_trident_write_voice_regs()
454 regs[3] = (voice->Attribute << 16) | FmcRvolCvol; in snd_trident_write_voice_regs()
457 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) | in snd_trident_write_voice_regs()
458 (voice->EC & 0x00000fff); in snd_trident_write_voice_regs()
459 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) | in snd_trident_write_voice_regs()
460 (voice->FMS & 0x0000000f); in snd_trident_write_voice_regs()
461 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff); in snd_trident_write_voice_regs()
465 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) | in snd_trident_write_voice_regs()
466 (voice->EC & 0x00000fff); in snd_trident_write_voice_regs()
467 regs[0] = (voice->Delta << 24) | (voice->CSO & 0x00ffffff); in snd_trident_write_voice_regs()
468 regs[2] = ((voice->Delta << 16) & 0xff000000) | in snd_trident_write_voice_regs()
469 (voice->ESO & 0x00ffffff); in snd_trident_write_voice_regs()
470 regs[3] = (voice->Alpha << 20) | in snd_trident_write_voice_regs()
471 ((voice->FMS & 0x0000000f) << 16) | FmcRvolCvol; in snd_trident_write_voice_regs()
478 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_voice_regs()
486 dev_dbg(trident->card->dev, "written %i channel:\n", voice->number); in snd_trident_write_voice_regs()
515 struct snd_trident_voice * voice, in snd_trident_write_cso_reg() argument
518 voice->CSO = CSO; in snd_trident_write_cso_reg()
519 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_cso_reg()
521 outw(voice->CSO, TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2); in snd_trident_write_cso_reg()
523 outl((voice->Delta << 24) | in snd_trident_write_cso_reg()
524 (voice->CSO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_CSO)); in snd_trident_write_cso_reg()
541 struct snd_trident_voice * voice, in snd_trident_write_eso_reg() argument
544 voice->ESO = ESO; in snd_trident_write_eso_reg()
545 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_eso_reg()
547 outw(voice->ESO, TRID_REG(trident, CH_DX_ESO_DELTA) + 2); in snd_trident_write_eso_reg()
549 outl(((voice->Delta << 16) & 0xff000000) | (voice->ESO & 0x00ffffff), in snd_trident_write_eso_reg()
567 struct snd_trident_voice * voice, in snd_trident_write_vol_reg() argument
570 voice->Vol = Vol; in snd_trident_write_vol_reg()
571 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_vol_reg()
575 outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2)); in snd_trident_write_vol_reg()
579 outw((voice->CTRL << 12) | voice->Vol, in snd_trident_write_vol_reg()
598 struct snd_trident_voice * voice, in snd_trident_write_pan_reg() argument
601 voice->Pan = Pan; in snd_trident_write_pan_reg()
602 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_pan_reg()
603 outb(((voice->GVSel & 0x01) << 7) | (voice->Pan & 0x7f), in snd_trident_write_pan_reg()
620 struct snd_trident_voice * voice, in snd_trident_write_rvol_reg() argument
623 voice->RVol = RVol; in snd_trident_write_rvol_reg()
624 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_rvol_reg()
625 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) | in snd_trident_write_rvol_reg()
626 (voice->CVol & 0x007f), in snd_trident_write_rvol_reg()
644 struct snd_trident_voice * voice, in snd_trident_write_cvol_reg() argument
647 voice->CVol = CVol; in snd_trident_write_cvol_reg()
648 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_cvol_reg()
649 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) | in snd_trident_write_cvol_reg()
650 (voice->CVol & 0x007f), in snd_trident_write_cvol_reg()
787 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_allocate_pcm_mem() local
791 if (voice->memblk) in snd_trident_allocate_pcm_mem()
792 snd_trident_free_pages(trident, voice->memblk); in snd_trident_allocate_pcm_mem()
793 voice->memblk = snd_trident_alloc_pages(trident, substream); in snd_trident_allocate_pcm_mem()
794 if (voice->memblk == NULL) in snd_trident_allocate_pcm_mem()
818 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_allocate_evoice() local
819 struct snd_trident_voice *evoice = voice->extra; in snd_trident_allocate_evoice()
828 voice->extra = evoice; in snd_trident_allocate_evoice()
834 voice->extra = evoice = NULL; in snd_trident_allocate_evoice()
879 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_hw_free() local
880 struct snd_trident_voice *evoice = voice ? voice->extra : NULL; in snd_trident_hw_free()
883 if (voice && voice->memblk) { in snd_trident_hw_free()
884 snd_trident_free_pages(trident, voice->memblk); in snd_trident_hw_free()
885 voice->memblk = NULL; in snd_trident_hw_free()
890 voice->extra = NULL; in snd_trident_hw_free()
910 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_playback_prepare() local
911 struct snd_trident_voice *evoice = voice->extra; in snd_trident_playback_prepare()
917 voice->Delta = snd_trident_convert_rate(runtime->rate); in snd_trident_playback_prepare()
918 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_playback_prepare()
921 if (voice->memblk) in snd_trident_playback_prepare()
922 voice->LBA = voice->memblk->offset; in snd_trident_playback_prepare()
924 voice->LBA = runtime->dma_addr; in snd_trident_playback_prepare()
926 voice->CSO = 0; in snd_trident_playback_prepare()
927 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_playback_prepare()
928 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_playback_prepare()
929 voice->FMC = 3; in snd_trident_playback_prepare()
930 voice->GVSel = 1; in snd_trident_playback_prepare()
931 voice->EC = 0; in snd_trident_playback_prepare()
932 voice->Alpha = 0; in snd_trident_playback_prepare()
933 voice->FMS = 0; in snd_trident_playback_prepare()
934 voice->Vol = mix->vol; in snd_trident_playback_prepare()
935 voice->RVol = mix->rvol; in snd_trident_playback_prepare()
936 voice->CVol = mix->cvol; in snd_trident_playback_prepare()
937 voice->Pan = mix->pan; in snd_trident_playback_prepare()
938 voice->Attribute = 0; in snd_trident_playback_prepare()
940 voice->Attribute = (1<<(30-16))|(2<<(26-16))| in snd_trident_playback_prepare()
943 voice->Attribute = 0; in snd_trident_playback_prepare()
946 snd_trident_write_voice_regs(trident, voice); in snd_trident_playback_prepare()
949 evoice->Delta = voice->Delta; in snd_trident_playback_prepare()
950 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_playback_prepare()
951 evoice->LBA = voice->LBA; in snd_trident_playback_prepare()
954 evoice->CTRL = voice->CTRL; in snd_trident_playback_prepare()
1013 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_capture_prepare() local
1025 voice->LBA = runtime->dma_addr; in snd_trident_capture_prepare()
1026 outl(voice->LBA, TRID_REG(trident, LEGACY_DMAR0)); in snd_trident_capture_prepare()
1027 if (voice->memblk) in snd_trident_capture_prepare()
1028 voice->LBA = voice->memblk->offset; in snd_trident_capture_prepare()
1062 voice->Delta = snd_trident_convert_rate(runtime->rate); in snd_trident_capture_prepare()
1063 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_capture_prepare()
1064 voice->isync = 1; in snd_trident_capture_prepare()
1065 voice->isync_mark = runtime->period_size; in snd_trident_capture_prepare()
1066 voice->isync_max = runtime->buffer_size; in snd_trident_capture_prepare()
1069 voice->CSO = 0; in snd_trident_capture_prepare()
1070 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1; in snd_trident_capture_prepare()
1071 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_capture_prepare()
1072 voice->FMC = 3; in snd_trident_capture_prepare()
1073 voice->RVol = 0x7f; in snd_trident_capture_prepare()
1074 voice->CVol = 0x7f; in snd_trident_capture_prepare()
1075 voice->GVSel = 1; in snd_trident_capture_prepare()
1076 voice->Pan = 0x7f; /* mute */ in snd_trident_capture_prepare()
1077 voice->Vol = 0x3ff; /* mute */ in snd_trident_capture_prepare()
1078 voice->EC = 0; in snd_trident_capture_prepare()
1079 voice->Alpha = 0; in snd_trident_capture_prepare()
1080 voice->FMS = 0; in snd_trident_capture_prepare()
1081 voice->Attribute = 0; in snd_trident_capture_prepare()
1083 snd_trident_write_voice_regs(trident, voice); in snd_trident_capture_prepare()
1122 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_si7018_capture_hw_free() local
1123 struct snd_trident_voice *evoice = voice ? voice->extra : NULL; in snd_trident_si7018_capture_hw_free()
1127 voice->extra = NULL; in snd_trident_si7018_capture_hw_free()
1147 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_si7018_capture_prepare() local
1148 struct snd_trident_voice *evoice = voice->extra; in snd_trident_si7018_capture_prepare()
1152 voice->LBA = runtime->dma_addr; in snd_trident_si7018_capture_prepare()
1153 voice->Delta = snd_trident_convert_adc_rate(runtime->rate); in snd_trident_si7018_capture_prepare()
1154 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_si7018_capture_prepare()
1157 voice->CSO = 0; in snd_trident_si7018_capture_prepare()
1158 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_si7018_capture_prepare()
1159 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_si7018_capture_prepare()
1160 voice->FMC = 0; in snd_trident_si7018_capture_prepare()
1161 voice->RVol = 0; in snd_trident_si7018_capture_prepare()
1162 voice->CVol = 0; in snd_trident_si7018_capture_prepare()
1163 voice->GVSel = 1; in snd_trident_si7018_capture_prepare()
1164 voice->Pan = T4D_DEFAULT_PCM_PAN; in snd_trident_si7018_capture_prepare()
1165 voice->Vol = 0; in snd_trident_si7018_capture_prepare()
1166 voice->EC = 0; in snd_trident_si7018_capture_prepare()
1167 voice->Alpha = 0; in snd_trident_si7018_capture_prepare()
1168 voice->FMS = 0; in snd_trident_si7018_capture_prepare()
1170 voice->Attribute = (2 << (30-16)) | in snd_trident_si7018_capture_prepare()
1175 snd_trident_write_voice_regs(trident, voice); in snd_trident_si7018_capture_prepare()
1179 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_si7018_capture_prepare()
1180 evoice->LBA = voice->LBA; in snd_trident_si7018_capture_prepare()
1183 evoice->CTRL = voice->CTRL; in snd_trident_si7018_capture_prepare()
1218 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_foldback_prepare() local
1219 struct snd_trident_voice *evoice = voice->extra; in snd_trident_foldback_prepare()
1224 if (voice->memblk) in snd_trident_foldback_prepare()
1225 voice->LBA = voice->memblk->offset; in snd_trident_foldback_prepare()
1227 voice->LBA = runtime->dma_addr; in snd_trident_foldback_prepare()
1230 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_foldback_prepare()
1233 voice->Delta = 0x1000; in snd_trident_foldback_prepare()
1234 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size); in snd_trident_foldback_prepare()
1236 voice->CSO = 0; in snd_trident_foldback_prepare()
1237 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_foldback_prepare()
1238 voice->FMC = 3; in snd_trident_foldback_prepare()
1239 voice->RVol = 0x7f; in snd_trident_foldback_prepare()
1240 voice->CVol = 0x7f; in snd_trident_foldback_prepare()
1241 voice->GVSel = 1; in snd_trident_foldback_prepare()
1242 voice->Pan = 0x7f; /* mute */ in snd_trident_foldback_prepare()
1243 voice->Vol = 0x3ff; /* mute */ in snd_trident_foldback_prepare()
1244 voice->EC = 0; in snd_trident_foldback_prepare()
1245 voice->Alpha = 0; in snd_trident_foldback_prepare()
1246 voice->FMS = 0; in snd_trident_foldback_prepare()
1247 voice->Attribute = 0; in snd_trident_foldback_prepare()
1250 outb(((voice->number & 0x3f) | 0x80), TRID_REG(trident, T4D_RCI + voice->foldback_chan)); in snd_trident_foldback_prepare()
1252 snd_trident_write_voice_regs(trident, voice); in snd_trident_foldback_prepare()
1255 evoice->Delta = voice->Delta; in snd_trident_foldback_prepare()
1256 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_foldback_prepare()
1257 evoice->LBA = voice->LBA; in snd_trident_foldback_prepare()
1260 evoice->CTRL = voice->CTRL; in snd_trident_foldback_prepare()
1361 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_spdif_prepare() local
1362 struct snd_trident_voice *evoice = voice->extra; in snd_trident_spdif_prepare()
1372 voice->Delta = snd_trident_convert_rate(runtime->rate); in snd_trident_spdif_prepare()
1373 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_spdif_prepare()
1377 if (voice->memblk) in snd_trident_spdif_prepare()
1378 voice->LBA = voice->memblk->offset; in snd_trident_spdif_prepare()
1380 voice->LBA = LBAO; in snd_trident_spdif_prepare()
1382 voice->isync = 1; in snd_trident_spdif_prepare()
1383 voice->isync3 = 1; in snd_trident_spdif_prepare()
1384 voice->isync_mark = runtime->period_size; in snd_trident_spdif_prepare()
1385 voice->isync_max = runtime->buffer_size; in snd_trident_spdif_prepare()
1389 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1; in snd_trident_spdif_prepare()
1392 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_spdif_prepare()
1394 voice->FMC = 3; in snd_trident_spdif_prepare()
1395 voice->RVol = 0x7f; in snd_trident_spdif_prepare()
1396 voice->CVol = 0x7f; in snd_trident_spdif_prepare()
1397 voice->GVSel = 1; in snd_trident_spdif_prepare()
1398 voice->Pan = 0x7f; in snd_trident_spdif_prepare()
1399 voice->Vol = 0x3ff; in snd_trident_spdif_prepare()
1400 voice->EC = 0; in snd_trident_spdif_prepare()
1401 voice->CSO = 0; in snd_trident_spdif_prepare()
1402 voice->Alpha = 0; in snd_trident_spdif_prepare()
1403 voice->FMS = 0; in snd_trident_spdif_prepare()
1404 voice->Attribute = 0; in snd_trident_spdif_prepare()
1407 snd_trident_write_voice_regs(trident, voice); in snd_trident_spdif_prepare()
1412 outw((voice->CSO & 0xffff), TRID_REG(trident, NX_SPCTRL_SPCSO)); in snd_trident_spdif_prepare()
1413 outb((voice->CSO >> 16), TRID_REG(trident, NX_SPCTRL_SPCSO + 2)); in snd_trident_spdif_prepare()
1422 voice->Delta = 0x800; in snd_trident_spdif_prepare()
1423 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size); in snd_trident_spdif_prepare()
1426 if (voice->memblk) in snd_trident_spdif_prepare()
1427 voice->LBA = voice->memblk->offset; in snd_trident_spdif_prepare()
1429 voice->LBA = runtime->dma_addr; in snd_trident_spdif_prepare()
1431 voice->CSO = 0; in snd_trident_spdif_prepare()
1432 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_spdif_prepare()
1433 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_spdif_prepare()
1434 voice->FMC = 3; in snd_trident_spdif_prepare()
1435 voice->GVSel = 1; in snd_trident_spdif_prepare()
1436 voice->EC = 0; in snd_trident_spdif_prepare()
1437 voice->Alpha = 0; in snd_trident_spdif_prepare()
1438 voice->FMS = 0; in snd_trident_spdif_prepare()
1439 voice->Vol = mix->vol; in snd_trident_spdif_prepare()
1440 voice->RVol = mix->rvol; in snd_trident_spdif_prepare()
1441 voice->CVol = mix->cvol; in snd_trident_spdif_prepare()
1442 voice->Pan = mix->pan; in snd_trident_spdif_prepare()
1443 voice->Attribute = (1<<(30-16))|(7<<(26-16))| in snd_trident_spdif_prepare()
1446 snd_trident_write_voice_regs(trident, voice); in snd_trident_spdif_prepare()
1449 evoice->Delta = voice->Delta; in snd_trident_spdif_prepare()
1450 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_spdif_prepare()
1451 evoice->LBA = voice->LBA; in snd_trident_spdif_prepare()
1454 evoice->CTRL = voice->CTRL; in snd_trident_spdif_prepare()
1503 struct snd_trident_voice *voice, *evoice; in snd_trident_trigger() local
1525 voice = s->runtime->private_data; in snd_trident_trigger()
1526 evoice = voice->extra; in snd_trident_trigger()
1527 what |= 1 << (voice->number & 0x1f); in snd_trident_trigger()
1529 whati |= 1 << (voice->number & 0x1f); in snd_trident_trigger()
1537 voice->running = 1; in snd_trident_trigger()
1538 voice->stimer = val; in snd_trident_trigger()
1540 voice->running = 0; in snd_trident_trigger()
1543 if (voice->capture) in snd_trident_trigger()
1545 if (voice->spdif) in snd_trident_trigger()
1599 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_playback_pointer() local
1602 if (!voice->running) in snd_trident_playback_pointer()
1607 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_playback_pointer()
1638 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_capture_pointer() local
1641 if (!voice->running) in snd_trident_capture_pointer()
1668 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_spdif_pointer() local
1671 if (!voice->running) in snd_trident_spdif_pointer()
1800 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_pcm_free_substream() local
1803 if (voice) { in snd_trident_pcm_free_substream()
1804 trident = voice->trident; in snd_trident_pcm_free_substream()
1805 snd_trident_free_voice(trident, voice); in snd_trident_pcm_free_substream()
1813 struct snd_trident_voice *voice; in snd_trident_playback_open() local
1815 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_playback_open()
1816 if (voice == NULL) in snd_trident_playback_open()
1818 snd_trident_pcm_mixer_build(trident, voice, substream); in snd_trident_playback_open()
1819 voice->substream = substream; in snd_trident_playback_open()
1820 runtime->private_data = voice; in snd_trident_playback_open()
1841 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_playback_close() local
1843 snd_trident_pcm_mixer_free(trident, voice, substream); in snd_trident_playback_close()
1861 struct snd_trident_voice *voice; in snd_trident_spdif_open() local
1864 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_spdif_open()
1865 if (voice == NULL) in snd_trident_spdif_open()
1867 voice->spdif = 1; in snd_trident_spdif_open()
1868 voice->substream = substream; in snd_trident_spdif_open()
1873 runtime->private_data = voice; in snd_trident_spdif_open()
1940 struct snd_trident_voice *voice; in snd_trident_capture_open() local
1943 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_capture_open()
1944 if (voice == NULL) in snd_trident_capture_open()
1946 voice->capture = 1; in snd_trident_capture_open()
1947 voice->substream = substream; in snd_trident_capture_open()
1948 runtime->private_data = voice; in snd_trident_capture_open()
1984 struct snd_trident_voice *voice; in snd_trident_foldback_open() local
1987 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_foldback_open()
1988 if (voice == NULL) in snd_trident_foldback_open()
1990 voice->foldback_chan = substream->number; in snd_trident_foldback_open()
1991 voice->substream = substream; in snd_trident_foldback_open()
1992 runtime->private_data = voice; in snd_trident_foldback_open()
2011 struct snd_trident_voice *voice; in snd_trident_foldback_close() local
2013 voice = runtime->private_data; in snd_trident_foldback_close()
2017 outb(0x00, TRID_REG(trident, T4D_RCI + voice->foldback_chan)); in snd_trident_foldback_close()
2648 if (mix->voice != NULL) in snd_trident_pcm_vol_control_put()
2649 snd_trident_write_vol_reg(trident, mix->voice, val); in snd_trident_pcm_vol_control_put()
2712 if (mix->voice != NULL) in snd_trident_pcm_pan_control_put()
2713 snd_trident_write_pan_reg(trident, mix->voice, val); in snd_trident_pcm_pan_control_put()
2767 if (mix->voice != NULL) in snd_trident_pcm_rvol_control_put()
2768 snd_trident_write_rvol_reg(trident, mix->voice, val); in snd_trident_pcm_rvol_control_put()
2825 if (mix->voice != NULL) in snd_trident_pcm_cvol_control_put()
2826 snd_trident_write_cvol_reg(trident, mix->voice, val); in snd_trident_pcm_cvol_control_put()
2871 struct snd_trident_voice *voice, in snd_trident_pcm_mixer_build() argument
2876 if (snd_BUG_ON(!trident || !voice || !substream)) in snd_trident_pcm_mixer_build()
2879 tmix->voice = voice; in snd_trident_pcm_mixer_build()
2888 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice *voice,… in snd_trident_pcm_mixer_free() argument
2895 tmix->voice = NULL; in snd_trident_pcm_mixer_free()
2990 tmix->voice = NULL; in snd_trident_mixer()
3502 struct snd_trident_voice *voice; in snd_trident_create() local
3583 voice = &trident->synth.voices[i]; in snd_trident_create()
3584 voice->number = i; in snd_trident_create()
3585 voice->trident = trident; in snd_trident_create()
3655 struct snd_trident_voice *voice; in snd_trident_interrupt() local
3676 voice = &trident->synth.voices[channel]; in snd_trident_interrupt()
3677 if (!voice->pcm || voice->substream == NULL) { in snd_trident_interrupt()
3681 delta = (int)stimer - (int)voice->stimer; in snd_trident_interrupt()
3684 if ((unsigned int)delta < voice->spurious_threshold) { in snd_trident_interrupt()
3691 voice->stimer = stimer; in snd_trident_interrupt()
3692 if (voice->isync) { in snd_trident_interrupt()
3693 if (!voice->isync3) { in snd_trident_interrupt()
3698 tmp = voice->isync_max - tmp; in snd_trident_interrupt()
3702 if (tmp < voice->isync_mark) { in snd_trident_interrupt()
3704 tmp = voice->isync_ESO - 7; in snd_trident_interrupt()
3706 tmp = voice->isync_ESO + 2; in snd_trident_interrupt()
3708 snd_trident_stop_voice(trident, voice->number); in snd_trident_interrupt()
3709 snd_trident_write_eso_reg(trident, voice, tmp); in snd_trident_interrupt()
3710 snd_trident_start_voice(trident, voice->number); in snd_trident_interrupt()
3712 } else if (voice->isync2) { in snd_trident_interrupt()
3713 voice->isync2 = 0; in snd_trident_interrupt()
3715 snd_trident_stop_voice(trident, voice->number); in snd_trident_interrupt()
3716 snd_trident_write_cso_reg(trident, voice, voice->isync_mark); in snd_trident_interrupt()
3717 snd_trident_write_eso_reg(trident, voice, voice->ESO); in snd_trident_interrupt()
3718 snd_trident_start_voice(trident, voice->number); in snd_trident_interrupt()
3721 if (voice->extra) { in snd_trident_interrupt()
3723 snd_trident_stop_voice(trident, voice->extra->number); in snd_trident_interrupt()
3724 snd_trident_write_cso_reg(trident, voice->extra, 0); in snd_trident_interrupt()
3725 snd_trident_start_voice(trident, voice->extra->number); in snd_trident_interrupt()
3729 snd_pcm_period_elapsed(voice->substream); in snd_trident_interrupt()
3793 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice) in snd_trident_free_voice() argument
3798 if (voice == NULL || !voice->use) in snd_trident_free_voice()
3800 snd_trident_clear_voices(trident, voice->number, voice->number); in snd_trident_free_voice()
3802 private_free = voice->private_free; in snd_trident_free_voice()
3803 voice->private_free = NULL; in snd_trident_free_voice()
3804 voice->private_data = NULL; in snd_trident_free_voice()
3805 if (voice->pcm) in snd_trident_free_voice()
3806 snd_trident_free_pcm_channel(trident, voice->number); in snd_trident_free_voice()
3807 if (voice->synth) in snd_trident_free_voice()
3808 snd_trident_free_synth_channel(trident, voice->number); in snd_trident_free_voice()
3809 voice->use = voice->pcm = voice->synth = voice->midi = 0; in snd_trident_free_voice()
3810 voice->capture = voice->spdif = 0; in snd_trident_free_voice()
3811 voice->sample_ops = NULL; in snd_trident_free_voice()
3812 voice->substream = NULL; in snd_trident_free_voice()
3813 voice->extra = NULL; in snd_trident_free_voice()
3816 private_free(voice); in snd_trident_free_voice()