diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-01-12 06:50:05 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-01-14 13:12:42 -0500 |
commit | 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488 (patch) | |
tree | 5e5fbbc2005b012318b7474f9c6057b9ff3f3814 /arch/arm/mach-ixp4xx/common.c | |
parent | c35ef95c273c06471818f9245a05ac5a6e3ffa34 (diff) |
ARM: use clockevents_config_and_register() where possible
The clockevent core is able to figure out the best mult and shift,
calculate min_delta_ns and max_delta_ns, with the necessary info passed
into clockevents_config_and_register(). Use this combined configure
and register function where possible to make the codes less error prone
and gain some positive diff stat.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Tested-by: Roland Stigge <stigge@antcom.de>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: David Brown <davidb@codeaurora.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Barry Song <baohua.song@csr.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-ixp4xx/common.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 8c0c0e2d0727..65ff98cc865c 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -523,22 +523,15 @@ static struct clock_event_device clockevent_ixp4xx = { | |||
523 | .name = "ixp4xx timer1", | 523 | .name = "ixp4xx timer1", |
524 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 524 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
525 | .rating = 200, | 525 | .rating = 200, |
526 | .shift = 24, | ||
527 | .set_mode = ixp4xx_set_mode, | 526 | .set_mode = ixp4xx_set_mode, |
528 | .set_next_event = ixp4xx_set_next_event, | 527 | .set_next_event = ixp4xx_set_next_event, |
529 | }; | 528 | }; |
530 | 529 | ||
531 | static void __init ixp4xx_clockevent_init(void) | 530 | static void __init ixp4xx_clockevent_init(void) |
532 | { | 531 | { |
533 | clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC, | ||
534 | clockevent_ixp4xx.shift); | ||
535 | clockevent_ixp4xx.max_delta_ns = | ||
536 | clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); | ||
537 | clockevent_ixp4xx.min_delta_ns = | ||
538 | clockevent_delta2ns(0xf, &clockevent_ixp4xx); | ||
539 | clockevent_ixp4xx.cpumask = cpumask_of(0); | 532 | clockevent_ixp4xx.cpumask = cpumask_of(0); |
540 | 533 | clockevents_config_and_register(&clockevent_ixp4xx, IXP4XX_TIMER_FREQ, | |
541 | clockevents_register_device(&clockevent_ixp4xx); | 534 | 0xf, 0xfffffffe); |
542 | } | 535 | } |
543 | 536 | ||
544 | void ixp4xx_restart(char mode, const char *cmd) | 537 | void ixp4xx_restart(char mode, const char *cmd) |