Lines Matching refs:substream

46 	struct snd_pcm_substream *substream = arg;  in fsl_asrc_dma_complete()  local
47 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_complete()
50 pair->pos += snd_pcm_lib_period_bytes(substream); in fsl_asrc_dma_complete()
51 if (pair->pos >= snd_pcm_lib_buffer_bytes(substream)) in fsl_asrc_dma_complete()
54 snd_pcm_period_elapsed(substream); in fsl_asrc_dma_complete()
57 static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream) in fsl_asrc_dma_prepare_and_submit() argument
59 u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; in fsl_asrc_dma_prepare_and_submit()
60 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asrc_dma_prepare_and_submit()
61 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_prepare_and_submit()
68 if (!substream->runtime->no_period_wakeup) in fsl_asrc_dma_prepare_and_submit()
74 snd_pcm_lib_buffer_bytes(substream), in fsl_asrc_dma_prepare_and_submit()
75 snd_pcm_lib_period_bytes(substream), in fsl_asrc_dma_prepare_and_submit()
83 pair->desc[!dir]->callback_param = substream; in fsl_asrc_dma_prepare_and_submit()
100 static int fsl_asrc_dma_trigger(struct snd_pcm_substream *substream, int cmd) in fsl_asrc_dma_trigger() argument
102 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_trigger()
110 ret = fsl_asrc_dma_prepare_and_submit(substream); in fsl_asrc_dma_trigger()
129 static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, in fsl_asrc_dma_hw_params() argument
133 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asrc_dma_hw_params()
134 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_asrc_dma_hw_params()
138 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_hw_params()
144 int stream = substream->stream; in fsl_asrc_dma_hw_params()
174 dma_params_fe = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); in fsl_asrc_dma_hw_params()
185 ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe); in fsl_asrc_dma_hw_params()
247 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); in fsl_asrc_dma_hw_params()
252 static int fsl_asrc_dma_hw_free(struct snd_pcm_substream *substream) in fsl_asrc_dma_hw_free() argument
254 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_hw_free()
257 snd_pcm_set_runtime_buffer(substream, NULL); in fsl_asrc_dma_hw_free()
271 static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) in fsl_asrc_dma_startup() argument
273 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asrc_dma_startup()
274 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_startup()
288 snd_pcm_hw_constraint_integer(substream->runtime, in fsl_asrc_dma_startup()
290 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); in fsl_asrc_dma_startup()
295 static int fsl_asrc_dma_shutdown(struct snd_pcm_substream *substream) in fsl_asrc_dma_shutdown() argument
297 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_shutdown()
314 static snd_pcm_uframes_t fsl_asrc_dma_pcm_pointer(struct snd_pcm_substream *substream) in fsl_asrc_dma_pcm_pointer() argument
316 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_pcm_pointer()
319 return bytes_to_frames(substream->runtime, pair->pos); in fsl_asrc_dma_pcm_pointer()
335 struct snd_pcm_substream *substream; in fsl_asrc_dma_pcm_new() local
346 substream = pcm->streams[i].substream; in fsl_asrc_dma_pcm_new()
347 if (!substream) in fsl_asrc_dma_pcm_new()
351 FSL_ASRC_DMABUF_SIZE, &substream->dma_buffer); in fsl_asrc_dma_pcm_new()
361 if (--i == 0 && pcm->streams[i].substream) in fsl_asrc_dma_pcm_new()
362 snd_dma_free_pages(&pcm->streams[i].substream->dma_buffer); in fsl_asrc_dma_pcm_new()
369 struct snd_pcm_substream *substream; in fsl_asrc_dma_pcm_free() local
373 substream = pcm->streams[i].substream; in fsl_asrc_dma_pcm_free()
374 if (!substream) in fsl_asrc_dma_pcm_free()
377 snd_dma_free_pages(&substream->dma_buffer); in fsl_asrc_dma_pcm_free()
378 substream->dma_buffer.area = NULL; in fsl_asrc_dma_pcm_free()
379 substream->dma_buffer.addr = 0; in fsl_asrc_dma_pcm_free()