From patchwork Fri Jul 17 05:11:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51216 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1203822A28 for ; Fri, 17 Jul 2015 05:13:03 +0000 (UTC) Received: by laef2 with SMTP id f2sf23410593lae.0 for ; Thu, 16 Jul 2015 22:13:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=eRqwIHO/SIz9DUwl0IiD5f4LCothOzJv6noDcMeQ1T0=; b=YSebiN+6PdxGEZzr7FgGb1bkX8ojeAxSDTxWZWA6Tp6Aosz7R7Mt0o7VK6pJYETPlt yb5wYpnZ4u2pzflZkaf0qy+4uMkll2rAZGiJryMvnMrnamVPBsM6Wu+K/CYOfDmiG97k IptEGO9497Gm41XRnY76T6m6y7L9hsfp1dmSRchv7g5lR8rgQw2skx1d5rqcA8zNPC/s QtAdGnVhuACATFjmqW1alW1FjuWflGyre1DqCadPEHaafWA74t4lY2bxsNAPsQa//cUA 9ExGzJnaalmdKtSOMybNFnCUVM3+fUekM2qkae8EtBhVrT3L0z686pLleuYb9f6kABIV 9v8A== X-Gm-Message-State: ALoCoQlM9TnYXQouxFQSvTODnw8n7NE76IaBcGQW2nZTlS9vHHS+BU3ljNyiMRgFvYOFzZbKC9v3 X-Received: by 10.180.216.12 with SMTP id om12mr3626929wic.1.1437109981677; Thu, 16 Jul 2015 22:13:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.98 with SMTP id c2ls484623laf.7.gmail; Thu, 16 Jul 2015 22:13:01 -0700 (PDT) X-Received: by 10.152.43.134 with SMTP id w6mr11481040lal.120.1437109981487; Thu, 16 Jul 2015 22:13:01 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id x10si8869771lbo.118.2015.07.16.22.13.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 22:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lblf12 with SMTP id f12so55198388lbl.2 for ; Thu, 16 Jul 2015 22:13:01 -0700 (PDT) X-Received: by 10.152.18.162 with SMTP id x2mr12754601lad.73.1437109981052; Thu, 16 Jul 2015 22:13:01 -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 hn6csp668523lbb; Thu, 16 Jul 2015 22:12:59 -0700 (PDT) X-Received: by 10.68.94.37 with SMTP id cz5mr25719397pbb.70.1437109979199; Thu, 16 Jul 2015 22:12:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn2si16701042pdb.54.2015.07.16.22.12.58; Thu, 16 Jul 2015 22:12:59 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756764AbbGQFMU (ORCPT + 28 others); Fri, 17 Jul 2015 01:12:20 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34308 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756537AbbGQFMR (ORCPT ); Fri, 17 Jul 2015 01:12:17 -0400 Received: by pacan13 with SMTP id an13so54829432pac.1 for ; Thu, 16 Jul 2015 22:12:17 -0700 (PDT) X-Received: by 10.70.96.2 with SMTP id do2mr25693160pdb.67.1437109936960; Thu, 16 Jul 2015 22:12:16 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id ho10sm9696832pbc.27.2015.07.16.22.12.15 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 22:12:16 -0700 (PDT) From: Viresh Kumar To: arm@kernel.org, olof@lixom.net Cc: linaro-kernel@lists.linaro.org, arnd.bergmann@linaro.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Roland Stigge , linux-kernel@vger.kernel.org (open list), Russell King Subject: [PATCH 09/18] ARM/lpc32xx/timer: Migrate to new 'set-state' interface Date: Fri, 17 Jul 2015 10:41:03 +0530 Message-Id: <9325a3a896b611454f6ab3dcedf69c5799dd5617.1437101996.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.217.175 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)