From patchwork Thu Jun 18 10:54:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50030 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 86A3D228CC for ; Thu, 18 Jun 2015 11:02:37 +0000 (UTC) Received: by labsp1 with SMTP id sp1sf20535116lab.3 for ; Thu, 18 Jun 2015 04:02:36 -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=4JaTeEM71nk/VeMVOJxaOMODGyS++ZXFd8ik9QuxJLY=; b=A2/2++xUKEvQRrWssELq+oLuDqjKbS6P/dQ2IjMP+eHhw3YZW0doXsqLs+leaM/0Q7 QXuB+xmxZNInlt2CMG3B5ddUiAXjhwaTilUf3vZj+20P9vmzfQhsaPvitLPyHJEEIslw m68db0SBMtVBxMFyTAC+/T7qyTUhu6A4Qjjn72Rwo3cYpFZ28GwTPPKwf5OTjxN2F7ZQ qozt9vbsWO3OKFDxTX+L8nSje7qpSlE/s4xxKRbVneYAseZMcYOZu7NIsKIBEbQ5DOzl DKUoHAxI0G4svXfwBHU/bi9JNLZi94GMYpjoLXGHCLnq/qLco4Yf6i8dv5eWcMO37uIb Z4Cg== X-Gm-Message-State: ALoCoQldQWfXYdOSge2aJSJ6ZDLhckLG/aiVjAI3q0rUdJcl4st4fMX9d7rCE31FcROClcZfMhgK X-Received: by 10.194.58.164 with SMTP id s4mr2424209wjq.3.1434625356171; Thu, 18 Jun 2015 04:02:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.103 with SMTP id kx7ls450424lac.62.gmail; Thu, 18 Jun 2015 04:02:36 -0700 (PDT) X-Received: by 10.152.121.42 with SMTP id lh10mr12703972lab.0.1434625355981; Thu, 18 Jun 2015 04:02:35 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id eu8si6167678lbc.171.2015.06.18.04.02.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lacny3 with SMTP id ny3so51856418lac.3 for ; Thu, 18 Jun 2015 04:02:35 -0700 (PDT) X-Received: by 10.152.179.234 with SMTP id dj10mr5832575lac.73.1434625355881; Thu, 18 Jun 2015 04:02:35 -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 hn6csp1098276lbb; Thu, 18 Jun 2015 04:02:34 -0700 (PDT) X-Received: by 10.70.38.10 with SMTP id c10mr20125060pdk.72.1434625353676; Thu, 18 Jun 2015 04:02:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si10870392pdl.156.2015.06.18.04.02.32; Thu, 18 Jun 2015 04:02:33 -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 S1755615AbbFRLCV (ORCPT + 30 others); Thu, 18 Jun 2015 07:02:21 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:33565 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754518AbbFRK4r (ORCPT ); Thu, 18 Jun 2015 06:56:47 -0400 Received: by pdjn11 with SMTP id n11so64325588pdj.0 for ; Thu, 18 Jun 2015 03:56:47 -0700 (PDT) X-Received: by 10.68.68.167 with SMTP id x7mr19969833pbt.161.1434625006950; Thu, 18 Jun 2015 03:56:46 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id ux6sm7735294pab.24.2015.06.18.03.56.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:46 -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 , Barry Song Subject: [PATCH 29/41] clocksource: atlas7: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:43 +0530 Message-Id: <797a54c3155022b91781dfc218422de6ef0bd573.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.215.48 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 atlas7 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: Barry Song Signed-off-by: Viresh Kumar --- drivers/clocksource/timer-atlas7.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/clocksource/timer-atlas7.c b/drivers/clocksource/timer-atlas7.c index 60f9de3438b0..27fa13680be1 100644 --- a/drivers/clocksource/timer-atlas7.c +++ b/drivers/clocksource/timer-atlas7.c @@ -76,7 +76,7 @@ static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) /* clear timer interrupt */ writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); - if (ce->mode == CLOCK_EVT_MODE_ONESHOT) + if (clockevent_state_oneshot(ce)) sirfsoc_timer_count_disable(cpu); ce->event_handler(ce); @@ -117,18 +117,11 @@ static int sirfsoc_timer_set_next_event(unsigned long delta, return 0; } -static void sirfsoc_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *ce) +/* Oneshot is enabled in set_next_event */ +static int sirfsoc_timer_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - /* enable in set_next_event */ - break; - default: - break; - } - sirfsoc_timer_count_disable(smp_processor_id()); + return 0; } static void sirfsoc_clocksource_suspend(struct clocksource *cs) @@ -193,7 +186,9 @@ static int sirfsoc_local_timer_setup(struct clock_event_device *ce) ce->name = "local_timer"; ce->features = CLOCK_EVT_FEAT_ONESHOT; ce->rating = 200; - ce->set_mode = sirfsoc_timer_set_mode; + ce->set_state_shutdown = sirfsoc_timer_shutdown; + ce->set_state_oneshot = sirfsoc_timer_shutdown; + ce->tick_resume = sirfsoc_timer_shutdown; ce->set_next_event = sirfsoc_timer_set_next_event; clockevents_calc_mult_shift(ce, atlas7_timer_rate, 60); ce->max_delta_ns = clockevent_delta2ns(-2, ce);