From patchwork Mon Jun 8 13:40:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 49623 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7298E214B2 for ; Mon, 8 Jun 2015 13:42:24 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf33742459lbc.2 for ; Mon, 08 Jun 2015 06:42:23 -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=aPzGHHAz+k9dDbi3Bcb1XbzfU/xuTRyPFRp7VUzfinQ=; b=UMw4wP1XmxGTctqLttBR0cgVcWQdXYnN+Fb6jlpWqqUyEs7tmA8tR/Q17k996U0yx4 Z/z2pfWf7LxO36trF/3Av+FOxAcVRsCwXhriJDYqTq/alyfjX2Whh1hzxbGOxl1RtVx7 E3ZBzq+u3i5mkzGo+PPDFA1QTuEd8FPdkPAN6TDnQ1mzeadqeNYz5PkQO477nNLnWriH 8aa7ab67H3X8OnH2aQfZQcO18KnRrdlWg7qMo2pBaY78pV6wMlpciZFXFYWYWp3gL6YE 5PAMFHNGXjQfQAmB4/YX2qelyHWu2eX1fIHUrLc2/eteb7p3Jsd5rEN/CcxAe/Zy9a8s jNAg== X-Gm-Message-State: ALoCoQmh8TGCdGG/riJOoskryf4XcIY5Vrs4CKG6VpPXbo+YLKaWWGI1h9GF98Kg8WHFb0GdEPGi X-Received: by 10.180.97.9 with SMTP id dw9mr12575132wib.2.1433770943450; Mon, 08 Jun 2015 06:42:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.98 with SMTP id lj2ls631357lab.94.gmail; Mon, 08 Jun 2015 06:42:23 -0700 (PDT) X-Received: by 10.152.87.235 with SMTP id bb11mr16584286lab.69.1433770943255; Mon, 08 Jun 2015 06:42:23 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id rk9si2755080lac.100.2015.06.08.06.42.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jun 2015 06:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by laar3 with SMTP id r3so48165598laa.3 for ; Mon, 08 Jun 2015 06:42:23 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr16819236laj.88.1433770942672; Mon, 08 Jun 2015 06:42:22 -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 hn6csp1874559lbb; Mon, 8 Jun 2015 06:42:21 -0700 (PDT) X-Received: by 10.70.63.104 with SMTP id f8mr29918181pds.49.1433770940985; Mon, 08 Jun 2015 06:42:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id em5si4124409pbb.256.2015.06.08.06.42.19; Mon, 08 Jun 2015 06:42:20 -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 S932345AbbFHNmN (ORCPT + 28 others); Mon, 8 Jun 2015 09:42:13 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33513 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932096AbbFHNlb (ORCPT ); Mon, 8 Jun 2015 09:41:31 -0400 Received: by padev16 with SMTP id ev16so40616792pad.0 for ; Mon, 08 Jun 2015 06:41:29 -0700 (PDT) X-Received: by 10.66.141.231 with SMTP id rr7mr30035013pab.86.1433770888977; Mon, 08 Jun 2015 06:41:28 -0700 (PDT) Received: from localhost ([122.167.219.251]) by mx.google.com with ESMTPSA id p9sm2690381pds.92.2015.06.08.06.41.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 08 Jun 2015 06:41:27 -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 , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com Subject: [PATCH 4/6] clocksource: bcm_kona: Migrate to new 'set-state' interface Date: Mon, 8 Jun 2015 19:10:45 +0530 Message-Id: <37f46a2101da7435343810d9fa94cfae716c377a.1433768426.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.41 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 bcm_kona driver to the new 'set-state' interface provided by the 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: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Signed-off-by: Viresh Kumar --- drivers/clocksource/bcm_kona_timer.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c index f1e33d08dd83..4efca5f7d443 100644 --- a/drivers/clocksource/bcm_kona_timer.c +++ b/drivers/clocksource/bcm_kona_timer.c @@ -127,25 +127,25 @@ static int kona_timer_set_next_event(unsigned long clc, return 0; } -static void kona_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *unused) +static int cona_timer_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - /* by default mode is one shot don't do any thing */ - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - default: - kona_timer_disable_and_clear(timers.tmr_regs); - } + kona_timer_disable_and_clear(timers.tmr_regs); + return 0; +} + +static int cona_timer_set_oneshot(struct clock_event_device *evt) +{ + /* By default mode is one shot, don't do any thing */ + return 0; } static struct clock_event_device kona_clockevent_timer = { .name = "timer 1", .features = CLOCK_EVT_FEAT_ONESHOT, .set_next_event = kona_timer_set_next_event, - .set_mode = kona_timer_set_mode + .set_state_shutdown = cona_timer_shutdown, + .set_state_oneshot = cona_timer_set_oneshot, + .tick_resume = cona_timer_shutdown, }; static void __init kona_timer_clockevents_init(void)