Lines Matching refs:ch
182 static inline int emu8k_get_curpos(struct snd_emu8k_pcm *rec, int ch) in emu8k_get_curpos() argument
184 int val = EMU8000_CCCA_READ(rec->emu, ch) & 0xfffffff; in emu8k_get_curpos()
185 val -= rec->loop_start[ch] - 1; in emu8k_get_curpos()
283 static void setup_voice(struct snd_emu8k_pcm *rec, int ch) in setup_voice() argument
289 EMU8000_DCYSUSV_WRITE(hw, ch, 0x0080); in setup_voice()
290 EMU8000_VTFT_WRITE(hw, ch, 0x0000FFFF); in setup_voice()
291 EMU8000_CVCF_WRITE(hw, ch, 0x0000FFFF); in setup_voice()
292 EMU8000_PTRX_WRITE(hw, ch, 0); in setup_voice()
293 EMU8000_CPF_WRITE(hw, ch, 0); in setup_voice()
296 EMU8000_IP_WRITE(hw, ch, rec->pitch); in setup_voice()
298 EMU8000_ENVVAL_WRITE(hw, ch, 0x8000); in setup_voice()
299 EMU8000_ATKHLD_WRITE(hw, ch, 0x7f7f); in setup_voice()
300 EMU8000_DCYSUS_WRITE(hw, ch, 0x7f7f); in setup_voice()
301 EMU8000_ENVVOL_WRITE(hw, ch, 0x8000); in setup_voice()
302 EMU8000_ATKHLDV_WRITE(hw, ch, 0x7f7f); in setup_voice()
306 EMU8000_PEFE_WRITE(hw, ch, 0x0); in setup_voice()
308 EMU8000_LFO1VAL_WRITE(hw, ch, 0x8000); in setup_voice()
309 EMU8000_LFO2VAL_WRITE(hw, ch, 0x8000); in setup_voice()
311 EMU8000_FMMOD_WRITE(hw, ch, 0); in setup_voice()
313 EMU8000_TREMFRQ_WRITE(hw, ch, 0); in setup_voice()
315 EMU8000_FM2FRQ2_WRITE(hw, ch, 0); in setup_voice()
317 temp = rec->panning[ch]; in setup_voice()
318 temp = (temp <<24) | ((unsigned int)rec->loop_start[ch] - 1); in setup_voice()
319 EMU8000_PSST_WRITE(hw, ch, temp); in setup_voice()
322 temp = (temp << 24) | ((unsigned int)rec->loop_start[ch] + rec->buf_size - 1); in setup_voice()
323 EMU8000_CSL_WRITE(hw, ch, temp); in setup_voice()
326 temp = (temp << 28) | ((unsigned int)rec->loop_start[ch] - 1); in setup_voice()
327 EMU8000_CCCA_WRITE(hw, ch, temp); in setup_voice()
329 EMU8000_00A0_WRITE(hw, ch, 0); in setup_voice()
330 EMU8000_0080_WRITE(hw, ch, 0); in setup_voice()
336 static void start_voice(struct snd_emu8k_pcm *rec, int ch) in start_voice() argument
344 EMU8000_IFATN_WRITE(hw, ch, 0xff00); in start_voice()
345 EMU8000_VTFT_WRITE(hw, ch, 0xffff); in start_voice()
346 EMU8000_CVCF_WRITE(hw, ch, 0xffff); in start_voice()
348 EMU8000_DCYSUSV_WRITE(hw, ch, 0x7f7f); in start_voice()
351 if (rec->panning[ch] == 0) in start_voice()
354 aux = (-rec->panning[ch]) & 0xff; in start_voice()
356 EMU8000_PTRX_WRITE(hw, ch, temp); in start_voice()
357 EMU8000_CPF_WRITE(hw, ch, pt << 16); in start_voice()
372 static void stop_voice(struct snd_emu8k_pcm *rec, int ch) in stop_voice() argument
377 EMU8000_DCYSUSV_WRITE(hw, ch, 0x807F); in stop_voice()
391 int ch; in emu8k_pcm_trigger() local
395 for (ch = 0; ch < rec->voices; ch++) in emu8k_pcm_trigger()
396 start_voice(rec, ch); in emu8k_pcm_trigger()
401 for (ch = 0; ch < rec->voices; ch++) in emu8k_pcm_trigger()
402 stop_voice(rec, ch); in emu8k_pcm_trigger()
602 int ch; in emu8k_pcm_hw_free() local
603 for (ch = 0; ch < rec->voices; ch++) in emu8k_pcm_hw_free()
604 stop_voice(rec, ch); // to be sure in emu8k_pcm_hw_free()
636 int err, i, ch; in emu8k_pcm_prepare() local
648 for (ch = 0; ch < rec->voices; ch++) { in emu8k_pcm_prepare()
649 EMU8000_SMALW_WRITE(rec->emu, rec->loop_start[ch] + rec->buf_size); in emu8k_pcm_prepare()