From patchwork Thu Jun 18 10:54:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50019 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A29F228CC for ; Thu, 18 Jun 2015 10:58:33 +0000 (UTC) Received: by lbbwc1 with SMTP id wc1sf19550445lbb.3 for ; Thu, 18 Jun 2015 03:58:32 -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=nw8gsjOvFRQymPbNVGExT0+f987YgRHtiuc5Y5U9DnM=; b=ODrWdM139ysmru+QktZLMH+niq18I+tu7/55LAz3T5HKeQyP0AwJIc7vXH+iqb0Bxb /lSJG7QDmqXJ3QOuqxpoXIUHkIkigt8/SVm/zeRrYDCDB96kzfCOSdT6Vbo0Yl/0yaIZ oB1+lX8WHQp0cSRWpZhjEBKyvozm5O1CcjZWGRNyhYYNH+qpHEFekqU4wzlK6J8xBFUp BAIIFqR7c9K1eiJOqIKd4PcAGZCQdZwMPLtxuT1+SnAOhV9irgb6cdZp2cg82SSfqU8z baYz0tOrv0C/i3u//nHC0y22zcGQeBrvWBRJXzq/QR0fCaJECj/FX6MChdTY1PIppmT3 R22w== X-Gm-Message-State: ALoCoQl33LwrKr27XYHvMKn88iuDFd1Snr8fn11Ytd2rScDmvU2MOQ9oY56fuMKX7/eoRT01up3r X-Received: by 10.194.47.179 with SMTP id e19mr7246416wjn.4.1434625112316; Thu, 18 Jun 2015 03:58:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.7 with SMTP id v7ls413646laa.75.gmail; Thu, 18 Jun 2015 03:58:32 -0700 (PDT) X-Received: by 10.152.87.13 with SMTP id t13mr12607303laz.66.1434625112124; Thu, 18 Jun 2015 03:58:32 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id uq2si6174635lbc.120.2015.06.18.03.58.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 03:58:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbwc1 with SMTP id wc1so49825637lbb.2 for ; Thu, 18 Jun 2015 03:58:32 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr12431036laj.88.1434625112037; Thu, 18 Jun 2015 03:58:32 -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 hn6csp1095869lbb; Thu, 18 Jun 2015 03:58:31 -0700 (PDT) X-Received: by 10.66.141.109 with SMTP id rn13mr19813687pab.127.1434625103001; Thu, 18 Jun 2015 03:58:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xe2si10843486pbb.87.2015.06.18.03.58.22; Thu, 18 Jun 2015 03:58:22 -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 S1755220AbbFRK6R (ORCPT + 30 others); Thu, 18 Jun 2015 06:58:17 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36261 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754925AbbFRK5X (ORCPT ); Thu, 18 Jun 2015 06:57:23 -0400 Received: by paceq1 with SMTP id eq1so34573849pac.3 for ; Thu, 18 Jun 2015 03:57:23 -0700 (PDT) X-Received: by 10.68.232.164 with SMTP id tp4mr19838531pbc.101.1434625043105; Thu, 18 Jun 2015 03:57:23 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id ve1sm7640310pbc.52.2015.06.18.03.57.22 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:57:22 -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 , Jingchang Lu , Stefan Agner , Shawn Guo Subject: [PATCH 39/41] clocksource: vf_pit: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:53 +0530 Message-Id: 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.172 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 vf_pit 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: Jingchang Lu Cc: Stefan Agner Cc: Shawn Guo Signed-off-by: Viresh Kumar --- drivers/clocksource/vf_pit_timer.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/clocksource/vf_pit_timer.c b/drivers/clocksource/vf_pit_timer.c index b45ac6229b57..f07ba9932171 100644 --- a/drivers/clocksource/vf_pit_timer.c +++ b/drivers/clocksource/vf_pit_timer.c @@ -86,20 +86,16 @@ static int pit_set_next_event(unsigned long delta, return 0; } -static void pit_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int pit_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - pit_set_next_event(cycle_per_jiffy, evt); - break; - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_UNUSED: - pit_timer_disable(); - break; - default: - break; - } + pit_timer_disable(); + return 0; +} + +static int pit_set_periodic(struct clock_event_device *evt) +{ + pit_set_next_event(cycle_per_jiffy, evt); + return 0; } static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) @@ -114,7 +110,7 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) * and start the counter again. So software need to disable the timer * to stop the counter loop in ONESHOT mode. */ - if (likely(evt->mode == CLOCK_EVT_MODE_ONESHOT)) + if (likely(clockevent_state_oneshot(evt))) pit_timer_disable(); evt->event_handler(evt); @@ -125,7 +121,8 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) static struct clock_event_device clockevent_pit = { .name = "VF pit timer", .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_mode = pit_set_mode, + .set_state_shutdown = pit_shutdown, + .set_state_periodic = pit_set_periodic, .set_next_event = pit_set_next_event, .rating = 300, };