From patchwork Mon Jul 6 10:54:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50721 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B3B5218EA for ; Mon, 6 Jul 2015 10:58:30 +0000 (UTC) Received: by widjy10 with SMTP id jy10sf50611447wid.3 for ; Mon, 06 Jul 2015 03:58:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe:cc :mime-version:content-type:content-transfer-encoding:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list; bh=Ry126D13U+VS3RZrk/B6mw4HIGuo0YcfNzUW+AwJqkU=; b=KGXF694U22n9vvcNPP3G2UlEOaspiVixAmDLd9OZm9fbDZNPZmkiaHRjqbYu72ph9B /3ppHguTErWOVMR4j7OGZqm829kKqbeaX5dl2zo7pFVEJe7vf6Je8qXoHUemlBCl8uwn GJZjat7f/MqPiQ1UcI4VQ17NQsOkM3HWXCniTSDxA0nKDQClbHgeLWU0EMCDb/dWUVkp 2jESDDSMcZY7QMrzDY2rm4l/nzMYoM2DjgFjkpdHVzK/BjXdbdsfzhR6MynCF8X8bXrk wCKWxzSEbhBaubgQoP6naAvnA5sWEYInGCl4luGJuHqorlbe5hAZ683tKY90WctP4m6B G2FQ== X-Gm-Message-State: ALoCoQlMBvCZGQBvtD6tJEWflXdhyuaEi6Z5x2lfHLTN6sqeDc+cwEDKVhIx8GWVRz4ORK8NwVyc X-Received: by 10.180.182.110 with SMTP id ed14mr15052682wic.5.1436180309709; Mon, 06 Jul 2015 03:58:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.10 with SMTP id p10ls686170lag.29.gmail; Mon, 06 Jul 2015 03:58:29 -0700 (PDT) X-Received: by 10.112.130.68 with SMTP id oc4mr47557982lbb.87.1436180309414; Mon, 06 Jul 2015 03:58:29 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id p8si14976153laf.10.2015.07.06.03.58.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 03:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagx9 with SMTP id x9so149732302lag.1 for ; Mon, 06 Jul 2015 03:58:29 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr48076944lbc.117.1436180309152; Mon, 06 Jul 2015 03:58:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1643237lbb; Mon, 6 Jul 2015 03:58:28 -0700 (PDT) X-Received: by 10.66.159.1 with SMTP id wy1mr106320272pab.103.1436180308243; Mon, 06 Jul 2015 03:58:28 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id uf4si28471628pab.188.2015.07.06.03.58.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 03:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC45G-0006aA-6F; Mon, 06 Jul 2015 10:57:10 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC44e-0005eO-TT for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 10:56:33 +0000 Received: by pddu5 with SMTP id u5so16727604pdd.3 for ; Mon, 06 Jul 2015 03:56:12 -0700 (PDT) X-Received: by 10.66.65.138 with SMTP id x10mr79055796pas.15.1436180172527; Mon, 06 Jul 2015 03:56:12 -0700 (PDT) Received: from localhost ([122.171.186.190]) by mx.google.com with ESMTPSA id pr4sm17826261pbb.30.2015.07.06.03.56.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 Jul 2015 03:56:10 -0700 (PDT) From: Viresh Kumar To: linux-arm-kernel@lists.infradead.org, Daniel Lezcano , linux@arm.linux.org.uk, arnd.bergmann@linaro.org, olof@lixom.net Subject: [PATCH 09/18] ARM/lpc32xx/timer: Migrate to new 'set-state' interface Date: Mon, 6 Jul 2015 16:24:16 +0530 Message-Id: <79792dd6257c2dbdde4f90a4abbdc742490843b7.1436178990.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_035632_987768_7640040C X-CRM114-Status: GOOD ( 14.59 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.173 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.173 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Roland Stigge , linaro-kernel@lists.linaro.org, Kevin Hilman , Viresh Kumar , arm@kernel.org, Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Migrate lpc32xx driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. Cc: Roland Stigge Signed-off-by: Viresh Kumar --- arch/arm/mach-lpc32xx/timer.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c index 4e5837299c04..ff3499d1fb1a 100644 --- a/arch/arm/mach-lpc32xx/timer.c +++ b/arch/arm/mach-lpc32xx/timer.c @@ -43,36 +43,24 @@ static int lpc32xx_clkevt_next_event(unsigned long delta, return 0; } -static void lpc32xx_clkevt_mode(enum clock_event_mode mode, - struct clock_event_device *dev) +static int lpc32xx_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - WARN_ON(1); - break; - - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_SHUTDOWN: - /* - * Disable the timer. When using oneshot, we must also - * disable the timer to wait for the first call to - * set_next_event(). - */ - __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); - break; - - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_RESUME: - break; - } + /* + * Disable the timer. When using oneshot, we must also + * disable the timer to wait for the first call to + * set_next_event(). + */ + __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); + return 0; } static struct clock_event_device lpc32xx_clkevt = { - .name = "lpc32xx_clkevt", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 300, - .set_next_event = lpc32xx_clkevt_next_event, - .set_mode = lpc32xx_clkevt_mode, + .name = "lpc32xx_clkevt", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 300, + .set_next_event = lpc32xx_clkevt_next_event, + .set_state_shutdown = lpc32xx_shutdown, + .set_state_oneshot = lpc32xx_shutdown, }; static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id)