]> 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)
commit1ebec0cf20544c4de2c4748680736a6359a4e3e6
treedf09c8881092de255f1fec9faa08139a8d45b58d
parent9b8057e7f937f20763a90a8fc2333168af101732
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 4e21fa82218d ("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