diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-10-07 10:38:08 +0530 |
---|---|---|
committer | Rabin VINCENT <rabin.vincent@stericsson.com> | 2011-10-11 05:37:35 +0200 |
commit | eee2430f5a967a4a379496eba2a74eee3f8d2a9f (patch) | |
tree | 34c0885430689f37324d81d4862e289d484bedba /arch/arm | |
parent | 2da301acf3e005022edd4c572cc1e5f1fa16cd9e (diff) |
ux500: add smp_twd clock
Add a smp_twd clock with an appropriate get_rate() implementation so that
localtimers scale correctly with cpufreq changes.
ST-Ericsson ID: 361450
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I492af8efe1c8c081f6079e538f6edf296eca3a02
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33277
Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-ux500/clock.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 06a9bdaec7d..108014ea55b 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c @@ -435,6 +435,29 @@ struct clkops prcc_kclk_rec_ops = { .set_rate = clk_set_rate_rec, }; +#ifdef CONFIG_CPU_FREQ +extern unsigned long dbx500_cpufreq_getfreq(void); + +unsigned long clk_smp_twd_get_rate(struct clk *clk) +{ + return dbx500_cpufreq_getfreq() / 2; +} + +static struct clkops clk_smp_twd_ops = { + .get_rate = clk_smp_twd_get_rate, +}; + +static struct clk clk_smp_twd = { + .name = "smp_twd", + .ops = &clk_smp_twd_ops, +}; + +static struct clk_lookup clk_smp_twd_lookup = { + .clk = &clk_smp_twd, + .dev_id = "smp_twd", +}; +#endif + int __init clk_init(void) { if (cpu_is_u8500()) { @@ -451,5 +474,9 @@ int __init clk_init(void) else if (cpu_is_u5500()) db5500_clk_init(); +#ifdef CONFIG_CPU_FREQ + clkdev_add(&clk_smp_twd_lookup); +#endif + return 0; } |