From patchwork Wed Dec 21 01:20:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 5916 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 7092323E2E for ; Wed, 21 Dec 2011 01:21:09 +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 60C6CA18458 for ; Wed, 21 Dec 2011 01:21:09 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id c11so4044744eaa.11 for ; Tue, 20 Dec 2011 17:21:09 -0800 (PST) Received: by 10.205.138.136 with SMTP id is8mr1549459bkc.35.1324430469226; Tue, 20 Dec 2011 17:21:09 -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 ac16cs27184bkc; Tue, 20 Dec 2011 17:21:09 -0800 (PST) Received: by 10.213.2.131 with SMTP id 3mr3996662ebj.102.1324430467618; Tue, 20 Dec 2011 17:21:07 -0800 (PST) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id p8si2647223eef.135.2011.12.20.17.21.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Dec 2011 17:21:07 -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-221-104.bredband.comhem.se [83.249.221.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPSA id 3EAA165D54; Wed, 21 Dec 2011 02:21:05 +0100 (CET) Received: by Fecusia (sSMTP sendmail emulation); Wed, 21 Dec 2011 02:21:04 +0100 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Linus Walleij Subject: [PATCH] ARM: sp804: modernize clock event registration Date: Wed, 21 Dec 2011 02:20:53 +0100 Message-Id: <1324430453-3680-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.6.4 This removes the hardcoded shift value and lets the clockevent core come up with suitable mult and div factors. Tested on the Integrator/CP. Signed-off-by: Linus Walleij --- arch/arm/common/timer-sp.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index 2393b5b..8794a34 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c @@ -143,7 +143,6 @@ static int sp804_set_next_event(unsigned long next, } static struct clock_event_device sp804_clockevent = { - .shift = 32, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, .set_mode = sp804_set_mode, .set_next_event = sp804_set_next_event, @@ -169,13 +168,9 @@ void __init sp804_clockevents_init(void __iomem *base, unsigned int irq, clkevt_base = base; clkevt_reload = DIV_ROUND_CLOSEST(rate, HZ); - evt->name = name; evt->irq = irq; - evt->mult = div_sc(rate, NSEC_PER_SEC, evt->shift); - evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt); - evt->min_delta_ns = clockevent_delta2ns(0xf, evt); setup_irq(irq, &sp804_timer_irq); - clockevents_register_device(evt); + clockevents_config_and_register(evt, rate, 0xf, 0xffffffff); }