diff options
author | Chen-Yu Tsai <wens@csie.org> | 2014-06-26 23:55:42 +0800 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2014-07-04 12:05:13 +0200 |
commit | ea5671bffbb2b6eefdce7e467a162ae2eef032ac (patch) | |
tree | dd3d35bcbe814cdb2d311921ee4b6a78d8747ea0 | |
parent | 9a5e6c7eb5ccbb5f0d3a1dffce135f0a727f40e1 (diff) | |
download | op-kernel-dev-ea5671bffbb2b6eefdce7e467a162ae2eef032ac.zip op-kernel-dev-ea5671bffbb2b6eefdce7e467a162ae2eef032ac.tar.gz |
clk: sunxi: Add support for table-based divider clocks
A few of the clock modules have odd dividers, such as
the 2 lowest dividers being the same (2), or have the
same divider when the highest bit is set.
This patch adds support for optional divider tables,
so the clock framework will know about the odd values.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
-rw-r--r-- | drivers/clk/sunxi/clk-sunxi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index a38c799..6fe9492 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -664,6 +664,7 @@ struct div_data { u8 shift; u8 pow; u8 width; + const struct clk_div_table *table; }; static const struct div_data sun4i_axi_data __initconst = { @@ -704,10 +705,10 @@ static void __init sunxi_divider_clk_setup(struct device_node *node, of_property_read_string(node, "clock-output-names", &clk_name); - clk = clk_register_divider(NULL, clk_name, clk_parent, 0, - reg, data->shift, data->width, - data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0, - &clk_lock); + clk = clk_register_divider_table(NULL, clk_name, clk_parent, 0, + reg, data->shift, data->width, + data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0, + data->table, &clk_lock); if (clk) { of_clk_add_provider(node, of_clk_src_simple_get, clk); clk_register_clkdev(clk, clk_name, NULL); |