ASoC: SOF: ipc4-topology: Search only pin 0 formats
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 13 Mar 2023 12:48:56 +0000 (14:48 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 13 Mar 2023 14:08:29 +0000 (14:08 +0000)
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>
Link: https://lore.kernel.org/r/20230313124856.8140-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-topology.c

index c91a90dd8a6e46273e67bff839eaf1dd8e267c82..683182e53a32e938f506469e3ca580eb8ed7d35f 100644 (file)
@@ -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);