Skip to content

Commit d8a5530

Browse files
ujfalusibardliao
authored andcommitted
ASoC: SOF: pcm: Move period/buffer configuration print after platform open
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>
1 parent 4c7ae7d commit d8a5530

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
@@ -536,15 +536,6 @@ static int sof_pcm_open(struct snd_soc_component *component,
536536
*/
537537
runtime->hw.buffer_bytes_max = le32_to_cpu(caps->buffer_size_max);
538538

539-
dev_dbg(component->dev, "period min %zd max %zd bytes\n",
540-
runtime->hw.period_bytes_min,
541-
runtime->hw.period_bytes_max);
542-
dev_dbg(component->dev, "period count %d max %d\n",
543-
runtime->hw.periods_min,
544-
runtime->hw.periods_max);
545-
dev_dbg(component->dev, "buffer max %zd bytes\n",
546-
runtime->hw.buffer_bytes_max);
547-
548539
/* set wait time - TODO: come from topology */
549540
substream->wait_time = 500;
550541

@@ -554,10 +545,21 @@ static int sof_pcm_open(struct snd_soc_component *component,
554545
spcm->prepared[substream->stream] = false;
555546

556547
ret = snd_sof_pcm_platform_open(sdev, substream);
557-
if (ret < 0)
548+
if (ret < 0) {
558549
dev_err(component->dev, "error: pcm open failed %d\n", ret);
550+
return ret;
551+
}
559552

560-
return ret;
553+
dev_dbg(component->dev, "period bytes min %zd, max %zd\n",
554+
runtime->hw.period_bytes_min,
555+
runtime->hw.period_bytes_max);
556+
dev_dbg(component->dev, "period count min %d, max %d\n",
557+
runtime->hw.periods_min,
558+
runtime->hw.periods_max);
559+
dev_dbg(component->dev, "buffer bytes max %zd\n",
560+
runtime->hw.buffer_bytes_max);
561+
562+
return 0;
561563
}
562564

563565
static int sof_pcm_close(struct snd_soc_component *component,

0 commit comments

Comments
 (0)