clk: sunxi: factors: Support custom formulas
authorChen-Yu Tsai <wens@csie.org>
Mon, 25 Jan 2016 13:15:43 +0000 (21:15 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Fri, 29 Jan 2016 10:30:27 +0000 (11:30 +0100)
commit435b7be1d812cdbbad997f5279293770dff21abb
treefd85027fb06fb90df14872f7fdb54c10d1d60563
parentcfa63688603398e8de4315cd626f81516c88a4c4
clk: sunxi: factors: Support custom formulas

Some clocks cannot be modelled using the standard factors clk formula,
such as clocks with special pre-dividers on one parent, or clocks
with all power-of-two dividers.

Add support for a custom .recalc callback for factors clk. Also pass
the current parent index to the .get_factor and .recalc callbacks.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi/clk-factors.c
drivers/clk/sunxi/clk-factors.h