From patchwork Wed Jan 4 10:21:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 6045 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 88F3B23E13 for ; Wed, 4 Jan 2012 10:22:00 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7F01AA1812B for ; Wed, 4 Jan 2012 10:22:00 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id c11so16521072eaa.11 for ; Wed, 04 Jan 2012 02:22:00 -0800 (PST) Received: by 10.204.156.219 with SMTP id y27mr12116123bkw.71.1325672520321; Wed, 04 Jan 2012 02:22:00 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs364703bkc; Wed, 4 Jan 2012 02:22:00 -0800 (PST) Received: by 10.152.111.7 with SMTP id ie7mr44803407lab.11.1325672518928; Wed, 04 Jan 2012 02:21:58 -0800 (PST) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id ip8si43959653lab.7.2012.01.04.02.21.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jan 2012 02:21:58 -0800 (PST) Received-SPF: neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) smtp.mail=linus.walleij@linaro.org Received: from Fecusia (c83-249-216-194.bredband.comhem.se [83.249.216.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPSA id 01CC865D55; Wed, 4 Jan 2012 11:21:56 +0100 (CET) Received: by Fecusia (sSMTP sendmail emulation); Wed, 4 Jan 2012 11:21:55 +0100 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Kristoffer Ericson Subject: [PATCH 2/2] mach-sa1100: modernize and cleanup timer code Date: Wed, 4 Jan 2012 11:21:53 +0100 Message-Id: <1325672513-16725-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.6.4 This gets rid of the hairy mult/shift calculation for SA1100 timers and relies on clockevent core to figure this out, and removes the hard-coded rate constant in favor of the CLOCK_TICK_RATE already used by the clocksource. Cc: Kristoffer Ericson Signed-off-by: Linus Walleij --- arch/arm/mach-sa1100/time.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 69e3353..5cb8c7b 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c @@ -88,20 +88,14 @@ static void __init sa1100_timer_init(void) OIER = 0; OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; - setup_sched_clock(sa1100_read_sched_clock, 32, 3686400); - - clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4); - ckevt_sa1100_osmr0.max_delta_ns = - clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0); - ckevt_sa1100_osmr0.min_delta_ns = - clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1; + setup_sched_clock(sa1100_read_sched_clock, 32, CLOCK_TICK_RATE); ckevt_sa1100_osmr0.cpumask = cpumask_of(0); - setup_irq(IRQ_OST0, &sa1100_timer_irq); clocksource_mmio_init(&OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); - clockevents_register_device(&ckevt_sa1100_osmr0); + clockevents_config_and_register(&ckevt_sa1100_osmr0, CLOCK_TICK_RATE, + MIN_OSCR_DELTA * 2, 0x7fffffff); } #ifdef CONFIG_PM