]> git.baikalelectronics.ru Git - kernel.git/commit
clk: mmp: frac: Do not lose last 4 digits of precision
authorLubomir Rintel <lkundrak@v3.sk>
Tue, 19 May 2020 22:41:39 +0000 (00:41 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 28 May 2020 00:55:11 +0000 (17:55 -0700)
commitdc4cc91a29d989ba7d355cbd39c4b3e4c37c0624
treedf09c8881092de255f1fec9faa08139a8d45b58d
parent0e6c92ce1d170795a396f8108369eb2c8412797f
clk: mmp: frac: Do not lose last 4 digits of precision

While calculating the output rate of a fractional divider clock, the
value is divided and multipled by 10000, discarding the least
significant digits -- presumably to fit the intermediate value within 32
bits.

The precision we're losing is, however, not insignificant for things like
I2S clock. Maybe also elsewhere, now that since commit a44dec6c5efc ("clk:
mmp2: Stop pretending PLL outputs are constant") the parent rates are more
precise and no longer rounded to 10000s.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lkml.kernel.org/r/20200519224151.2074597-2-lkundrak@v3.sk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mmp/clk-frac.c