Skip to content

Commit cce34d1

Browse files
Olivier Moysanbroonie
authored andcommitted
ASoC: stm32: sai: add a check on minimal kernel frequency
On MP2 SoCs SAI kernel clock rate is managed through stm32_sai_set_parent_rate() function. If the kernel clock rate was set previously to a low frequency, this frequency may be too low to support the newly requested audio stream rate. However the stm32_sai_rate_accurate() will only check accuracy against the maximum kernel clock rate. The function will return leaving the kernel clock rate unchanged. Add a check on minimal frequency requirement, to avoid this. Fixes: 2cfe1ff ("ASoC: stm32: sai: add stm32mp25 support") Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Link: https://patch.msgid.link/20250430165210.321273-3-olivier.moysan@foss.st.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent edea927 commit cce34d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sound/soc/stm/stm32_sai_sub.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ static int stm32_sai_set_parent_rate(struct stm32_sai_sub_data *sai,
447447
* return immediately.
448448
*/
449449
sai_curr_rate = clk_get_rate(sai->sai_ck);
450-
if (stm32_sai_rate_accurate(sai_ck_max_rate, sai_curr_rate))
450+
dev_dbg(&pdev->dev, "kernel clock rate: min [%u], max [%u], current [%u]",
451+
sai_ck_min_rate, sai_ck_max_rate, sai_curr_rate);
452+
if (stm32_sai_rate_accurate(sai_ck_max_rate, sai_curr_rate) &&
453+
sai_curr_rate >= sai_ck_min_rate)
451454
return 0;
452455

453456
/*

0 commit comments

Comments
 (0)