Skip to content

Commit 9f4d089

Browse files
Chancel Liubroonie
authored andcommitted
ASoC: fsl_sai: Constrain sample rates from audio PLLs only in master mode
If SAI works in master mode it will generate clocks for external codec from audio PLLs. Thus sample rates should be constrained according to audio PLL clocks. While SAI works in slave mode which means clocks are generated externally then constraints are independent of audio PLLs. Fixes: 4edc985 ("ASoC: fsl_sai: Add sample rate constraint") Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://patch.msgid.link/20251210062109.2577735-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 20c734c commit 9f4d089

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

sound/soc/fsl/fsl_sai.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,14 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
917917
tx ? sai->dma_params_tx.maxburst :
918918
sai->dma_params_rx.maxburst);
919919

920-
ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
921-
SNDRV_PCM_HW_PARAM_RATE, &sai->constraint_rates);
920+
if (sai->is_consumer_mode[tx])
921+
ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
922+
SNDRV_PCM_HW_PARAM_RATE,
923+
&fsl_sai_rate_constraints);
924+
else
925+
ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
926+
SNDRV_PCM_HW_PARAM_RATE,
927+
&sai->constraint_rates);
922928

923929
return ret;
924930
}

0 commit comments

Comments
 (0)