Lines Matching refs:voice

49 				       struct snd_trident_voice * voice,
52 struct snd_trident_voice * voice,
67 static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
71 dev_dbg(trident->card->dev, "Trident voice %i:\n", voice);
72 outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR));
301 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice) in snd_trident_start_voice() argument
303 unsigned int mask = 1 << (voice & 0x1f); in snd_trident_start_voice()
304 unsigned int reg = (voice & 0x20) ? T4D_START_B : T4D_START_A; in snd_trident_start_voice()
325 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice) in snd_trident_stop_voice() argument
327 unsigned int mask = 1 << (voice & 0x1f); in snd_trident_stop_voice()
328 unsigned int reg = (voice & 0x20) ? T4D_STOP_B : T4D_STOP_A; in snd_trident_stop_voice()
446 struct snd_trident_voice * voice) in snd_trident_write_voice_regs() argument
451 regs[1] = voice->LBA; in snd_trident_write_voice_regs()
452 regs[4] = (voice->GVSel << 31) | in snd_trident_write_voice_regs()
453 ((voice->Pan & 0x0000007f) << 24) | in snd_trident_write_voice_regs()
454 ((voice->CTRL & 0x0000000f) << 12); in snd_trident_write_voice_regs()
455 FmcRvolCvol = ((voice->FMC & 3) << 14) | in snd_trident_write_voice_regs()
456 ((voice->RVol & 0x7f) << 7) | in snd_trident_write_voice_regs()
457 (voice->CVol & 0x7f); in snd_trident_write_voice_regs()
461 regs[4] |= voice->number > 31 ? in snd_trident_write_voice_regs()
462 (voice->Vol & 0x000003ff) : in snd_trident_write_voice_regs()
463 ((voice->Vol & 0x00003fc) << (16-2)) | in snd_trident_write_voice_regs()
464 (voice->EC & 0x00000fff); in snd_trident_write_voice_regs()
465 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) | in snd_trident_write_voice_regs()
466 (voice->FMS & 0x0000000f); in snd_trident_write_voice_regs()
467 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff); in snd_trident_write_voice_regs()
468 regs[3] = (voice->Attribute << 16) | FmcRvolCvol; in snd_trident_write_voice_regs()
471 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) | in snd_trident_write_voice_regs()
472 (voice->EC & 0x00000fff); in snd_trident_write_voice_regs()
473 regs[0] = (voice->CSO << 16) | ((voice->Alpha & 0x00000fff) << 4) | in snd_trident_write_voice_regs()
474 (voice->FMS & 0x0000000f); in snd_trident_write_voice_regs()
475 regs[2] = (voice->ESO << 16) | (voice->Delta & 0x0ffff); in snd_trident_write_voice_regs()
479 regs[4] |= ((voice->Vol & 0x000003fc) << (16-2)) | in snd_trident_write_voice_regs()
480 (voice->EC & 0x00000fff); in snd_trident_write_voice_regs()
481 regs[0] = (voice->Delta << 24) | (voice->CSO & 0x00ffffff); in snd_trident_write_voice_regs()
482 regs[2] = ((voice->Delta << 16) & 0xff000000) | in snd_trident_write_voice_regs()
483 (voice->ESO & 0x00ffffff); in snd_trident_write_voice_regs()
484 regs[3] = (voice->Alpha << 20) | in snd_trident_write_voice_regs()
485 ((voice->FMS & 0x0000000f) << 16) | FmcRvolCvol; in snd_trident_write_voice_regs()
492 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_voice_regs()
500 dev_dbg(trident->card->dev, "written %i channel:\n", voice->number); in snd_trident_write_voice_regs()
529 struct snd_trident_voice * voice, in snd_trident_write_cso_reg() argument
532 voice->CSO = CSO; in snd_trident_write_cso_reg()
533 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_cso_reg()
535 outw(voice->CSO, TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2); in snd_trident_write_cso_reg()
537 outl((voice->Delta << 24) | in snd_trident_write_cso_reg()
538 (voice->CSO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_CSO)); in snd_trident_write_cso_reg()
555 struct snd_trident_voice * voice, in snd_trident_write_eso_reg() argument
558 voice->ESO = ESO; in snd_trident_write_eso_reg()
559 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_eso_reg()
561 outw(voice->ESO, TRID_REG(trident, CH_DX_ESO_DELTA) + 2); in snd_trident_write_eso_reg()
563 outl(((voice->Delta << 16) & 0xff000000) | (voice->ESO & 0x00ffffff), in snd_trident_write_eso_reg()
581 struct snd_trident_voice * voice, in snd_trident_write_vol_reg() argument
584 voice->Vol = Vol; in snd_trident_write_vol_reg()
585 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_vol_reg()
589 outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2)); in snd_trident_write_vol_reg()
593 outw((voice->CTRL << 12) | voice->Vol, in snd_trident_write_vol_reg()
612 struct snd_trident_voice * voice, in snd_trident_write_pan_reg() argument
615 voice->Pan = Pan; in snd_trident_write_pan_reg()
616 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_pan_reg()
617 outb(((voice->GVSel & 0x01) << 7) | (voice->Pan & 0x7f), in snd_trident_write_pan_reg()
634 struct snd_trident_voice * voice, in snd_trident_write_rvol_reg() argument
637 voice->RVol = RVol; in snd_trident_write_rvol_reg()
638 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_rvol_reg()
639 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) | in snd_trident_write_rvol_reg()
640 (voice->CVol & 0x007f), in snd_trident_write_rvol_reg()
658 struct snd_trident_voice * voice, in snd_trident_write_cvol_reg() argument
661 voice->CVol = CVol; in snd_trident_write_cvol_reg()
662 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_write_cvol_reg()
663 outw(((voice->FMC & 0x0003) << 14) | ((voice->RVol & 0x007f) << 7) | in snd_trident_write_cvol_reg()
664 (voice->CVol & 0x007f), in snd_trident_write_cvol_reg()
824 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_allocate_pcm_mem() local
831 if (voice->memblk) in snd_trident_allocate_pcm_mem()
832 snd_trident_free_pages(trident, voice->memblk); in snd_trident_allocate_pcm_mem()
833 voice->memblk = snd_trident_alloc_pages(trident, substream); in snd_trident_allocate_pcm_mem()
834 if (voice->memblk == NULL) in snd_trident_allocate_pcm_mem()
858 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_allocate_evoice() local
859 struct snd_trident_voice *evoice = voice->extra; in snd_trident_allocate_evoice()
868 voice->extra = evoice; in snd_trident_allocate_evoice()
874 voice->extra = evoice = NULL; in snd_trident_allocate_evoice()
919 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_hw_free() local
920 struct snd_trident_voice *evoice = voice ? voice->extra : NULL; in snd_trident_hw_free()
923 if (voice && voice->memblk) { in snd_trident_hw_free()
924 snd_trident_free_pages(trident, voice->memblk); in snd_trident_hw_free()
925 voice->memblk = NULL; in snd_trident_hw_free()
931 voice->extra = NULL; in snd_trident_hw_free()
951 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_playback_prepare() local
952 struct snd_trident_voice *evoice = voice->extra; in snd_trident_playback_prepare()
958 voice->Delta = snd_trident_convert_rate(runtime->rate); in snd_trident_playback_prepare()
959 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_playback_prepare()
962 if (voice->memblk) in snd_trident_playback_prepare()
963 voice->LBA = voice->memblk->offset; in snd_trident_playback_prepare()
965 voice->LBA = runtime->dma_addr; in snd_trident_playback_prepare()
967 voice->CSO = 0; in snd_trident_playback_prepare()
968 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_playback_prepare()
969 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_playback_prepare()
970 voice->FMC = 3; in snd_trident_playback_prepare()
971 voice->GVSel = 1; in snd_trident_playback_prepare()
972 voice->EC = 0; in snd_trident_playback_prepare()
973 voice->Alpha = 0; in snd_trident_playback_prepare()
974 voice->FMS = 0; in snd_trident_playback_prepare()
975 voice->Vol = mix->vol; in snd_trident_playback_prepare()
976 voice->RVol = mix->rvol; in snd_trident_playback_prepare()
977 voice->CVol = mix->cvol; in snd_trident_playback_prepare()
978 voice->Pan = mix->pan; in snd_trident_playback_prepare()
979 voice->Attribute = 0; in snd_trident_playback_prepare()
981 voice->Attribute = (1<<(30-16))|(2<<(26-16))| in snd_trident_playback_prepare()
984 voice->Attribute = 0; in snd_trident_playback_prepare()
987 snd_trident_write_voice_regs(trident, voice); in snd_trident_playback_prepare()
990 evoice->Delta = voice->Delta; in snd_trident_playback_prepare()
991 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_playback_prepare()
992 evoice->LBA = voice->LBA; in snd_trident_playback_prepare()
995 evoice->CTRL = voice->CTRL; in snd_trident_playback_prepare()
1054 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_capture_prepare() local
1066 voice->LBA = runtime->dma_addr; in snd_trident_capture_prepare()
1067 outl(voice->LBA, TRID_REG(trident, LEGACY_DMAR0)); in snd_trident_capture_prepare()
1068 if (voice->memblk) in snd_trident_capture_prepare()
1069 voice->LBA = voice->memblk->offset; in snd_trident_capture_prepare()
1103 voice->Delta = snd_trident_convert_rate(runtime->rate); in snd_trident_capture_prepare()
1104 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_capture_prepare()
1105 voice->isync = 1; in snd_trident_capture_prepare()
1106 voice->isync_mark = runtime->period_size; in snd_trident_capture_prepare()
1107 voice->isync_max = runtime->buffer_size; in snd_trident_capture_prepare()
1110 voice->CSO = 0; in snd_trident_capture_prepare()
1111 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1; in snd_trident_capture_prepare()
1112 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_capture_prepare()
1113 voice->FMC = 3; in snd_trident_capture_prepare()
1114 voice->RVol = 0x7f; in snd_trident_capture_prepare()
1115 voice->CVol = 0x7f; in snd_trident_capture_prepare()
1116 voice->GVSel = 1; in snd_trident_capture_prepare()
1117 voice->Pan = 0x7f; /* mute */ in snd_trident_capture_prepare()
1118 voice->Vol = 0x3ff; /* mute */ in snd_trident_capture_prepare()
1119 voice->EC = 0; in snd_trident_capture_prepare()
1120 voice->Alpha = 0; in snd_trident_capture_prepare()
1121 voice->FMS = 0; in snd_trident_capture_prepare()
1122 voice->Attribute = 0; in snd_trident_capture_prepare()
1124 snd_trident_write_voice_regs(trident, voice); in snd_trident_capture_prepare()
1168 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_si7018_capture_hw_free() local
1169 struct snd_trident_voice *evoice = voice ? voice->extra : NULL; in snd_trident_si7018_capture_hw_free()
1174 voice->extra = NULL; in snd_trident_si7018_capture_hw_free()
1194 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_si7018_capture_prepare() local
1195 struct snd_trident_voice *evoice = voice->extra; in snd_trident_si7018_capture_prepare()
1199 voice->LBA = runtime->dma_addr; in snd_trident_si7018_capture_prepare()
1200 voice->Delta = snd_trident_convert_adc_rate(runtime->rate); in snd_trident_si7018_capture_prepare()
1201 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_si7018_capture_prepare()
1204 voice->CSO = 0; in snd_trident_si7018_capture_prepare()
1205 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_si7018_capture_prepare()
1206 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_si7018_capture_prepare()
1207 voice->FMC = 0; in snd_trident_si7018_capture_prepare()
1208 voice->RVol = 0; in snd_trident_si7018_capture_prepare()
1209 voice->CVol = 0; in snd_trident_si7018_capture_prepare()
1210 voice->GVSel = 1; in snd_trident_si7018_capture_prepare()
1211 voice->Pan = T4D_DEFAULT_PCM_PAN; in snd_trident_si7018_capture_prepare()
1212 voice->Vol = 0; in snd_trident_si7018_capture_prepare()
1213 voice->EC = 0; in snd_trident_si7018_capture_prepare()
1214 voice->Alpha = 0; in snd_trident_si7018_capture_prepare()
1215 voice->FMS = 0; in snd_trident_si7018_capture_prepare()
1217 voice->Attribute = (2 << (30-16)) | in snd_trident_si7018_capture_prepare()
1222 snd_trident_write_voice_regs(trident, voice); in snd_trident_si7018_capture_prepare()
1226 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_si7018_capture_prepare()
1227 evoice->LBA = voice->LBA; in snd_trident_si7018_capture_prepare()
1230 evoice->CTRL = voice->CTRL; in snd_trident_si7018_capture_prepare()
1265 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_foldback_prepare() local
1266 struct snd_trident_voice *evoice = voice->extra; in snd_trident_foldback_prepare()
1271 if (voice->memblk) in snd_trident_foldback_prepare()
1272 voice->LBA = voice->memblk->offset; in snd_trident_foldback_prepare()
1274 voice->LBA = runtime->dma_addr; in snd_trident_foldback_prepare()
1277 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_foldback_prepare()
1280 voice->Delta = 0x1000; in snd_trident_foldback_prepare()
1281 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size); in snd_trident_foldback_prepare()
1283 voice->CSO = 0; in snd_trident_foldback_prepare()
1284 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_foldback_prepare()
1285 voice->FMC = 3; in snd_trident_foldback_prepare()
1286 voice->RVol = 0x7f; in snd_trident_foldback_prepare()
1287 voice->CVol = 0x7f; in snd_trident_foldback_prepare()
1288 voice->GVSel = 1; in snd_trident_foldback_prepare()
1289 voice->Pan = 0x7f; /* mute */ in snd_trident_foldback_prepare()
1290 voice->Vol = 0x3ff; /* mute */ in snd_trident_foldback_prepare()
1291 voice->EC = 0; in snd_trident_foldback_prepare()
1292 voice->Alpha = 0; in snd_trident_foldback_prepare()
1293 voice->FMS = 0; in snd_trident_foldback_prepare()
1294 voice->Attribute = 0; in snd_trident_foldback_prepare()
1297 outb(((voice->number & 0x3f) | 0x80), TRID_REG(trident, T4D_RCI + voice->foldback_chan)); in snd_trident_foldback_prepare()
1299 snd_trident_write_voice_regs(trident, voice); in snd_trident_foldback_prepare()
1302 evoice->Delta = voice->Delta; in snd_trident_foldback_prepare()
1303 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_foldback_prepare()
1304 evoice->LBA = voice->LBA; in snd_trident_foldback_prepare()
1307 evoice->CTRL = voice->CTRL; in snd_trident_foldback_prepare()
1408 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_spdif_prepare() local
1409 struct snd_trident_voice *evoice = voice->extra; in snd_trident_spdif_prepare()
1419 voice->Delta = snd_trident_convert_rate(runtime->rate); in snd_trident_spdif_prepare()
1420 voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size); in snd_trident_spdif_prepare()
1424 if (voice->memblk) in snd_trident_spdif_prepare()
1425 voice->LBA = voice->memblk->offset; in snd_trident_spdif_prepare()
1427 voice->LBA = LBAO; in snd_trident_spdif_prepare()
1429 voice->isync = 1; in snd_trident_spdif_prepare()
1430 voice->isync3 = 1; in snd_trident_spdif_prepare()
1431 voice->isync_mark = runtime->period_size; in snd_trident_spdif_prepare()
1432 voice->isync_max = runtime->buffer_size; in snd_trident_spdif_prepare()
1436 voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1; in snd_trident_spdif_prepare()
1439 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_spdif_prepare()
1441 voice->FMC = 3; in snd_trident_spdif_prepare()
1442 voice->RVol = 0x7f; in snd_trident_spdif_prepare()
1443 voice->CVol = 0x7f; in snd_trident_spdif_prepare()
1444 voice->GVSel = 1; in snd_trident_spdif_prepare()
1445 voice->Pan = 0x7f; in snd_trident_spdif_prepare()
1446 voice->Vol = 0x3ff; in snd_trident_spdif_prepare()
1447 voice->EC = 0; in snd_trident_spdif_prepare()
1448 voice->CSO = 0; in snd_trident_spdif_prepare()
1449 voice->Alpha = 0; in snd_trident_spdif_prepare()
1450 voice->FMS = 0; in snd_trident_spdif_prepare()
1451 voice->Attribute = 0; in snd_trident_spdif_prepare()
1454 snd_trident_write_voice_regs(trident, voice); in snd_trident_spdif_prepare()
1459 outw((voice->CSO & 0xffff), TRID_REG(trident, NX_SPCTRL_SPCSO)); in snd_trident_spdif_prepare()
1460 outb((voice->CSO >> 16), TRID_REG(trident, NX_SPCTRL_SPCSO + 2)); in snd_trident_spdif_prepare()
1469 voice->Delta = 0x800; in snd_trident_spdif_prepare()
1470 voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size); in snd_trident_spdif_prepare()
1473 if (voice->memblk) in snd_trident_spdif_prepare()
1474 voice->LBA = voice->memblk->offset; in snd_trident_spdif_prepare()
1476 voice->LBA = runtime->dma_addr; in snd_trident_spdif_prepare()
1478 voice->CSO = 0; in snd_trident_spdif_prepare()
1479 voice->ESO = runtime->buffer_size - 1; /* in samples */ in snd_trident_spdif_prepare()
1480 voice->CTRL = snd_trident_control_mode(substream); in snd_trident_spdif_prepare()
1481 voice->FMC = 3; in snd_trident_spdif_prepare()
1482 voice->GVSel = 1; in snd_trident_spdif_prepare()
1483 voice->EC = 0; in snd_trident_spdif_prepare()
1484 voice->Alpha = 0; in snd_trident_spdif_prepare()
1485 voice->FMS = 0; in snd_trident_spdif_prepare()
1486 voice->Vol = mix->vol; in snd_trident_spdif_prepare()
1487 voice->RVol = mix->rvol; in snd_trident_spdif_prepare()
1488 voice->CVol = mix->cvol; in snd_trident_spdif_prepare()
1489 voice->Pan = mix->pan; in snd_trident_spdif_prepare()
1490 voice->Attribute = (1<<(30-16))|(7<<(26-16))| in snd_trident_spdif_prepare()
1493 snd_trident_write_voice_regs(trident, voice); in snd_trident_spdif_prepare()
1496 evoice->Delta = voice->Delta; in snd_trident_spdif_prepare()
1497 evoice->spurious_threshold = voice->spurious_threshold; in snd_trident_spdif_prepare()
1498 evoice->LBA = voice->LBA; in snd_trident_spdif_prepare()
1501 evoice->CTRL = voice->CTRL; in snd_trident_spdif_prepare()
1550 struct snd_trident_voice *voice, *evoice; in snd_trident_trigger() local
1572 voice = s->runtime->private_data; in snd_trident_trigger()
1573 evoice = voice->extra; in snd_trident_trigger()
1574 what |= 1 << (voice->number & 0x1f); in snd_trident_trigger()
1576 whati |= 1 << (voice->number & 0x1f); in snd_trident_trigger()
1584 voice->running = 1; in snd_trident_trigger()
1585 voice->stimer = val; in snd_trident_trigger()
1587 voice->running = 0; in snd_trident_trigger()
1590 if (voice->capture) in snd_trident_trigger()
1592 if (voice->spdif) in snd_trident_trigger()
1646 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_playback_pointer() local
1649 if (!voice->running) in snd_trident_playback_pointer()
1654 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); in snd_trident_playback_pointer()
1685 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_capture_pointer() local
1688 if (!voice->running) in snd_trident_capture_pointer()
1715 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_spdif_pointer() local
1718 if (!voice->running) in snd_trident_spdif_pointer()
1847 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_pcm_free_substream() local
1850 if (voice) { in snd_trident_pcm_free_substream()
1851 trident = voice->trident; in snd_trident_pcm_free_substream()
1852 snd_trident_free_voice(trident, voice); in snd_trident_pcm_free_substream()
1860 struct snd_trident_voice *voice; in snd_trident_playback_open() local
1862 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_playback_open()
1863 if (voice == NULL) in snd_trident_playback_open()
1865 snd_trident_pcm_mixer_build(trident, voice, substream); in snd_trident_playback_open()
1866 voice->substream = substream; in snd_trident_playback_open()
1867 runtime->private_data = voice; in snd_trident_playback_open()
1888 struct snd_trident_voice *voice = runtime->private_data; in snd_trident_playback_close() local
1890 snd_trident_pcm_mixer_free(trident, voice, substream); in snd_trident_playback_close()
1908 struct snd_trident_voice *voice; in snd_trident_spdif_open() local
1911 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_spdif_open()
1912 if (voice == NULL) in snd_trident_spdif_open()
1914 voice->spdif = 1; in snd_trident_spdif_open()
1915 voice->substream = substream; in snd_trident_spdif_open()
1920 runtime->private_data = voice; in snd_trident_spdif_open()
1987 struct snd_trident_voice *voice; in snd_trident_capture_open() local
1990 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_capture_open()
1991 if (voice == NULL) in snd_trident_capture_open()
1993 voice->capture = 1; in snd_trident_capture_open()
1994 voice->substream = substream; in snd_trident_capture_open()
1995 runtime->private_data = voice; in snd_trident_capture_open()
2031 struct snd_trident_voice *voice; in snd_trident_foldback_open() local
2034 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); in snd_trident_foldback_open()
2035 if (voice == NULL) in snd_trident_foldback_open()
2037 voice->foldback_chan = substream->number; in snd_trident_foldback_open()
2038 voice->substream = substream; in snd_trident_foldback_open()
2039 runtime->private_data = voice; in snd_trident_foldback_open()
2058 struct snd_trident_voice *voice; in snd_trident_foldback_close() local
2060 voice = runtime->private_data; in snd_trident_foldback_close()
2064 outb(0x00, TRID_REG(trident, T4D_RCI + voice->foldback_chan)); in snd_trident_foldback_close()
2697 if (mix->voice != NULL) in snd_trident_pcm_vol_control_put()
2698 snd_trident_write_vol_reg(trident, mix->voice, val); in snd_trident_pcm_vol_control_put()
2761 if (mix->voice != NULL) in snd_trident_pcm_pan_control_put()
2762 snd_trident_write_pan_reg(trident, mix->voice, val); in snd_trident_pcm_pan_control_put()
2816 if (mix->voice != NULL) in snd_trident_pcm_rvol_control_put()
2817 snd_trident_write_rvol_reg(trident, mix->voice, val); in snd_trident_pcm_rvol_control_put()
2874 if (mix->voice != NULL) in snd_trident_pcm_cvol_control_put()
2875 snd_trident_write_cvol_reg(trident, mix->voice, val); in snd_trident_pcm_cvol_control_put()
2920 struct snd_trident_voice *voice, in snd_trident_pcm_mixer_build() argument
2925 if (snd_BUG_ON(!trident || !voice || !substream)) in snd_trident_pcm_mixer_build()
2928 tmix->voice = voice; in snd_trident_pcm_mixer_build()
2937 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice *voice,… in snd_trident_pcm_mixer_free() argument
2944 tmix->voice = NULL; in snd_trident_pcm_mixer_free()
3032 tmix->voice = NULL; in snd_trident_mixer()
3542 struct snd_trident_voice *voice; in snd_trident_create() local
3643 voice = &trident->synth.voices[i]; in snd_trident_create()
3644 voice->number = i; in snd_trident_create()
3645 voice->trident = trident; in snd_trident_create()
3724 struct snd_trident_voice *voice; in snd_trident_interrupt() local
3745 voice = &trident->synth.voices[channel]; in snd_trident_interrupt()
3746 if (!voice->pcm || voice->substream == NULL) { in snd_trident_interrupt()
3750 delta = (int)stimer - (int)voice->stimer; in snd_trident_interrupt()
3753 if ((unsigned int)delta < voice->spurious_threshold) { in snd_trident_interrupt()
3760 voice->stimer = stimer; in snd_trident_interrupt()
3761 if (voice->isync) { in snd_trident_interrupt()
3762 if (!voice->isync3) { in snd_trident_interrupt()
3767 tmp = voice->isync_max - tmp; in snd_trident_interrupt()
3771 if (tmp < voice->isync_mark) { in snd_trident_interrupt()
3773 tmp = voice->isync_ESO - 7; in snd_trident_interrupt()
3775 tmp = voice->isync_ESO + 2; in snd_trident_interrupt()
3777 snd_trident_stop_voice(trident, voice->number); in snd_trident_interrupt()
3778 snd_trident_write_eso_reg(trident, voice, tmp); in snd_trident_interrupt()
3779 snd_trident_start_voice(trident, voice->number); in snd_trident_interrupt()
3781 } else if (voice->isync2) { in snd_trident_interrupt()
3782 voice->isync2 = 0; in snd_trident_interrupt()
3784 snd_trident_stop_voice(trident, voice->number); in snd_trident_interrupt()
3785 snd_trident_write_cso_reg(trident, voice, voice->isync_mark); in snd_trident_interrupt()
3786 snd_trident_write_eso_reg(trident, voice, voice->ESO); in snd_trident_interrupt()
3787 snd_trident_start_voice(trident, voice->number); in snd_trident_interrupt()
3790 if (voice->extra) { in snd_trident_interrupt()
3792 snd_trident_stop_voice(trident, voice->extra->number); in snd_trident_interrupt()
3793 snd_trident_write_cso_reg(trident, voice->extra, 0); in snd_trident_interrupt()
3794 snd_trident_start_voice(trident, voice->extra->number); in snd_trident_interrupt()
3798 snd_pcm_period_elapsed(voice->substream); in snd_trident_interrupt()
3862 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice) in snd_trident_free_voice() argument
3867 if (voice == NULL || !voice->use) in snd_trident_free_voice()
3869 snd_trident_clear_voices(trident, voice->number, voice->number); in snd_trident_free_voice()
3871 private_free = voice->private_free; in snd_trident_free_voice()
3872 voice->private_free = NULL; in snd_trident_free_voice()
3873 voice->private_data = NULL; in snd_trident_free_voice()
3874 if (voice->pcm) in snd_trident_free_voice()
3875 snd_trident_free_pcm_channel(trident, voice->number); in snd_trident_free_voice()
3876 if (voice->synth) in snd_trident_free_voice()
3877 snd_trident_free_synth_channel(trident, voice->number); in snd_trident_free_voice()
3878 voice->use = voice->pcm = voice->synth = voice->midi = 0; in snd_trident_free_voice()
3879 voice->capture = voice->spdif = 0; in snd_trident_free_voice()
3880 voice->sample_ops = NULL; in snd_trident_free_voice()
3881 voice->substream = NULL; in snd_trident_free_voice()
3882 voice->extra = NULL; in snd_trident_free_voice()
3885 private_free(voice); in snd_trident_free_voice()