Lines Matching refs:runtime
60 static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime, in vx_pcm_read_per_bytes() argument
64 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset); in vx_pcm_read_per_bytes()
68 buf = (unsigned char *)runtime->dma_area; in vx_pcm_read_per_bytes()
73 buf = (unsigned char *)runtime->dma_area; in vx_pcm_read_per_bytes()
78 buf = (unsigned char *)runtime->dma_area; in vx_pcm_read_per_bytes()
167 struct snd_pcm_runtime *runtime) in vx_set_format() argument
171 if (runtime->channels == 1) in vx_set_format()
173 if (snd_pcm_format_little_endian(runtime->format)) in vx_set_format()
175 if (runtime->rate < 32000 && runtime->rate > 11025) in vx_set_format()
177 else if (runtime->rate <= 11025) in vx_set_format()
180 switch (snd_pcm_format_physical_width(runtime->format)) { in vx_set_format()
528 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_playback_open() local
556 runtime->hw = vx_pcm_playback_hw; in vx_pcm_playback_open()
557 runtime->hw.period_bytes_min = chip->ibl.size; in vx_pcm_playback_open()
558 runtime->private_data = pipe; in vx_pcm_playback_open()
561 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4); in vx_pcm_playback_open()
562 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4); in vx_pcm_playback_open()
575 if (! subs->runtime->private_data) in vx_pcm_playback_close()
578 pipe = subs->runtime->private_data; in vx_pcm_playback_close()
625 struct snd_pcm_runtime *runtime, in vx_pcm_playback_transfer_chunk() argument
647 vx_pseudo_dma_write(chip, runtime, pipe, size); in vx_pcm_playback_transfer_chunk()
663 struct snd_pcm_runtime *runtime, in vx_update_pipe_position() argument
680 if (pipe->position >= (int)runtime->buffer_size) in vx_update_pipe_position()
681 pipe->position %= runtime->buffer_size; in vx_update_pipe_position()
695 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_playback_transfer() local
700 if ((err = vx_pcm_playback_transfer_chunk(chip, runtime, pipe, in vx_pcm_playback_transfer()
715 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_playback_update() local
718 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0) in vx_pcm_playback_update()
720 if (pipe->transferred >= (int)runtime->period_size) { in vx_pcm_playback_update()
721 pipe->transferred %= runtime->period_size; in vx_pcm_playback_update()
733 struct vx_pipe *pipe = subs->runtime->private_data; in vx_pcm_trigger()
785 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_playback_pointer() local
786 struct vx_pipe *pipe = runtime->private_data; in vx_pcm_playback_pointer()
814 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_prepare() local
815 struct vx_pipe *pipe = runtime->private_data; in vx_pcm_prepare()
841 if (chip->pcm_running && chip->freq != runtime->rate) { in vx_pcm_prepare()
843 "from the current %d\n", runtime->rate, chip->freq); in vx_pcm_prepare()
846 vx_set_clock(chip, runtime->rate); in vx_pcm_prepare()
848 if ((err = vx_set_format(chip, pipe, runtime)) < 0) in vx_pcm_prepare()
857 pipe->buffer_bytes = frames_to_bytes(runtime, runtime->buffer_size); in vx_pcm_prepare()
858 pipe->period_bytes = frames_to_bytes(runtime, runtime->period_size); in vx_pcm_prepare()
862 vx_update_pipe_position(chip, runtime, pipe); in vx_pcm_prepare()
919 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_capture_open() local
962 runtime->hw = vx_pcm_capture_hw; in vx_pcm_capture_open()
963 runtime->hw.period_bytes_min = chip->ibl.size; in vx_pcm_capture_open()
964 runtime->private_data = pipe; in vx_pcm_capture_open()
967 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4); in vx_pcm_capture_open()
968 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4); in vx_pcm_capture_open()
982 if (! subs->runtime->private_data) in vx_pcm_capture_close()
984 pipe = subs->runtime->private_data; in vx_pcm_capture_close()
1016 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_capture_update() local
1021 size = runtime->buffer_size - snd_pcm_capture_avail(runtime); in vx_pcm_capture_update()
1024 size = frames_to_bytes(runtime, size); in vx_pcm_capture_update()
1044 vx_pcm_read_per_bytes(chip, runtime, pipe); in vx_pcm_capture_update()
1051 vx_pseudo_dma_read(chip, runtime, pipe, space); in vx_pcm_capture_update()
1058 vx_pcm_read_per_bytes(chip, runtime, pipe); in vx_pcm_capture_update()
1066 vx_pcm_read_per_bytes(chip, runtime, pipe); in vx_pcm_capture_update()
1088 struct snd_pcm_runtime *runtime = subs->runtime; in vx_pcm_capture_pointer() local
1089 struct vx_pipe *pipe = runtime->private_data; in vx_pcm_capture_pointer()
1090 return bytes_to_frames(runtime, pipe->hw_ptr); in vx_pcm_capture_pointer()