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()
77 void snd_sof_pcm_period_elapsed(struct snd_pcm_substream *substream) in snd_sof_pcm_period_elapsed() argument
79 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in snd_sof_pcm_period_elapsed()
99 schedule_work(&spcm->stream[substream->stream].period_elapsed_work); in snd_sof_pcm_period_elapsed()
103 static int sof_pcm_dsp_pcm_free(struct snd_pcm_substream *substream, in sof_pcm_dsp_pcm_free() argument
113 stream.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_dsp_pcm_free()
119 spcm->prepared[substream->stream] = false; in sof_pcm_dsp_pcm_free()
159 struct snd_pcm_substream *substream, in sof_pcm_hw_params() argument
162 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_hw_params()
163 struct snd_pcm_runtime *runtime = substream->runtime; in sof_pcm_hw_params()
182 if (spcm->prepared[substream->stream]) { in sof_pcm_hw_params()
183 ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); in sof_pcm_hw_params()
189 spcm->pcm.pcm_id, substream->stream); in sof_pcm_hw_params()
195 ret = create_page_table(component, substream, runtime->dma_area, in sof_pcm_hw_params()
207 pcm.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_hw_params()
210 spcm->stream[substream->stream].page_table.addr; in sof_pcm_hw_params()
212 pcm.params.direction = substream->stream; in sof_pcm_hw_params()
245 substream, in sof_pcm_hw_params()
256 if (!spcm->stream[substream->stream].list) { in sof_pcm_hw_params()
257 ret = sof_pcm_setup_connected_widgets(sdev, rtd, spcm, substream->stream); in sof_pcm_hw_params()
271 ret = sof_pcm_dsp_params(spcm, substream, &ipc_params_reply); in sof_pcm_hw_params()
275 spcm->prepared[substream->stream] = true; in sof_pcm_hw_params()
278 memcpy(&spcm->params[substream->stream], params, sizeof(*params)); in sof_pcm_hw_params()
284 struct snd_pcm_substream *substream) in sof_pcm_hw_free() argument
286 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_hw_free()
300 spcm->pcm.pcm_id, substream->stream); in sof_pcm_hw_free()
302 if (spcm->prepared[substream->stream]) { in sof_pcm_hw_free()
303 ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); in sof_pcm_hw_free()
308 ret = sof_widget_list_free(sdev, spcm, substream->stream); in sof_pcm_hw_free()
312 cancel_work_sync(&spcm->stream[substream->stream].period_elapsed_work); in sof_pcm_hw_free()
314 ret = snd_sof_pcm_platform_hw_free(sdev, substream); in sof_pcm_hw_free()
324 struct snd_pcm_substream *substream) in sof_pcm_prepare() argument
326 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_prepare()
338 if (spcm->prepared[substream->stream]) in sof_pcm_prepare()
342 spcm->pcm.pcm_id, substream->stream); in sof_pcm_prepare()
346 substream, &spcm->params[substream->stream]); in sof_pcm_prepare()
361 struct snd_pcm_substream *substream, int cmd) in sof_pcm_trigger() argument
363 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_trigger()
382 spcm->pcm.pcm_id, substream->stream, cmd); in sof_pcm_trigger()
386 stream.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_trigger()
397 if (spcm->stream[substream->stream].suspend_ignored) { in sof_pcm_trigger()
403 spcm->stream[substream->stream].suspend_ignored = false; in sof_pcm_trigger()
408 ret = sof_pcm_prepare(component, substream); in sof_pcm_trigger()
417 if (spcm->stream[substream->stream].suspend_ignored) { in sof_pcm_trigger()
423 spcm->stream[substream->stream].suspend_ignored = false; in sof_pcm_trigger()
430 spcm->stream[substream->stream].d0i3_compatible) { in sof_pcm_trigger()
437 spcm->stream[substream->stream].suspend_ignored = true; in sof_pcm_trigger()
458 snd_sof_pcm_platform_trigger(sdev, substream, cmd); in sof_pcm_trigger()
466 snd_sof_pcm_platform_trigger(sdev, substream, cmd); in sof_pcm_trigger()
470 ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); in sof_pcm_trigger()
476 ret = sof_widget_list_free(sdev, spcm, substream->stream); in sof_pcm_trigger()
483 struct snd_pcm_substream *substream) in sof_pcm_pointer() argument
485 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_pointer()
496 return sof_ops(sdev)->pcm_pointer(sdev, substream); in sof_pcm_pointer()
503 host = bytes_to_frames(substream->runtime, in sof_pcm_pointer()
504 spcm->stream[substream->stream].posn.host_posn); in sof_pcm_pointer()
505 dai = bytes_to_frames(substream->runtime, in sof_pcm_pointer()
506 spcm->stream[substream->stream].posn.dai_posn); in sof_pcm_pointer()
510 spcm->pcm.pcm_id, substream->stream, host, dai); in sof_pcm_pointer()
516 struct snd_pcm_substream *substream) in sof_pcm_open() argument
518 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_open()
519 struct snd_pcm_runtime *runtime = substream->runtime; in sof_pcm_open()
535 spcm->pcm.pcm_id, substream->stream); in sof_pcm_open()
538 caps = &spcm->pcm.caps[substream->stream]; in sof_pcm_open()
566 substream->wait_time = 500; in sof_pcm_open()
568 spcm->stream[substream->stream].posn.host_posn = 0; in sof_pcm_open()
569 spcm->stream[substream->stream].posn.dai_posn = 0; in sof_pcm_open()
570 spcm->stream[substream->stream].substream = substream; in sof_pcm_open()
571 spcm->prepared[substream->stream] = false; in sof_pcm_open()
573 ret = snd_sof_pcm_platform_open(sdev, substream); in sof_pcm_open()
581 struct snd_pcm_substream *substream) in sof_pcm_close() argument
583 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); in sof_pcm_close()
597 spcm->pcm.pcm_id, substream->stream); in sof_pcm_close()
599 err = snd_sof_pcm_platform_close(sdev, substream); in sof_pcm_close()
647 if (!pcm->streams[stream].substream) { in sof_pcm_new()
652 snd_pcm_set_managed_buffer(pcm->streams[stream].substream, in sof_pcm_new()
669 if (!pcm->streams[stream].substream) { in sof_pcm_new()
674 snd_pcm_set_managed_buffer(pcm->streams[stream].substream, in sof_pcm_new()