Skip to content

Commit 62a7b3b

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: SOF: ipc4-pcm: Fix incorrect comparison with number of tdm_slots
In ipc4_ssp_dai_config_pcm_params_match() when comparing params_channels() against hw_config->tdm_slots the comparison should be a <= not a ==. The number of TDM slots must be enough for the number of required channels. But it can be greater. There are various reason why a I2S/TDM link has more TDM slots than a particular audio stream needs. The original comparison would fail on systems that had more TDM slots. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 8a07944 ("ASoC: SOF: ipc4-pcm: Look for best matching hw_config for SSP") Link: https://patch.msgid.link/20250819160525.423416-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 1dd28fd commit 62a7b3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/sof/ipc4-pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,14 @@ static int ipc4_ssp_dai_config_pcm_params_match(struct snd_sof_dev *sdev,
639639

640640
if (params_rate(params) == le32_to_cpu(hw_config->fsync_rate) &&
641641
params_width(params) == le32_to_cpu(hw_config->tdm_slot_width) &&
642-
params_channels(params) == le32_to_cpu(hw_config->tdm_slots)) {
642+
params_channels(params) <= le32_to_cpu(hw_config->tdm_slots)) {
643643
current_config = le32_to_cpu(hw_config->id);
644644
partial_match = false;
645645
/* best match found */
646646
break;
647647
} else if (current_config < 0 &&
648648
params_rate(params) == le32_to_cpu(hw_config->fsync_rate) &&
649-
params_channels(params) == le32_to_cpu(hw_config->tdm_slots)) {
649+
params_channels(params) <= le32_to_cpu(hw_config->tdm_slots)) {
650650
current_config = le32_to_cpu(hw_config->id);
651651
partial_match = true;
652652
/* keep looking for better match */

0 commit comments

Comments
 (0)