diff mbox series

[4/8] ASoC: SOF: ipc4-topology: Simplify match format print in sof_ipc4_init_input_audio_fmt()

Message ID 20241008110936.22534-5-peter.ujfalusi@linux.intel.com (mailing list archive)
State Accepted
Commit 0126a659fd517103e8ce4d432fbe9b06f0a20510
Headers show
Series ASoC: SOF: ipc4-topology: Rework the module audio format prints | expand

Commit Message

Peter Ujfalusi Oct. 8, 2024, 11:09 a.m. UTC
Print out the information line for the found input format once to avoid
duplicated prints in case when multiple formats are available.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/ipc4-topology.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 1f10926921d5..31cbb7f620fd 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -1305,11 +1305,8 @@  static int sof_ipc4_init_input_audio_fmt(struct snd_sof_dev *sdev,
 		channels = SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT(fmt->fmt_cfg);
 		valid_bits = SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH(fmt->fmt_cfg);
 		if (params_rate(params) == rate && params_channels(params) == channels &&
-		    sample_valid_bits == valid_bits) {
-			dev_dbg(sdev->dev, "matched audio format index for %uHz, %ubit, %u channels: %d\n",
-				rate, valid_bits, channels, i);
+		    sample_valid_bits == valid_bits)
 			break;
-		}
 	}
 
 	if (i == pin_fmts_size) {
@@ -1326,7 +1323,14 @@  static int sof_ipc4_init_input_audio_fmt(struct snd_sof_dev *sdev,
 	/* set base_cfg ibs/obs */
 	base_config->ibs = pin_fmts[i].buffer_size;
 
-	dev_dbg(sdev->dev, "Init input audio formats for %s\n", swidget->widget->name);
+	if (single_format)
+		dev_dbg(sdev->dev, "Input audio format for %s:\n",
+			swidget->widget->name);
+	else
+		dev_dbg(sdev->dev,
+			"Input audio format (format index: %d) for %s:\n", i,
+			swidget->widget->name);
+
 	sof_ipc4_dbg_audio_format(sdev->dev, &pin_fmts[i], 1);
 
 	return i;