Lines Matching defs:runtime
45 static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime,
49 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset);
53 buf = (unsigned char *)runtime->dma_area;
58 buf = (unsigned char *)runtime->dma_area;
146 * @runtime: pcm runtime instance to be referred
151 struct snd_pcm_runtime *runtime)
155 if (runtime->channels == 1)
157 if (snd_pcm_format_little_endian(runtime->format))
159 if (runtime->rate < 32000 && runtime->rate > 11025)
161 else if (runtime->rate <= 11025)
164 switch (snd_pcm_format_physical_width(runtime->format)) {
512 struct snd_pcm_runtime *runtime = subs->runtime;
539 runtime->hw = vx_pcm_playback_hw;
540 runtime->hw.period_bytes_min = chip->ibl.size;
541 runtime->private_data = pipe;
544 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
545 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
558 if (! subs->runtime->private_data)
561 pipe = subs->runtime->private_data;
608 struct snd_pcm_runtime *runtime,
630 vx_pseudo_dma_write(chip, runtime, pipe, size);
646 struct snd_pcm_runtime *runtime,
663 if (pipe->position >= (int)runtime->buffer_size)
664 pipe->position %= runtime->buffer_size;
678 struct snd_pcm_runtime *runtime = subs->runtime;
683 if ((err = vx_pcm_playback_transfer_chunk(chip, runtime, pipe,
698 struct snd_pcm_runtime *runtime = subs->runtime;
701 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0)
703 if (pipe->transferred >= (int)runtime->period_size) {
704 pipe->transferred %= runtime->period_size;
716 struct vx_pipe *pipe = subs->runtime->private_data;
768 struct snd_pcm_runtime *runtime = subs->runtime;
769 struct vx_pipe *pipe = runtime->private_data;
779 struct snd_pcm_runtime *runtime = subs->runtime;
780 struct vx_pipe *pipe = runtime->private_data;
806 if (chip->pcm_running && chip->freq != runtime->rate) {
808 "from the current %d\n", runtime->rate, chip->freq);
811 vx_set_clock(chip, runtime->rate);
813 if ((err = vx_set_format(chip, pipe, runtime)) < 0)
822 pipe->buffer_bytes = frames_to_bytes(runtime, runtime->buffer_size);
823 pipe->period_bytes = frames_to_bytes(runtime, runtime->period_size);
827 vx_update_pipe_position(chip, runtime, pipe);
879 struct snd_pcm_runtime *runtime = subs->runtime;
922 runtime->hw = vx_pcm_capture_hw;
923 runtime->hw.period_bytes_min = chip->ibl.size;
924 runtime->private_data = pipe;
927 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
928 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
942 if (! subs->runtime->private_data)
944 pipe = subs->runtime->private_data;
976 struct snd_pcm_runtime *runtime = subs->runtime;
981 size = runtime->buffer_size - snd_pcm_capture_avail(runtime);
984 size = frames_to_bytes(runtime, size);
1004 vx_pcm_read_per_bytes(chip, runtime, pipe);
1012 vx_pseudo_dma_read(chip, runtime, pipe, space);
1020 vx_pcm_read_per_bytes(chip, runtime, pipe);
1028 vx_pcm_read_per_bytes(chip, runtime, pipe);
1050 struct snd_pcm_runtime *runtime = subs->runtime;
1051 struct vx_pipe *pipe = runtime->private_data;
1052 return bytes_to_frames(runtime, pipe->hw_ptr);