Skip to content

Commit 5f291ad

Browse files
ujfalusigregkh
authored andcommitted
ASoC: SOF: pcm: Move period/buffer configuration print after platform open
[ Upstream commit 4d2ea16 ] The platform specific pcm_open call via snd_sof_pcm_platform_open() can modify the initial buffer configuration via constraints. Move the prints as last step in the sof_pcm_open() function to reflect the final setup. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://patch.msgid.link/20250206092828.7569-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Stable-dep-of: 17661c6 ("ASoC: SOF: ipc4-pcm: Continue the pipeline trigger in case of IPC timeout") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 93c9bee commit 5f291ad

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

sound/soc/sof/pcm.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,6 @@ static int sof_pcm_open(struct snd_soc_component *component,
519519
*/
520520
runtime->hw.buffer_bytes_max = le32_to_cpu(caps->buffer_size_max);
521521

522-
dev_dbg(component->dev, "period min %zd max %zd bytes\n",
523-
runtime->hw.period_bytes_min,
524-
runtime->hw.period_bytes_max);
525-
dev_dbg(component->dev, "period count %d max %d\n",
526-
runtime->hw.periods_min,
527-
runtime->hw.periods_max);
528-
dev_dbg(component->dev, "buffer max %zd bytes\n",
529-
runtime->hw.buffer_bytes_max);
530-
531522
/* set wait time - TODO: come from topology */
532523
substream->wait_time = 500;
533524

@@ -537,10 +528,21 @@ static int sof_pcm_open(struct snd_soc_component *component,
537528
spcm->prepared[substream->stream] = false;
538529

539530
ret = snd_sof_pcm_platform_open(sdev, substream);
540-
if (ret < 0)
531+
if (ret < 0) {
541532
dev_err(component->dev, "error: pcm open failed %d\n", ret);
533+
return ret;
534+
}
542535

543-
return ret;
536+
dev_dbg(component->dev, "period bytes min %zd, max %zd\n",
537+
runtime->hw.period_bytes_min,
538+
runtime->hw.period_bytes_max);
539+
dev_dbg(component->dev, "period count min %d, max %d\n",
540+
runtime->hw.periods_min,
541+
runtime->hw.periods_max);
542+
dev_dbg(component->dev, "buffer bytes max %zd\n",
543+
runtime->hw.buffer_bytes_max);
544+
545+
return 0;
544546
}
545547

546548
static int sof_pcm_close(struct snd_soc_component *component,

0 commit comments

Comments
 (0)