aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2014-09-04 15:24:45 -0400
committerHeiko Stuebner <heiko@sntech.de>2014-09-27 11:57:14 -0400
commitf5f7004fdec7eb1d2372278f1acad5f70f2da1e4 (patch)
treee59bb02e493729029517eda2455988686a5f679e /drivers/clk
parentee17eb83c48e04653d8b430735f82fd4cdac6ca3 (diff)
clk: rockchip: reparent aclk_cpu_pre to the gpll
aclk_cpu_pre on the rk3188 can either be sourced from the armclk or the gpll. To reduce complexity on apll changes caused by cpufreq, reparent it always to the gpll source. If really necessary it could be reparented back on a per board level using the assigned-clocks mechanism. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/rockchip/clk-rk3188.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c
index 1c5e6442dcfb..6a81bc9e54f0 100644
--- a/drivers/clk/rockchip/clk-rk3188.c
+++ b/drivers/clk/rockchip/clk-rk3188.c
@@ -652,12 +652,33 @@ CLK_OF_DECLARE(rk3066a_cru, "rockchip,rk3066a-cru", rk3066a_clk_init);
652 652
653static void __init rk3188a_clk_init(struct device_node *np) 653static void __init rk3188a_clk_init(struct device_node *np)
654{ 654{
655 struct clk *clk1, *clk2;
656 unsigned long rate;
657 int ret;
658
655 rk3188_common_clk_init(np); 659 rk3188_common_clk_init(np);
656 rockchip_clk_register_plls(rk3188_pll_clks, 660 rockchip_clk_register_plls(rk3188_pll_clks,
657 ARRAY_SIZE(rk3188_pll_clks), 661 ARRAY_SIZE(rk3188_pll_clks),
658 RK3188_GRF_SOC_STATUS); 662 RK3188_GRF_SOC_STATUS);
659 rockchip_clk_register_branches(rk3188_clk_branches, 663 rockchip_clk_register_branches(rk3188_clk_branches,
660 ARRAY_SIZE(rk3188_clk_branches)); 664 ARRAY_SIZE(rk3188_clk_branches));
665
666 /* reparent aclk_cpu_pre from apll */
667 clk1 = __clk_lookup("aclk_cpu_pre");
668 clk2 = __clk_lookup("gpll");
669 if (clk1 && clk2) {
670 rate = clk_get_rate(clk1);
671
672 ret = clk_set_parent(clk1, clk2);
673 if (ret < 0)
674 pr_warn("%s: could not reparent aclk_cpu_pre to gpll\n",
675 __func__);
676
677 clk_set_rate(clk1, rate);
678 } else {
679 pr_warn("%s: missing clocks to reparent aclk_cpu_pre to gpll\n",
680 __func__);
681 }
661} 682}
662CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init); 683CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init);
663 684