]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: ti: divider: Add the table parsing to get the best divider value
authorKeerthy <j-keerthy@ti.com>
Fri, 2 Dec 2016 09:05:43 +0000 (14:35 +0530)
committerStephen Boyd <sboyd@codeaurora.org>
Fri, 27 Jan 2017 00:03:04 +0000 (16:03 -0800)
commitced3068344ec9730eb160b462154e5fc53f6c2c5
treeb39b588743555c21d5588baa9f4a5b63e7083515
parent843be1e7fb30f6309aa9389344b16dca57e6d4e2
clk: ti: divider: Add the table parsing to get the best divider value

Currently the divider selection logic blindly divides the parent_rate
by the clk rate and gives the divider value for the divider clocks
which do not have the CLK_SET_RATE_PARENT flag set. Add the clk divider
table parsing to get the closest divider available in the table
provided via Device tree.

The code is pretty much taken from: drivers/clk/clk-divider.c.
and used here to fix up the best divider selection logic.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reported-by: Richard Woodruff <r-woodruff2@ti.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/ti/divider.c