aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/rockchip/clk.c
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2014-09-04 16:10:43 -0400
committerHeiko Stuebner <heiko@sntech.de>2014-09-27 11:57:41 -0400
commitf6fba5f6967dbc062a7c138d67e2314220f5dd04 (patch)
treeb38dc7a0b7bd4d04df982645a61065d7e7661156 /drivers/clk/rockchip/clk.c
parent2b9bceeab70800546050f59cee4efb69c261a683 (diff)
clk: rockchip: add new clock-type for the cpuclk
When changing the armclk on Rockchip SoCs it is supposed to be reparented to an alternate parent before changing the underlying pll and back after the change. Additionally there exist clocks that are very tightly bound to the armclk whose divider values are set according to the armclk rate. Add a special clock-type to handle all that. The rate table and divider values will be supplied from the soc-specific clock controllers. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Doug Anderson <dianders@chromium.org> On a rk3288-board: Tested-by: Doug Anderson <dianders@chromium.org>
Diffstat (limited to 'drivers/clk/rockchip/clk.c')
-rw-r--r--drivers/clk/rockchip/clk.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
index d9c6db2151ba..fd3b5ef87e29 100644
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -297,6 +297,27 @@ void __init rockchip_clk_register_branches(
297 } 297 }
298} 298}
299 299
300void __init rockchip_clk_register_armclk(unsigned int lookup_id,
301 const char *name, const char **parent_names,
302 u8 num_parents,
303 const struct rockchip_cpuclk_reg_data *reg_data,
304 const struct rockchip_cpuclk_rate_table *rates,
305 int nrates)
306{
307 struct clk *clk;
308
309 clk = rockchip_clk_register_cpuclk(name, parent_names, num_parents,
310 reg_data, rates, nrates, reg_base,
311 &clk_lock);
312 if (IS_ERR(clk)) {
313 pr_err("%s: failed to register clock %s: %ld\n",
314 __func__, name, PTR_ERR(clk));
315 return;
316 }
317
318 rockchip_clk_add_lookup(clk, lookup_id);
319}
320
300void __init rockchip_clk_protect_critical(const char *clocks[], int nclocks) 321void __init rockchip_clk_protect_critical(const char *clocks[], int nclocks)
301{ 322{
302 int i; 323 int i;