]> git.baikalelectronics.ru Git - kernel.git/commit
clk:mxs: Fix bug on frequency divider
authorVictorien Vedrine <victorien.vedrine@ophrys.net>
Mon, 31 Aug 2015 08:45:07 +0000 (10:45 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 1 Oct 2015 22:24:34 +0000 (15:24 -0700)
commit40ff794e09f54720e27db1cfb2100e81cf1a6d8b
tree90dce79afe43232a64cf6f6941d00817565cfb85
parente834e56d427229cb8bd0fd7095e2007fe17333de
clk:mxs: Fix bug on frequency divider

On drivers/clk/mxs/clk-frac.c, the function clk_frac_round_rate returned a bad
result. The division before multiplication computes a wrong value ; the
calculation is inverted to fix the problem. The second issue is that the exact
rate have decimals and they are truncate. The consequence is that the function
clk_frac_set_rate (which use the result of clk_frac_round_rate) computes a
wrong value for the register (the rate generated can be closer to the desired
rate). The correction is : if there is decimal to the result, it is rounded to
the next larger integer.
On drivers/clk/mxs/clk-frac.c, the function clk_frac_recalc_rate returned
a bad result. The multiplication is made before the division to compute a
correct value.

Signed-off-by: Victorien Vedrine <victorien.vedrine@ophrys.net>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/mxs/clk-frac.c