aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/tegra20_clocks.c
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2012-09-13 05:34:33 -0400
committerStephen Warren <swarren@nvidia.com>2012-09-13 13:34:29 -0400
commitb4350f40f73b75efdceae3d9e04266979acabd8c (patch)
treec2d470788d873f102733dad363f973e8ae8c9216 /arch/arm/mach-tegra/tegra20_clocks.c
parentce32ddaa7087da7c9d43751db423281711a1ff2e (diff)
ARM: Tegra: Add smp_twd clock for Tegra20
Clockevent's frequency is changed upon cpufreq change notification. It fetches local timer's rate to update the clockevent frequency. This patch adds local timer clock for Tegra20. Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra20_clocks.c')
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra20_clocks.c b/arch/arm/mach-tegra/tegra20_clocks.c
index d9ce0087f6a6..840ab262272a 100644
--- a/arch/arm/mach-tegra/tegra20_clocks.c
+++ b/arch/arm/mach-tegra/tegra20_clocks.c
@@ -376,6 +376,25 @@ struct clk_ops tegra_super_ops = {
376 .recalc_rate = tegra20_super_clk_recalc_rate, 376 .recalc_rate = tegra20_super_clk_recalc_rate,
377}; 377};
378 378
379static unsigned long tegra20_twd_clk_recalc_rate(struct clk_hw *hw,
380 unsigned long parent_rate)
381{
382 struct clk_tegra *c = to_clk_tegra(hw);
383 u64 rate = parent_rate;
384
385 if (c->mul != 0 && c->div != 0) {
386 rate *= c->mul;
387 rate += c->div - 1; /* round up */
388 do_div(rate, c->div);
389 }
390
391 return rate;
392}
393
394struct clk_ops tegra_twd_ops = {
395 .recalc_rate = tegra20_twd_clk_recalc_rate,
396};
397
379static u8 tegra20_cop_clk_get_parent(struct clk_hw *hw) 398static u8 tegra20_cop_clk_get_parent(struct clk_hw *hw)
380{ 399{
381 return 0; 400 return 0;