From patchwork Sat May 28 09:33:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 68789 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp508597qge; Sat, 28 May 2016 02:36:06 -0700 (PDT) X-Received: by 10.66.63.35 with SMTP id d3mr2714755pas.69.1464428166005; Sat, 28 May 2016 02:36:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r82si20896001pfa.197.2016.05.28.02.36.05; Sat, 28 May 2016 02:36:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753964AbcE1Jfu (ORCPT + 30 others); Sat, 28 May 2016 05:35:50 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:37623 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbcE1Jfn (ORCPT ); Sat, 28 May 2016 05:35:43 -0400 Received: from 172.24.1.47 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CCH96859; Sat, 28 May 2016 17:35:15 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by SZXEML423-HUB.china.huawei.com (10.82.67.154) with Microsoft SMTP Server id 14.3.235.1; Sat, 28 May 2016 17:35:01 +0800 From: Kefeng Wang To: Thomas Gleixner , Daniel Lezcano , Rob Herring CC: , , , , Sudeep Holla , Arnd Bergmann , Subject: [PATCH 3/4] clocksource: sp804: use sp804_timer_disable() where possible Date: Sat, 28 May 2016 17:33:52 +0800 Message-ID: <1464428033-52106-4-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1464428033-52106-1-git-send-email-wangkefeng.wang@huawei.com> References: <1464428033-52106-1-git-send-email-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.57496654.002F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 81cbb8ce30c6ee241072a6b127b3d903 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use sp804_timer_disable() where possible, prepare for 64bit mode timer support. Signed-off-by: Kefeng Wang --- drivers/clocksource/timer-sp804.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 1.7.12.4 diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c index b8848e5..2ff8777 100644 --- a/drivers/clocksource/timer-sp804.c +++ b/drivers/clocksource/timer-sp804.c @@ -105,7 +105,7 @@ void __init __sp804_clocksource_and_sched_clock_init(void __iomem *base, return; /* setup timer 0 as free-running clocksource */ - writel(0, base + TIMER_CTRL); + sp804_timer_disable(base); writel(0xffffffff, base + TIMER_VALUE); sp804_load_mode_set(base, 0xffffffff, TIMER_CTRL_PERIODIC & ~TIMER_CTRL_IE); @@ -196,8 +196,7 @@ void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struc evt->irq = irq; evt->cpumask = cpu_possible_mask; - writel(0, base + TIMER_CTRL); - + sp804_timer_disable(base); setup_irq(irq, &sp804_timer_irq); clockevents_config_and_register(evt, rate, 0xf, 0xffffffff); } @@ -216,8 +215,8 @@ static void __init sp804_of_init(struct device_node *np) return; /* Ensure timers are disabled */ - writel(0, base + TIMER_CTRL); - writel(0, base + TIMER_2_BASE + TIMER_CTRL); + sp804_timer_disable(base); + sp804_timer_disable(base + TIMER_2_BASE); if (initialized || !of_device_is_available(np)) goto err; @@ -274,7 +273,7 @@ static void __init integrator_cp_of_init(struct device_node *np) return; /* Ensure timer is disabled */ - writel(0, base + TIMER_CTRL); + sp804_timer_disable(base); if (init_count == 2 || !of_device_is_available(np)) goto err;