summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorChancel Liu <chancel.liu@nxp.com>2025-12-10 15:21:09 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-02 12:56:58 +0100
commit2068cf6f827650071f32c411045efd76bd40d73b (patch)
tree9e409ed80eac79db0d0173c7d5486af1443795ac /sound/soc
parent425672fdb7b6f9897be6a7b1a077da1f9f2ecbe9 (diff)
downloadlinux-2068cf6f827650071f32c411045efd76bd40d73b.tar.gz
linux-2068cf6f827650071f32c411045efd76bd40d73b.tar.bz2
linux-2068cf6f827650071f32c411045efd76bd40d73b.zip
ASoC: fsl_sai: Constrain sample rates from audio PLLs only in master mode
[ Upstream commit 9f4d0899efd9892fc7514c9488270e1bb7dedd2b ] 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: 4edc98598be4 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/fsl/fsl_sai.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 72bfc91e21b9..86730c214914 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -917,8 +917,14 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
tx ? sai->dma_params_tx.maxburst :
sai->dma_params_rx.maxburst);
- ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
- SNDRV_PCM_HW_PARAM_RATE, &sai->constraint_rates);
+ if (sai->is_consumer_mode[tx])
+ ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_RATE,
+ &fsl_sai_rate_constraints);
+ else
+ ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_RATE,
+ &sai->constraint_rates);
return ret;
}