All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org,
	pierre-louis.bossart@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	yung-chuan.liao@linux.intel.com, rander.wang@intel.com
Subject: [PATCH 11/11] ASoC: SOF: ipc4-topology: Search only pin 0 formats
Date: Mon, 13 Mar 2023 14:48:56 +0200	[thread overview]
Message-ID: <20230313124856.8140-12-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20230313124856.8140-1-peter.ujfalusi@linux.intel.com>

From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

Base config only contains the input/output audio formats for pin 0. So
match only the pin 0 formats during runtime format selection.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 sound/soc/sof/ipc4-topology.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index c91a90dd8a6e..683182e53a32 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -877,12 +877,15 @@ static int sof_ipc4_init_audio_fmt(struct snd_sof_dev *sdev,
 	}
 
 	/*
-	 * Search supported audio formats to match rate, channels ,and
+	 * Search supported audio formats with pin index 0 to match rate, channels ,and
 	 * sample_valid_bytes from runtime params
 	 */
 	for (i = 0; i < pin_fmts_size; i++) {
 		struct sof_ipc4_audio_format *fmt = &pin_fmts[i].audio_fmt;
 
+		if (pin_fmts[i].pin_index)
+			continue;
+
 		rate = fmt->sampling_frequency;
 		channels = SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT(fmt->fmt_cfg);
 		valid_bits = SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH(fmt->fmt_cfg);
-- 
2.39.2


  parent reply	other threads:[~2023-03-13 12:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 12:48 [PATCH 00/11] ASoC: SOF: ipc4: Add support for formats per pins Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 01/11] ASoC: SOF: rename a couple of tokens Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 02/11] ASoC: SOF: Use input/output pin consistently Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 03/11] ASoC: SOF: ipc4-topology: Add a new field in struct sof_ipc4_available_audio_format Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 04/11] ASoC: SOF: ipc4-topology: Do not parse the DMA_BUFFER_SIZE token Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 05/11] ASoC: SOF: ipc4-topology: Parse the SOF_COMP_TOKENS only once Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 06/11] ASoC: SOF: ipc4-topology: Always parse the output formats in topology Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 07/11] ASoC: SOF: ipc4-topology: Modify the type of available input/output formats Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 08/11] ASoC: SOF: ipc4-topology: Modify the signature of sof_ipc4_init_audio_fmt() Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 09/11] ASoC: SOF: ipc4-topology: Remove the ref_audio_fmt field Peter Ujfalusi
2023-03-13 12:48 ` [PATCH 10/11] ASoC: SOF: ipc4-topology: Add new tokens for input/output pin format count Peter Ujfalusi
2023-03-13 12:48 ` Peter Ujfalusi [this message]
2023-03-14 15:12 ` [PATCH 00/11] ASoC: SOF: ipc4: Add support for formats per pins Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230313124856.8140-12-peter.ujfalusi@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.