From patchwork Fri Jun 3 14:57:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 847202 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p53EwJC0022143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jun 2011 14:58:41 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QSVp5-0008LE-3o; Fri, 03 Jun 2011 14:58:03 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QSVp4-0007rR-PO; Fri, 03 Jun 2011 14:58:02 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QSVoB-0007fT-7M for linux-arm-kernel@lists.infradead.org; Fri, 03 Jun 2011 14:57:09 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 03 Jun 2011 15:57:04 +0100 Received: from localhost.localdomain ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jun 2011 15:57:22 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 11/18] ARM: msm: dynamically register local timer Date: Fri, 3 Jun 2011 15:57:26 +0100 Message-Id: <1307113053-30209-12-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com> References: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com> X-OriginalArrivalTime: 03 Jun 2011 14:57:22.0054 (UTC) FILETIME=[8AC5F260:01CC21FE] X-MC-Unique: 111060315570400201 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110603_105707_561751_8567E1CB X-CRM114-Status: GOOD ( 12.62 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [94.185.240.25 listed in list.dnswl.org] Cc: Daniel Walker , David Brown , Stephen Boyd , Bryan Huntsman X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 03 Jun 2011 14:58:41 +0000 (UTC) Cc: David Brown Cc: Daniel Walker Cc: Bryan Huntsman Cc: Stephen Boyd Signed-off-by: Marc Zyngier --- arch/arm/mach-msm/timer.c | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index b2747cc..8595b83 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c @@ -22,9 +22,11 @@ #include #include +#include #include #include #include + #include #define TIMER_MATCH_VAL 0x0000 @@ -188,6 +190,17 @@ static struct msm_clock msm_clocks[] = { } }; +#ifdef CONFIG_SMP +static void __cpuinit msm_local_timer_setup(struct clock_event_device *evt); + +static struct local_timer_ops msm_timer_ops = { + .setup = msm_local_timer_setup, +}; +#define msm_timer_ops_ptr (&msm_timer_ops) +#else +#define msm_timer_ops_ptr NULL +#endif + static void __init msm_timer_init(void) { int i; @@ -216,6 +229,8 @@ static void __init msm_timer_init(void) writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); #endif + percpu_timer_register(msm_timer_ops_ptr); + for (i = 0; i < ARRAY_SIZE(msm_clocks); i++) { struct msm_clock *clock = &msm_clocks[i]; struct clock_event_device *ce = &clock->clockevent; @@ -254,7 +269,7 @@ static void __init msm_timer_init(void) } #ifdef CONFIG_SMP -int __cpuinit local_timer_setup(struct clock_event_device *evt) +static void __cpuinit msm_local_timer_setup(struct clock_event_device *evt) { static bool local_timer_inited; struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER]; @@ -262,7 +277,7 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt) /* Use existing clock_event for cpu 0 */ if (!smp_processor_id()) - return 0; + return; writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); @@ -289,19 +304,13 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt) if (res) { pr_err("local_timer_setup: request_irq failed for %s\n", clock->clockevent.name); - return res; + return; } local_timer_inited = true; } else enable_irq(evt->irq); clockevents_register_device(evt); - return 0; -} - -inline int local_timer_ack(void) -{ - return 1; } #endif