]> git.baikalelectronics.ru Git - kernel.git/commit
clk: zynqmp: Fix divider calculation
authorRajan Vaja <rajan.vaja@xilinx.com>
Thu, 5 Dec 2019 06:35:58 +0000 (22:35 -0800)
committerStephen Boyd <sboyd@kernel.org>
Thu, 23 Jan 2020 21:25:37 +0000 (13:25 -0800)
commit8161fd65e84a4584fdc3e6ba5d905a9d31d30926
tree5f326342b3ded35c7dda9c30118641219c157eeb
parent158bc44c3bfa63b857769b0ca88c6f49f098ccab
clk: zynqmp: Fix divider calculation

zynqmp_clk_divider_round_rate() returns actual divider value
after calculating from parent rate and desired rate, even though
that rate is not supported by single divider of hardware. It is
also possible that such divisor value can be achieved through 2
different dividers. As, Linux tries to set such divisor value(out
of range) in single divider set divider is getting failed.

Fix the same by computing best possible combination of two
divisors which provides more accurate clock rate.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Link: https://lkml.kernel.org/r/1575527759-26452-6-git-send-email-rajan.vaja@xilinx.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/zynqmp/divider.c