Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+21
+21
drivers/clk/rockchip/clk-rk3188.c
··· 652 652 653 653 static 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 659 rk3188_common_clk_init(np); 656 660 rockchip_clk_register_plls(rk3188_pll_clks, 657 661 ARRAY_SIZE(rk3188_pll_clks), 658 662 RK3188_GRF_SOC_STATUS); 659 663 rockchip_clk_register_branches(rk3188_clk_branches, 660 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 } 662 683 CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init); 663 684