arm: allwinner: Fix NM clock recalc

If the NM clock is using a fractional divider the formula isn't the same.
This commit is contained in:
Emmanuel Vadot 2019-03-07 19:28:47 +00:00
parent 73a41ff81c
commit 2b0adb4404

View File

@ -300,7 +300,11 @@ aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq)
else
prediv = 1;
*freq = *freq / prediv / n / m;
/* For FRAC NM the formula is freq_parent * n / m */
if (sc->flags & AW_CLK_HAS_FRAC)
*freq = *freq * n / m;
else
*freq = *freq / prediv / n / m;
}
return (0);