Lines Matching refs:substream
50 struct snd_pcm_substream *substream = arg; in fsl_asrc_dma_complete() local
51 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_complete()
54 pair->pos += snd_pcm_lib_period_bytes(substream); in fsl_asrc_dma_complete()
55 if (pair->pos >= snd_pcm_lib_buffer_bytes(substream)) in fsl_asrc_dma_complete()
58 snd_pcm_period_elapsed(substream); in fsl_asrc_dma_complete()
61 static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream) in fsl_asrc_dma_prepare_and_submit() argument
63 u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; in fsl_asrc_dma_prepare_and_submit()
64 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asrc_dma_prepare_and_submit()
65 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_prepare_and_submit()
71 if (!substream->runtime->no_period_wakeup) in fsl_asrc_dma_prepare_and_submit()
77 snd_pcm_lib_buffer_bytes(substream), in fsl_asrc_dma_prepare_and_submit()
78 snd_pcm_lib_period_bytes(substream), in fsl_asrc_dma_prepare_and_submit()
86 pair->desc[!dir]->callback_param = substream; in fsl_asrc_dma_prepare_and_submit()
103 static int fsl_asrc_dma_trigger(struct snd_pcm_substream *substream, int cmd) in fsl_asrc_dma_trigger() argument
105 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_trigger()
113 ret = fsl_asrc_dma_prepare_and_submit(substream); in fsl_asrc_dma_trigger()
132 static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, in fsl_asrc_dma_hw_params() argument
136 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asrc_dma_hw_params()
137 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_asrc_dma_hw_params()
140 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_hw_params()
146 int stream = substream->stream; in fsl_asrc_dma_hw_params()
176 dma_params_fe = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); in fsl_asrc_dma_hw_params()
187 ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe); in fsl_asrc_dma_hw_params()
249 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); in fsl_asrc_dma_hw_params()
254 static int fsl_asrc_dma_hw_free(struct snd_pcm_substream *substream) in fsl_asrc_dma_hw_free() argument
256 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_hw_free()
259 snd_pcm_set_runtime_buffer(substream, NULL); in fsl_asrc_dma_hw_free()
273 static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) in fsl_asrc_dma_startup() argument
275 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asrc_dma_startup()
276 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_startup()
291 snd_pcm_hw_constraint_integer(substream->runtime, in fsl_asrc_dma_startup()
293 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); in fsl_asrc_dma_startup()
298 static int fsl_asrc_dma_shutdown(struct snd_pcm_substream *substream) in fsl_asrc_dma_shutdown() argument
300 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_shutdown()
317 static snd_pcm_uframes_t fsl_asrc_dma_pcm_pointer(struct snd_pcm_substream *substream) in fsl_asrc_dma_pcm_pointer() argument
319 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_pcm_pointer()
322 return bytes_to_frames(substream->runtime, pair->pos); in fsl_asrc_dma_pcm_pointer()
338 struct snd_pcm_substream *substream; in fsl_asrc_dma_pcm_new() local
349 substream = pcm->streams[i].substream; in fsl_asrc_dma_pcm_new()
350 if (!substream) in fsl_asrc_dma_pcm_new()
354 FSL_ASRC_DMABUF_SIZE, &substream->dma_buffer); in fsl_asrc_dma_pcm_new()
364 if (--i == 0 && pcm->streams[i].substream) in fsl_asrc_dma_pcm_new()
365 snd_dma_free_pages(&pcm->streams[i].substream->dma_buffer); in fsl_asrc_dma_pcm_new()
372 struct snd_pcm_substream *substream; in fsl_asrc_dma_pcm_free() local
376 substream = pcm->streams[i].substream; in fsl_asrc_dma_pcm_free()
377 if (!substream) in fsl_asrc_dma_pcm_free()
380 snd_dma_free_pages(&substream->dma_buffer); in fsl_asrc_dma_pcm_free()
381 substream->dma_buffer.area = NULL; in fsl_asrc_dma_pcm_free()
382 substream->dma_buffer.addr = 0; in fsl_asrc_dma_pcm_free()