From patchwork Mon Jun 8 16:22:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 6566901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2DCBD9F3D1 for ; Mon, 8 Jun 2015 16:25:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50C8920398 for ; Mon, 8 Jun 2015 16:25:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5155A20274 for ; Mon, 8 Jun 2015 16:25:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z1zpa-0003pQ-Rp; Mon, 08 Jun 2015 16:23:22 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z1zpO-0003Vz-DA for linux-arm-kernel@lists.infradead.org; Mon, 08 Jun 2015 16:23:11 +0000 Received: by pdbnf5 with SMTP id nf5so108304241pdb.2 for ; Mon, 08 Jun 2015 09:22:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=581L1hVp51h7QqT6pZMSspXbYkun5H34lF4TOUeEp/Q=; b=RAJYltSePbedE4kwYYIZ/ShfMApyB515f8QYUgBMUuSyHxmG4pHs6WsZSQ+z5ldjUk EsGJPS3kPukf0ePCLPoaughUR//6uU8LRup+1Ri1aEyfRRjOhp2Z2lMA7LnuW+qagXhe hxPbs+siQwF48Sl2+lplZNLfUSNj1trJUsCbp1dB4NW8Y/JN9Iz7eZ2GwUOWvlZI1c6X iDtDkTWbu/3EVozCtii12pX6WrJF9dEw4qdLIxBuCU5Z7ZwYZQKQmItq2mKM9jh0PHgO dGIvGkeNkhmjXp3JVst6kl1f8SGUgf9KhUYjQQ4PoxIr8Usm2tsgQiVu98jO3y5A2GWB Bs7Q== X-Gm-Message-State: ALoCoQn7N59mbP41rkFDhr1EWyoGp9ZYAJPR9XMcJJBp735vCWAX8WKjPG+12vJLMXyzWKqc7mcc X-Received: by 10.70.49.43 with SMTP id r11mr30473305pdn.91.1433780567333; Mon, 08 Jun 2015 09:22:47 -0700 (PDT) Received: from localhost ([122.167.219.251]) by mx.google.com with ESMTPSA id h11sm3057828pdj.27.2015.06.08.09.22.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 08 Jun 2015 09:22:46 -0700 (PDT) Date: Mon, 8 Jun 2015 21:52:42 +0530 From: Viresh Kumar To: Ray Jui Subject: Re: [PATCH 4/6] clocksource: bcm_kona: Migrate to new 'set-state' interface Message-ID: <20150608162242.GA4198@linux> References: <37f46a2101da7435343810d9fa94cfae716c377a.1433768426.git.viresh.kumar@linaro.org> <5575BE20.6020102@broadcom.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5575BE20.6020102@broadcom.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150608_092310_472305_7DA0A202 X-CRM114-Status: GOOD ( 15.72 ) X-Spam-Score: -1.8 (-) Cc: Florian Fainelli , Scott Branden , Daniel Lezcano , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, bcm-kernel-feedback-list@broadcom.com, Thomas Gleixner , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 08-06-15, 09:09, Ray Jui wrote: > There's a typo here. It's "kona" not "cona" Crap, how does this look: From: Viresh Kumar Date: Fri, 27 Feb 2015 13:39:52 +0530 Subject: [PATCH] clocksource: bcm_kona: Migrate to new 'set-state' interface 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 Acked-by: Ray Jui --- 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..9df3f1e3fd0e 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 kona_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 kona_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 = kona_timer_shutdown, + .set_state_oneshot = kona_timer_set_oneshot, + .tick_resume = kona_timer_shutdown, }; static void __init kona_timer_clockevents_init(void)