Lines Matching refs:substream
25 struct snd_pcm_substream *substream, in create_page_table() argument
28 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in create_page_table()
30 struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream); in create_page_table()
31 int stream = substream->stream; in create_page_table()
41 static int sof_pcm_dsp_params(struct snd_sof_pcm *spcm, struct snd_pcm_substream *substream, in sof_pcm_dsp_params() argument
48 int ret = snd_sof_ipc_pcm_params(sdev, substream, reply); in sof_pcm_dsp_params()
66 snd_pcm_period_elapsed(sps->substream); in snd_sof_pcm_period_elapsed_work()
72 void snd_sof_pcm_period_elapsed(struct snd_pcm_substream *substream) in snd_sof_pcm_period_elapsed() argument
74 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in snd_sof_pcm_period_elapsed()
94 schedule_work(&spcm->stream[substream->stream].period_elapsed_work); in snd_sof_pcm_period_elapsed()
98 static int sof_pcm_dsp_pcm_free(struct snd_pcm_substream *substream, in sof_pcm_dsp_pcm_free() argument
108 stream.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_dsp_pcm_free()
114 spcm->prepared[substream->stream] = false; in sof_pcm_dsp_pcm_free()
120 struct snd_pcm_substream *substream, in sof_pcm_hw_params() argument
123 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_hw_params()
124 struct snd_pcm_runtime *runtime = substream->runtime; in sof_pcm_hw_params()
143 if (spcm->prepared[substream->stream]) { in sof_pcm_hw_params()
144 ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); in sof_pcm_hw_params()
150 spcm->pcm.pcm_id, substream->stream); in sof_pcm_hw_params()
156 ret = create_page_table(component, substream, runtime->dma_area, in sof_pcm_hw_params()
168 pcm.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_hw_params()
171 spcm->stream[substream->stream].page_table.addr; in sof_pcm_hw_params()
173 pcm.params.direction = substream->stream; in sof_pcm_hw_params()
206 substream, in sof_pcm_hw_params()
225 ret = sof_pcm_dsp_params(spcm, substream, &ipc_params_reply); in sof_pcm_hw_params()
229 spcm->prepared[substream->stream] = true; in sof_pcm_hw_params()
232 memcpy(&spcm->params[substream->stream], params, sizeof(*params)); in sof_pcm_hw_params()
238 struct snd_pcm_substream *substream) in sof_pcm_hw_free() argument
240 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_hw_free()
254 spcm->pcm.pcm_id, substream->stream); in sof_pcm_hw_free()
256 if (spcm->prepared[substream->stream]) { in sof_pcm_hw_free()
257 ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); in sof_pcm_hw_free()
262 cancel_work_sync(&spcm->stream[substream->stream].period_elapsed_work); in sof_pcm_hw_free()
264 ret = snd_sof_pcm_platform_hw_free(sdev, substream); in sof_pcm_hw_free()
274 struct snd_pcm_substream *substream) in sof_pcm_prepare() argument
276 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_prepare()
288 if (spcm->prepared[substream->stream]) in sof_pcm_prepare()
292 spcm->pcm.pcm_id, substream->stream); in sof_pcm_prepare()
296 substream, &spcm->params[substream->stream]); in sof_pcm_prepare()
311 struct snd_pcm_substream *substream, int cmd) in sof_pcm_trigger() argument
313 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_trigger()
331 spcm->pcm.pcm_id, substream->stream, cmd); in sof_pcm_trigger()
335 stream.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_trigger()
346 if (spcm->stream[substream->stream].suspend_ignored) { in sof_pcm_trigger()
352 spcm->stream[substream->stream].suspend_ignored = false; in sof_pcm_trigger()
357 ret = sof_pcm_prepare(component, substream); in sof_pcm_trigger()
366 if (spcm->stream[substream->stream].suspend_ignored) { in sof_pcm_trigger()
372 spcm->stream[substream->stream].suspend_ignored = false; in sof_pcm_trigger()
379 spcm->stream[substream->stream].d0i3_compatible) { in sof_pcm_trigger()
386 spcm->stream[substream->stream].suspend_ignored = true; in sof_pcm_trigger()
406 snd_sof_pcm_platform_trigger(sdev, substream, cmd); in sof_pcm_trigger()
414 snd_sof_pcm_platform_trigger(sdev, substream, cmd); in sof_pcm_trigger()
418 ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); in sof_pcm_trigger()
424 struct snd_pcm_substream *substream) in sof_pcm_pointer() argument
426 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_pointer()
437 return sof_ops(sdev)->pcm_pointer(sdev, substream); in sof_pcm_pointer()
444 host = bytes_to_frames(substream->runtime, in sof_pcm_pointer()
445 spcm->stream[substream->stream].posn.host_posn); in sof_pcm_pointer()
446 dai = bytes_to_frames(substream->runtime, in sof_pcm_pointer()
447 spcm->stream[substream->stream].posn.dai_posn); in sof_pcm_pointer()
451 spcm->pcm.pcm_id, substream->stream, host, dai); in sof_pcm_pointer()
457 struct snd_pcm_substream *substream) in sof_pcm_open() argument
459 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_open()
460 struct snd_pcm_runtime *runtime = substream->runtime; in sof_pcm_open()
476 spcm->pcm.pcm_id, substream->stream); in sof_pcm_open()
479 caps = &spcm->pcm.caps[substream->stream]; in sof_pcm_open()
507 substream->wait_time = 500; in sof_pcm_open()
509 spcm->stream[substream->stream].posn.host_posn = 0; in sof_pcm_open()
510 spcm->stream[substream->stream].posn.dai_posn = 0; in sof_pcm_open()
511 spcm->stream[substream->stream].substream = substream; in sof_pcm_open()
512 spcm->prepared[substream->stream] = false; in sof_pcm_open()
514 ret = snd_sof_pcm_platform_open(sdev, substream); in sof_pcm_open()
522 struct snd_pcm_substream *substream) in sof_pcm_close() argument
524 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_close()
538 spcm->pcm.pcm_id, substream->stream); in sof_pcm_close()
540 err = snd_sof_pcm_platform_close(sdev, substream); in sof_pcm_close()
588 if (!pcm->streams[stream].substream) { in sof_pcm_new()
593 snd_pcm_set_managed_buffer(pcm->streams[stream].substream, in sof_pcm_new()
610 if (!pcm->streams[stream].substream) { in sof_pcm_new()
615 snd_pcm_set_managed_buffer(pcm->streams[stream].substream, in sof_pcm_new()