Skip to content
Unverified Commit 11e756cc authored by Guiting Shen's avatar Guiting Shen Committed by Mark Brown
Browse files

ASoC: tlv320aic32x4: Fix the divide by zero



The value of register(NDAC,MDAC,NADC,MADC,BCLKN) maybe zero lead to
divide by zero in clk_aic32x4_div_recalc_rate().And the rate should be
divide by 128 if the value was zero in this function according to the
datasheet.

Add the macro AIC32X4_DIV_MAX to present the 128 and return 0 if failing
to read the value of register.

Signed-off-by: default avatarGuiting Shen <aarongt.shen@gmail.com>
Link: https://lore.kernel.org/r/20230813125520.11067-1-aarongt.shen@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b39eee27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment