Lines Matching refs:substream
32 snd_pcm_period_elapsed(sps->substream);
43 void snd_sof_pcm_period_elapsed(struct snd_pcm_substream *substream)
45 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
65 schedule_work(&spcm->stream[substream->stream].period_elapsed_work);
104 struct snd_pcm_substream *substream,
108 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
111 struct snd_pcm_runtime *runtime = substream->runtime;
123 spcm_dbg(spcm, substream->stream, "Entry: hw_params\n");
129 if (spcm->prepared[substream->stream] && pcm_ops && pcm_ops->hw_free) {
130 ret = pcm_ops->hw_free(component, substream);
134 spcm->prepared[substream->stream] = false;
137 ret = snd_sof_pcm_platform_hw_params(sdev, substream, params, &platform_params);
139 spcm_err(spcm, substream->stream, "platform hw params failed\n");
144 if (!spcm->stream[substream->stream].list) {
146 substream->stream);
153 struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream);
156 spcm->stream[substream->stream].page_table.area,
163 ret = pcm_ops->hw_params(component, substream, params, &platform_params);
168 spcm->prepared[substream->stream] = true;
171 memcpy(&spcm->params[substream->stream], params, sizeof(*params));
177 struct snd_pcm_substream *substream,
185 if (spcm->prepared[substream->stream]) {
188 snd_sof_pcm_platform_trigger(sdev, substream,
193 ret = pcm_ops->hw_free(sdev->component, substream);
195 spcm_err(spcm, substream->stream,
201 spcm->prepared[substream->stream] = false;
202 spcm->pending_stop[substream->stream] = false;
206 ret = snd_sof_pcm_platform_hw_free(sdev, substream);
208 spcm_err(spcm, substream->stream,
218 spcm_err(spcm, substream->stream,
230 struct snd_pcm_substream *substream;
236 substream = spcm->stream[dir].substream;
238 if (!substream || !substream->runtime ||
243 ret = sof_pcm_stream_free(sdev, substream, spcm,
255 struct snd_pcm_substream *substream)
257 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
270 spcm_dbg(spcm, substream->stream, "Entry: hw_free\n");
272 ret = sof_pcm_stream_free(sdev, substream, spcm, substream->stream, true);
274 cancel_work_sync(&spcm->stream[substream->stream].period_elapsed_work);
280 struct snd_pcm_substream *substream)
282 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
295 spcm_dbg(spcm, substream->stream, "Entry: prepare\n");
297 if (spcm->prepared[substream->stream]) {
298 if (!spcm->pending_stop[substream->stream])
305 ret = sof_pcm_stream_free(sdev, substream, spcm, substream->stream, true);
312 substream, &spcm->params[substream->stream]);
314 spcm_err(spcm, substream->stream,
327 struct snd_pcm_substream *substream, int cmd)
329 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
345 spcm_dbg(spcm, substream->stream, "Entry: trigger (cmd: %d)\n", cmd);
347 spcm->pending_stop[substream->stream] = false;
358 if (spcm->stream[substream->stream].suspend_ignored) {
364 spcm->stream[substream->stream].suspend_ignored = false;
378 spcm->stream[substream->stream].d0i3_compatible) {
379 spcm->stream[substream->stream].suspend_ignored = true;
394 spcm_err(spcm, substream->stream, "Unhandled trigger cmd %d\n", cmd);
399 snd_sof_pcm_platform_trigger(sdev, substream, cmd);
402 ret = pcm_ops->trigger(component, substream, cmd);
409 snd_sof_pcm_platform_trigger(sdev, substream, cmd);
416 snd_sof_pcm_platform_trigger(sdev, substream, cmd);
425 spcm->pending_stop[substream->stream] = true;
433 ret = sof_pcm_stream_free(sdev, substream, spcm, substream->stream, false);
439 struct snd_pcm_substream *substream)
441 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
453 ret = pcm_ops->pointer(component, substream, &host);
460 return sof_ops(sdev)->pcm_pointer(sdev, substream);
467 host = bytes_to_frames(substream->runtime,
468 spcm->stream[substream->stream].posn.host_posn);
469 dai = bytes_to_frames(substream->runtime,
470 spcm->stream[substream->stream].posn.dai_posn);
472 trace_sof_pcm_pointer_position(sdev, spcm, substream, host, dai);
478 struct snd_pcm_substream *substream)
480 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
481 struct snd_pcm_runtime *runtime = substream->runtime;
496 spcm_dbg(spcm, substream->stream, "Entry: open\n");
498 caps = &spcm->pcm.caps[substream->stream];
517 substream->wait_time = 500;
519 spcm->stream[substream->stream].posn.host_posn = 0;
520 spcm->stream[substream->stream].posn.dai_posn = 0;
521 spcm->stream[substream->stream].substream = substream;
522 spcm->prepared[substream->stream] = false;
524 ret = snd_sof_pcm_platform_open(sdev, substream);
526 spcm_err(spcm, substream->stream,
531 spcm_dbg(spcm, substream->stream, "period bytes min %zd, max %zd\n",
533 spcm_dbg(spcm, substream->stream, "period count min %d, max %d\n",
535 spcm_dbg(spcm, substream->stream, "buffer bytes max %zd\n", runtime->hw.buffer_bytes_max);
541 struct snd_pcm_substream *substream)
543 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
556 spcm_dbg(spcm, substream->stream, "Entry: close\n");
558 err = snd_sof_pcm_platform_close(sdev, substream);
560 spcm_err(spcm, substream->stream,
568 spcm->stream[substream->stream].substream = NULL;
604 if (!pcm->streams[stream].substream) {
605 spcm_err(spcm, stream, "NULL playback substream!\n");
613 snd_pcm_set_managed_buffer(pcm->streams[stream].substream,
643 if (!pcm->streams[stream].substream) {
644 spcm_err(spcm, stream, "NULL capture substream!\n");
652 snd_pcm_set_managed_buffer(pcm->streams[stream].substream,
745 struct snd_pcm_substream *substream)
749 return snd_sof_pcm_platform_ack(sdev, substream);
753 struct snd_pcm_substream *substream)
759 return pcm_ops->delay(component, substream);