linux/drivers/clk/zynqmp
Tejas Patel b8c1049c68 clk: zynqmp: Fix divider2 calculation
zynqmp_get_divider2_val() calculates, divider value of type DIV2 clock,
considering best possible combination of DIV1 and DIV2.

To find best possible values of DIV1 and DIV2, DIV1's parent rate
should be consider and not DIV2's parent rate since it would rate of
div1 clock. Consider a below topology,

	out_clk->div2_clk->div1_clk->fixed_parent

where out_clk = (fixed_parent/div1_clk) / div2_clk, so parent clock
of div1_clk (i.e. out_clk) should be divided by div1_clk and div2_clk.

Existing code divides parent rate of div2_clk's clock instead of
div1_clk's parent rate, which is wrong.

Fix the same by considering div1's parent clock rate.

Fixes: 4ebd92d2e2 ("clk: zynqmp: Fix divider calculation")
Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Link: https://lkml.kernel.org/r/1583185843-20707-3-git-send-email-jolly.shah@xilinx.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2020-05-26 17:59:02 -07:00
..
clk-gate-zynqmp.c
clk-mux-zynqmp.c clk: zynqmp: do not export zynqmp_clk_register_* functions 2019-04-11 11:33:11 -07:00
clk-zynqmp.h clk: zynqmp: use structs for clk query responses 2019-04-19 13:59:55 -07:00
clkc.c clk: zynqmp: Extend driver for versal 2020-01-23 13:22:44 -08:00
divider.c clk: zynqmp: Fix divider2 calculation 2020-05-26 17:59:02 -07:00
Kconfig
Makefile
pll.c clk: zynqmp: Warn user if clock user are more than allowed 2020-01-23 13:25:25 -08:00