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: 6565351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A3ECEC0020 for ; Mon, 8 Jun 2015 13:45:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D00E3203E3 for ; Mon, 8 Jun 2015 13:45:15 +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 E9F97203B8 for ; Mon, 8 Jun 2015 13:45:14 +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 1Z1xKK-0005y7-0r; Mon, 08 Jun 2015 13:42:56 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z1xJG-0005TG-63 for linux-arm-kernel@lists.infradead.org; Mon, 08 Jun 2015 13:41:50 +0000 Received: by padev16 with SMTP id ev16so40616809pad.0 for ; Mon, 08 Jun 2015 06:41:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=HhRwdGlbPvEho+AnN1VhXctxHL8t1Dr9QRg8Va7Fim4=; b=kGm+aCvGS8hwxrXD+RjKW4Tg+vc0AxACFtEsT1l94DUti6W8I84YyRA/FBcFf6Bdcw qAcTIfpVVBFzA1JRCnBqfxzJfvqeL4h4g3XYlcL2X+53J9yUNG/AEnM+xvbS4g7Fk/S7 baUAu51nwBOv+bdIKujvqkDz0ziEeQaabs2Zw967usyyzhxTWwzCjW354c1K/swb+64T zfcRLwO6gq5bU5vfDirxDgyq6Yn2KDKOidwYg2WgE5uVoNfW/rj9vprGDQBJ6NMjeDX9 DowWNxQeRLbmduT/UxghgzQUNFSO0xENIjNeE4MYRlBYTV2nqi+0WxrZMVXbDOm7H4dS zAdg== X-Gm-Message-State: ALoCoQkCXwINAkTRfMWNjwKH8q+YhTBlviz2IXIC7fKif03uRtdKnwm2doeGRCDB4P3qqsBVgcYa 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150608_064150_286768_24233409 X-CRM114-Status: GOOD ( 13.18 ) X-Spam-Score: -0.7 (/) Cc: Florian Fainelli , Scott Branden , Viresh Kumar , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, bcm-kernel-feedback-list@broadcom.com, Ray Jui , 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: , MIME-Version: 1.0 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 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)