From: heiko@sntech.de (Heiko Stuebner) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/11] clk: rockchip: reparent aclk_cpu_pre to the gpll Date: Sat, 6 Sep 2014 01:06:06 +0200 [thread overview] Message-ID: <1409958374-30937-4-git-send-email-heiko@sntech.de> (raw) In-Reply-To: <1409958374-30937-1-git-send-email-heiko@sntech.de> 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> --- drivers/clk/rockchip/clk-rk3188.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c index b8c5ada..2b893da 100644 --- a/drivers/clk/rockchip/clk-rk3188.c +++ b/drivers/clk/rockchip/clk-rk3188.c @@ -651,12 +651,31 @@ CLK_OF_DECLARE(rk3066a_cru, "rockchip,rk3066a-cru", rk3066a_clk_init); static void __init rk3188a_clk_init(struct device_node *np) { + struct clk *clk1, *clk2; + unsigned long rate; + int ret; + rk3188_common_clk_init(np); rockchip_clk_register_plls(rk3188_pll_clks, ARRAY_SIZE(rk3188_pll_clks), RK3188_GRF_SOC_STATUS); rockchip_clk_register_branches(rk3188_clk_branches, ARRAY_SIZE(rk3188_clk_branches)); + + /* reparent aclk_cpu_pre from apll */ + clk1 = __clk_lookup("aclk_cpu_pre"); + clk2 = __clk_lookup("gpll"); + if (clk1 && clk2) { + rate = clk_get_rate(clk1); + + ret = clk_set_parent(clk1, clk2); + if (ret < 0) + pr_warn("%s: could not reparent aclk_cpu_pre to gpll\n", __func__); + + clk_set_rate(clk1, rate); + } else { + pr_warn("%s: missing clocks to reparent aclk_cpu_pre to gpll\n", __func__); + } } CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init); -- 2.0.1
next prev parent reply other threads:[~2014-09-05 23:06 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-09-05 23:06 [PATCH 00/11] clk: rockchip: add a cpu clock-type Heiko Stuebner 2014-09-05 23:06 ` [PATCH 01/11] clk: rockchip: fix rk3066 pll status register location Heiko Stuebner 2014-09-05 23:06 ` [PATCH 02/11] clk: rockchip: fix rk3288 " Heiko Stuebner 2014-09-08 20:48 ` Doug Anderson 2014-09-05 23:06 ` Heiko Stuebner [this message] 2014-09-05 23:06 ` [PATCH 04/11] clk: rockchip: make tightly bound armclk child-clocks read-only Heiko Stuebner 2014-09-05 23:06 ` [PATCH 05/11] clk: rockchip: add new clock-type for the cpuclk Heiko Stuebner 2014-09-05 23:06 ` [PATCH 06/11] clk: rockchip: add binding id for ARMCLK Heiko Stuebner 2014-09-05 23:06 ` [PATCH 07/11] clk: rockchip: switch to using the new cpuclk type for armclk Heiko Stuebner 2014-09-05 23:06 ` [PATCH 08/11] ARM: dts: rockchip: add operating points and armclk references Heiko Stuebner 2014-09-08 20:16 ` Doug Anderson 2014-09-08 23:45 ` Naoki FUKAUMI 2014-09-12 7:33 ` Kever Yang 2014-09-12 11:37 ` Naoki FUKAUMI 2014-09-16 1:44 ` Kever Yang 2014-09-16 5:23 ` Naoki FUKAUMI 2014-09-05 23:06 ` [PATCH 09/11] ARM: dts: rockchip: add cpu supplies to boards Heiko Stuebner 2014-09-05 23:06 ` [PATCH 10/11] ARM: rockchip: enable cpufreq-related options Heiko Stuebner 2014-09-08 17:52 ` Doug Anderson 2014-09-05 23:06 ` [PATCH 11/11] ARM: rockchip: add a cpufreq-cpu0 device Heiko Stuebner 2014-09-09 20:22 ` [PATCH 00/11] clk: rockchip: add a cpu clock-type Mike Turquette
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1409958374-30937-4-git-send-email-heiko@sntech.de \ --to=heiko@sntech.de \ --cc=linux-arm-kernel@lists.infradead.org \ --subject='Re: [PATCH 03/11] clk: rockchip: reparent aclk_cpu_pre to the gpll' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.