Lines Matching refs:runtime

358 static void snd_emu10k1x_pcm_free_substream(struct snd_pcm_runtime *runtime)  in snd_emu10k1x_pcm_free_substream()  argument
360 kfree(runtime->private_data); in snd_emu10k1x_pcm_free_substream()
386 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_playback_open() local
389 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { in snd_emu10k1x_playback_open()
392 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) in snd_emu10k1x_playback_open()
401 runtime->private_data = epcm; in snd_emu10k1x_playback_open()
402 runtime->private_free = snd_emu10k1x_pcm_free_substream; in snd_emu10k1x_playback_open()
404 runtime->hw = snd_emu10k1x_playback_hw; in snd_emu10k1x_playback_open()
419 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_hw_params() local
420 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_hw_params()
435 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_hw_free() local
438 if (runtime->private_data == NULL) in snd_emu10k1x_pcm_hw_free()
441 epcm = runtime->private_data; in snd_emu10k1x_pcm_hw_free()
456 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_prepare() local
457 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_prepare()
460 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); in snd_emu10k1x_pcm_prepare()
463 for(i = 0; i < runtime->periods; i++) { in snd_emu10k1x_pcm_prepare()
464 *table_base++=runtime->dma_addr+(i*period_size_bytes); in snd_emu10k1x_pcm_prepare()
469 snd_emu10k1x_ptr_write(emu, PLAYBACK_LIST_SIZE, voice, (runtime->periods - 1) << 19); in snd_emu10k1x_pcm_prepare()
474 snd_emu10k1x_ptr_write(emu, PLAYBACK_DMA_ADDR, voice, runtime->dma_addr); in snd_emu10k1x_pcm_prepare()
476 …snd_emu10k1x_ptr_write(emu, PLAYBACK_PERIOD_SIZE, voice, frames_to_bytes(runtime, runtime->period_… in snd_emu10k1x_pcm_prepare()
486 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_trigger() local
487 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_trigger()
499 if(runtime->periods == 2) in snd_emu10k1x_pcm_trigger()
523 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_pointer() local
524 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_pointer()
535 if(ptr4 == 0 && ptr1 == frames_to_bytes(runtime, runtime->buffer_size)) in snd_emu10k1x_pcm_pointer()
540 ptr2 = bytes_to_frames(runtime, ptr1); in snd_emu10k1x_pcm_pointer()
541 ptr2 += (ptr4 >> 3) * runtime->period_size; in snd_emu10k1x_pcm_pointer()
544 if (ptr >= runtime->buffer_size) in snd_emu10k1x_pcm_pointer()
545 ptr -= runtime->buffer_size; in snd_emu10k1x_pcm_pointer()
567 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_open_capture() local
570 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) in snd_emu10k1x_pcm_open_capture()
572 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) in snd_emu10k1x_pcm_open_capture()
582 runtime->private_data = epcm; in snd_emu10k1x_pcm_open_capture()
583 runtime->private_free = snd_emu10k1x_pcm_free_substream; in snd_emu10k1x_pcm_open_capture()
585 runtime->hw = snd_emu10k1x_capture_hw; in snd_emu10k1x_pcm_open_capture()
600 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_hw_params_capture() local
601 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_hw_params_capture()
618 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_hw_free_capture() local
622 if (runtime->private_data == NULL) in snd_emu10k1x_pcm_hw_free_capture()
624 epcm = runtime->private_data; in snd_emu10k1x_pcm_hw_free_capture()
639 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_prepare_capture() local
641 snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr); in snd_emu10k1x_pcm_prepare_capture()
642 …snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)… in snd_emu10k1x_pcm_prepare_capture()
654 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_trigger_capture() local
655 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_trigger_capture()
683 struct snd_pcm_runtime *runtime = substream->runtime; in snd_emu10k1x_pcm_pointer_capture() local
684 struct emu10k1x_pcm *epcm = runtime->private_data; in snd_emu10k1x_pcm_pointer_capture()
690 ptr = bytes_to_frames(runtime, snd_emu10k1x_ptr_read(emu, CAPTURE_POINTER, 0)); in snd_emu10k1x_pcm_pointer_capture()
691 if (ptr >= runtime->buffer_size) in snd_emu10k1x_pcm_pointer_capture()
692 ptr -= runtime->buffer_size; in snd_emu10k1x_pcm_pointer_capture()