Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8961cae authored by John Hsu's avatar John Hsu Committed by Mark Brown
Browse files

ASoC: nau8825: fix bug in FLL parameter



In the FLL parameter calculation, the FVCO should choose the maximum one.
The patch is to fix the bug about the wrong FVCO chosen.

Signed-off-by: default avatarJohn Hsu <KCHSU0@nuvoton.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
parent 29b4817d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1912,7 +1912,7 @@ static int nau8825_calc_fll_param(unsigned int fll_in, unsigned int fs,
	/* Calculate the FLL 10-bit integer input and the FLL 16-bit fractional
	/* Calculate the FLL 10-bit integer input and the FLL 16-bit fractional
	 * input based on FDCO, FREF and FLL ratio.
	 * input based on FDCO, FREF and FLL ratio.
	 */
	 */
	fvco = div_u64(fvco << 16, fref * fll_param->ratio);
	fvco = div_u64(fvco_max << 16, fref * fll_param->ratio);
	fll_param->fll_int = (fvco >> 16) & 0x3FF;
	fll_param->fll_int = (fvco >> 16) & 0x3FF;
	fll_param->fll_frac = fvco & 0xFFFF;
	fll_param->fll_frac = fvco & 0xFFFF;
	return 0;
	return 0;