From patchwork Thu Jun 18 10:54:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50033 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 7CFA6228CC for ; Thu, 18 Jun 2015 11:02:54 +0000 (UTC) Received: by wizw5 with SMTP id w5sf20833857wiz.2 for ; Thu, 18 Jun 2015 04:02:53 -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=VM3DmNIic4+0RCVn0+/4HvfDJvv1PegbujKlzqbzuWU=; b=cKMC6CEy/ozDQ3PuFw/4NjTWILbMVp8ZnyG2RP5XxbQjNN0IoIwxmGH7v2coWFKk0/ QeKm1ra08PJAUhKO1GdU55KXjp1qN5hD+y7i1A3uTcHWiVu/vXSyZoxkJ6N+A8tw9IF2 BGp/PMpCnZPgYeDt68uvExvPFVlUHqFNx4jB4UGWuzWqNr93o38G1zQRDykTXHm18YSP dlo/dyCEH2NyYFrTdzb+rDMsQL7nOsh1eRAbY5PDDFhUYA5qpaoWqB8vpreFR5BN1iWH jiQ/o1XP/alZccryRrdotlTR6K4l3vhvhJvokHCcSZA8Iv6thCX/CTh3Ypg/s/QRB5qx Dx1Q== X-Gm-Message-State: ALoCoQn83ehYL29CSKWi4wPeOAxxtBLu3XHi+lGCyV3PVq7SX6Bv9TSea7G6ZQExO2fWAMrcdoys X-Received: by 10.112.40.45 with SMTP id u13mr9892370lbk.0.1434625373716; Thu, 18 Jun 2015 04:02:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.161 with SMTP id jp1ls411402lab.96.gmail; Thu, 18 Jun 2015 04:02:53 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr12486413lae.19.1434625373549; Thu, 18 Jun 2015 04:02:53 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id n4si6199350laj.18.2015.06.18.04.02.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbti3 with SMTP id ti3so49815764lbb.1 for ; Thu, 18 Jun 2015 04:02:53 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr12327330lbc.73.1434625373354; Thu, 18 Jun 2015 04:02:53 -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 hn6csp1098458lbb; Thu, 18 Jun 2015 04:02:52 -0700 (PDT) X-Received: by 10.70.20.196 with SMTP id p4mr20317027pde.58.1434625371007; Thu, 18 Jun 2015 04:02:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ju8si10875527pbb.43.2015.06.18.04.02.50; Thu, 18 Jun 2015 04:02:50 -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 S1755695AbbFRLCf (ORCPT + 30 others); Thu, 18 Jun 2015 07:02:35 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33016 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451AbbFRK4h (ORCPT ); Thu, 18 Jun 2015 06:56:37 -0400 Received: by padev16 with SMTP id ev16so59065355pad.0 for ; Thu, 18 Jun 2015 03:56:36 -0700 (PDT) X-Received: by 10.66.249.198 with SMTP id yw6mr19763631pac.149.1434624996753; Thu, 18 Jun 2015 03:56:36 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id tr3sm7627611pbc.75.2015.06.18.03.56.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:35 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH 26/41] clocksource: time-armada-370-xp: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:40 +0530 Message-Id: <632796e451d257f8bd5f90f779e866870be02db2.1434622147.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.176 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 time-armada-370-xp 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: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Signed-off-by: Viresh Kumar --- drivers/clocksource/time-armada-370-xp.c | 53 +++++++++++++++++--------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c index 0c8c5e337540..2162796fd504 100644 --- a/drivers/clocksource/time-armada-370-xp.c +++ b/drivers/clocksource/time-armada-370-xp.c @@ -121,33 +121,33 @@ armada_370_xp_clkevt_next_event(unsigned long delta, return 0; } -static void -armada_370_xp_clkevt_mode(enum clock_event_mode mode, - struct clock_event_device *dev) +static int armada_370_xp_clkevt_shutdown(struct clock_event_device *evt) { - if (mode == CLOCK_EVT_MODE_PERIODIC) { + /* + * Disable timer. + */ + local_timer_ctrl_clrset(TIMER0_EN, 0); - /* - * Setup timer to fire at 1/HZ intervals. - */ - writel(ticks_per_jiffy - 1, local_base + TIMER0_RELOAD_OFF); - writel(ticks_per_jiffy - 1, local_base + TIMER0_VAL_OFF); + /* + * ACK pending timer interrupt. + */ + writel(TIMER0_CLR_MASK, local_base + LCL_TIMER_EVENTS_STATUS); + return 0; +} - /* - * Enable timer. - */ - local_timer_ctrl_clrset(0, TIMER0_RELOAD_EN | enable_mask); - } else { - /* - * Disable timer. - */ - local_timer_ctrl_clrset(TIMER0_EN, 0); +static int armada_370_xp_clkevt_set_periodic(struct clock_event_device *evt) +{ + /* + * Setup timer to fire at 1/HZ intervals. + */ + writel(ticks_per_jiffy - 1, local_base + TIMER0_RELOAD_OFF); + writel(ticks_per_jiffy - 1, local_base + TIMER0_VAL_OFF); - /* - * ACK pending timer interrupt. - */ - writel(TIMER0_CLR_MASK, local_base + LCL_TIMER_EVENTS_STATUS); - } + /* + * Enable timer. + */ + local_timer_ctrl_clrset(0, TIMER0_RELOAD_EN | enable_mask); + return 0; } static int armada_370_xp_clkevt_irq; @@ -185,7 +185,10 @@ static int armada_370_xp_timer_setup(struct clock_event_device *evt) evt->shift = 32, evt->rating = 300, evt->set_next_event = armada_370_xp_clkevt_next_event, - evt->set_mode = armada_370_xp_clkevt_mode, + evt->set_state_shutdown = armada_370_xp_clkevt_shutdown; + evt->set_state_periodic = armada_370_xp_clkevt_set_periodic; + evt->set_state_oneshot = armada_370_xp_clkevt_shutdown; + evt->tick_resume = armada_370_xp_clkevt_shutdown; evt->irq = armada_370_xp_clkevt_irq; evt->cpumask = cpumask_of(cpu); @@ -197,7 +200,7 @@ static int armada_370_xp_timer_setup(struct clock_event_device *evt) static void armada_370_xp_timer_stop(struct clock_event_device *evt) { - evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); + evt->set_state_shutdown(evt); disable_percpu_irq(evt->irq); }