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)
commit06030c4e33babd63b6630d358a04f3dfb34cc29c
treedf09c8881092de255f1fec9faa08139a8d45b58d
parent8f3d9f354286745c751374f5f1fcafee6b3f3136
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 ea56ad60260e ("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