Lines Matching refs:substream

44 	struct snd_pcm_substream *substream = arg;  in fsl_asrc_dma_complete()  local
45 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_complete()
48 pair->pos += snd_pcm_lib_period_bytes(substream); in fsl_asrc_dma_complete()
49 if (pair->pos >= snd_pcm_lib_buffer_bytes(substream)) in fsl_asrc_dma_complete()
52 snd_pcm_period_elapsed(substream); in fsl_asrc_dma_complete()
55 static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream, in fsl_asrc_dma_prepare_and_submit() argument
58 u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; in fsl_asrc_dma_prepare_and_submit()
59 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_prepare_and_submit()
65 if (!substream->runtime->no_period_wakeup) in fsl_asrc_dma_prepare_and_submit()
71 snd_pcm_lib_buffer_bytes(substream), in fsl_asrc_dma_prepare_and_submit()
72 snd_pcm_lib_period_bytes(substream), in fsl_asrc_dma_prepare_and_submit()
80 pair->desc[!dir]->callback_param = substream; in fsl_asrc_dma_prepare_and_submit()
98 struct snd_pcm_substream *substream, int cmd) in fsl_asrc_dma_trigger() argument
100 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_trigger()
108 ret = fsl_asrc_dma_prepare_and_submit(substream, component); in fsl_asrc_dma_trigger()
128 struct snd_pcm_substream *substream, in fsl_asrc_dma_hw_params() argument
132 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in fsl_asrc_dma_hw_params()
133 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_asrc_dma_hw_params()
136 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_hw_params()
144 int stream = substream->stream; in fsl_asrc_dma_hw_params()
173 dma_params_fe = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); in fsl_asrc_dma_hw_params()
184 ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe); in fsl_asrc_dma_hw_params()
207 be_chan = soc_component_to_pcm(component_be)->chan[substream->stream]; in fsl_asrc_dma_hw_params()
284 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); in fsl_asrc_dma_hw_params()
290 struct snd_pcm_substream *substream) in fsl_asrc_dma_hw_free() argument
292 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_asrc_dma_hw_free()
293 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_hw_free()
297 snd_pcm_set_runtime_buffer(substream, NULL); in fsl_asrc_dma_hw_free()
313 struct snd_pcm_substream *substream) in fsl_asrc_dma_startup() argument
315 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_asrc_dma_startup()
316 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in fsl_asrc_dma_startup()
317 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_startup()
327 ret = snd_pcm_hw_constraint_integer(substream->runtime, in fsl_asrc_dma_startup()
361 dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); in fsl_asrc_dma_startup()
364 ret = snd_dmaengine_pcm_refine_runtime_hwparams(substream, in fsl_asrc_dma_startup()
374 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); in fsl_asrc_dma_startup()
390 struct snd_pcm_substream *substream) in fsl_asrc_dma_shutdown() argument
392 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_shutdown()
411 struct snd_pcm_substream *substream) in fsl_asrc_dma_pcm_pointer() argument
413 struct snd_pcm_runtime *runtime = substream->runtime; in fsl_asrc_dma_pcm_pointer()
416 return bytes_to_frames(substream->runtime, pair->pos); in fsl_asrc_dma_pcm_pointer()
423 struct snd_pcm_substream *substream; in fsl_asrc_dma_pcm_new() local
434 substream = pcm->streams[i].substream; in fsl_asrc_dma_pcm_new()
435 if (!substream) in fsl_asrc_dma_pcm_new()
439 FSL_ASRC_DMABUF_SIZE, &substream->dma_buffer); in fsl_asrc_dma_pcm_new()
449 if (--i == 0 && pcm->streams[i].substream) in fsl_asrc_dma_pcm_new()
450 snd_dma_free_pages(&pcm->streams[i].substream->dma_buffer); in fsl_asrc_dma_pcm_new()
458 struct snd_pcm_substream *substream; in fsl_asrc_dma_pcm_free() local
462 substream = pcm->streams[i].substream; in fsl_asrc_dma_pcm_free()
463 if (!substream) in fsl_asrc_dma_pcm_free()
466 snd_dma_free_pages(&substream->dma_buffer); in fsl_asrc_dma_pcm_free()
467 substream->dma_buffer.area = NULL; in fsl_asrc_dma_pcm_free()
468 substream->dma_buffer.addr = 0; in fsl_asrc_dma_pcm_free()