aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/mvebu/kirkwood.c
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2014-08-18 11:30:29 -0400
committerMike Turquette <mturquette@linaro.org>2014-09-02 18:02:54 -0400
commit105299381d8720a3afd4252689ae8551f49944be (patch)
tree4978320975b50e6960af612cbeaab04bb48e549b /drivers/clk/mvebu/kirkwood.c
parente8e8a9b0d86c093b208789fd71501c91a919ffdb (diff)
cpufreq: kirkwood: use the powersave multiplexer
The powersave clock acts like a multiplexer for the cpu, selecting either the clock signal derived from the cpu pll or from the ddr clock. This patch changes powersave from a gate clock to a mux clock to better reflect this behavior. This is a cleaner approach whereby the frequency of the cpu always matches the rate of powersave_clk. The cpufreq driver for the kirkwood platform no longer must parse this behavior out of various calls to clk_enable and clk_disable, but can instead simply select the parent cpu it wants when changing rate. Likewise when requesting the cpu rate we need only query powersave_clk's rate through the usual call to clk_get_rate. The new clock data and corresponding changes to the cpufreq driver are combined into this single commit to avoid a git bisect issue where this cpufreq driver fails to work properly between the commit that updates the kirkwood clock driver and the commit that changes how the cpufreq driver uses that clock. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Tested-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/mvebu/kirkwood.c')
-rw-r--r--drivers/clk/mvebu/kirkwood.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/clk/mvebu/kirkwood.c b/drivers/clk/mvebu/kirkwood.c
index f73a2fa8a561..99550f25975e 100644
--- a/drivers/clk/mvebu/kirkwood.c
+++ b/drivers/clk/mvebu/kirkwood.c
@@ -216,7 +216,6 @@ static const struct clk_gating_soc_desc kirkwood_gating_desc[] __initconst = {
216 { "runit", NULL, 7, 0 }, 216 { "runit", NULL, 7, 0 },
217 { "xor0", NULL, 8, 0 }, 217 { "xor0", NULL, 8, 0 },
218 { "audio", NULL, 9, 0 }, 218 { "audio", NULL, 9, 0 },
219 { "powersave", "cpuclk", 11, 0 },
220 { "sata0", NULL, 14, 0 }, 219 { "sata0", NULL, 14, 0 },
221 { "sata1", NULL, 15, 0 }, 220 { "sata1", NULL, 15, 0 },
222 { "xor1", NULL, 16, 0 }, 221 { "xor1", NULL, 16, 0 },
@@ -247,6 +246,16 @@ struct clk_muxing_ctrl {
247 int num_muxes; 246 int num_muxes;
248}; 247};
249 248
249static const char *powersave_parents[] = {
250 "cpuclk",
251 "ddrclk",
252};
253
254static const struct clk_muxing_soc_desc kirkwood_mux_desc[] __initconst = {
255 { "powersave", powersave_parents, ARRAY_SIZE(powersave_parents),
256 11, 1, 0 },
257};
258
250#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw) 259#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
251 260
252static struct clk *clk_muxing_get_src( 261static struct clk *clk_muxing_get_src(
@@ -323,8 +332,10 @@ static void __init kirkwood_clk_init(struct device_node *np)
323 else 332 else
324 mvebu_coreclk_setup(np, &kirkwood_coreclks); 333 mvebu_coreclk_setup(np, &kirkwood_coreclks);
325 334
326 if (cgnp) 335 if (cgnp) {
327 mvebu_clk_gating_setup(cgnp, kirkwood_gating_desc); 336 mvebu_clk_gating_setup(cgnp, kirkwood_gating_desc);
337 kirkwood_clk_muxing_setup(cgnp, kirkwood_mux_desc);
338 }
328} 339}
329CLK_OF_DECLARE(kirkwood_clk, "marvell,kirkwood-core-clock", 340CLK_OF_DECLARE(kirkwood_clk, "marvell,kirkwood-core-clock",
330 kirkwood_clk_init); 341 kirkwood_clk_init);