From patchwork Fri Jul 17 05:11:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 6812811 Return-Path: X-Original-To: patchwork-linux-omap@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 919BAC05AC for ; Fri, 17 Jul 2015 05:14:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2485207A0 for ; Fri, 17 Jul 2015 05:14:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD89620791 for ; Fri, 17 Jul 2015 05:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756835AbbGQFMi (ORCPT ); Fri, 17 Jul 2015 01:12:38 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:34779 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756831AbbGQFMg (ORCPT ); Fri, 17 Jul 2015 01:12:36 -0400 Received: by pdbbh15 with SMTP id bh15so10303158pdb.1 for ; Thu, 16 Jul 2015 22:12: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:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=A17QAeXle+eXIlP8ma6f2Nyqp5/V8QvniEswtzgwwQw=; b=YzeobqBb7xn6NyAhrxGonNuLyRELywk2scJYqujUqKcJovBa/eSalUiVbNCbYZE+ch 8BwGpHY0dPav1fYAnb2AQv6UTVueIROZL/1QSFlLBtwO3zs0t4tsS2Aupc37HVHI2GA/ HiDpI3DRdeA9ygdRmxH7CFjboe1CFMvXHrU5DpQe0DR67WA4kA6s0ntp8ifUkgiRSNa8 dyNoR/zCHVZ3p/hu2MspjLlKQGyZmCbxr8zeu1U6LhckPxddHgI+LLlWO0XYw5XTDA7u M9I2/n70yNgIuAEkL33Q1iBWsEb1gp39ttGMQS32Ui8talN+JKpAvj/5vDsBlkxeef7R nxUw== X-Gm-Message-State: ALoCoQn7mzHEHs2Zk6Y4Vx4dy72wRZEPqYr0UmS1C9qGLRJvMxo/mpPRRFnas5dcE/RxBlw0o0sN X-Received: by 10.68.131.104 with SMTP id ol8mr26186316pbb.39.1437109956068; Thu, 16 Jul 2015 22:12:36 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id oa14sm9702614pdb.47.2015.07.16.22.12.34 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 22:12:35 -0700 (PDT) From: Viresh Kumar To: arm@kernel.org, olof@lixom.net Cc: linaro-kernel@lists.linaro.org, arnd.bergmann@linaro.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Santosh Shilimkar , Tony Lindgren , linux-kernel@vger.kernel.org (open list), linux-omap@vger.kernel.org (open list:OMAP SUPPORT), Russell King Subject: [PATCH 13/18] ARM/omap1/timer32: Migrate to new 'set-state' interface Date: Fri, 17 Jul 2015 10:41:07 +0530 Message-Id: <69ec063f6018b5931974e7c4ac7a24b1a075ca25.1437101996.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 omap timer32 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. Acked-by: Santosh Shilimkar Acked-by: Tony Lindgren Signed-off-by: Viresh Kumar --- arch/arm/mach-omap1/timer32k.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index 36bf174b3fac..0ae6c52a7d70 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c @@ -114,29 +114,28 @@ static int omap_32k_timer_set_next_event(unsigned long delta, return 0; } -static void omap_32k_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int omap_32k_timer_shutdown(struct clock_event_device *evt) { omap_32k_timer_stop(); + return 0; +} - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); - break; - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - break; - case CLOCK_EVT_MODE_RESUME: - break; - } +static int omap_32k_timer_set_periodic(struct clock_event_device *evt) +{ + omap_32k_timer_stop(); + omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); + return 0; } static struct clock_event_device clockevent_32k_timer = { - .name = "32k-timer", - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_next_event = omap_32k_timer_set_next_event, - .set_mode = omap_32k_timer_set_mode, + .name = "32k-timer", + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + .set_next_event = omap_32k_timer_set_next_event, + .set_state_shutdown = omap_32k_timer_shutdown, + .set_state_periodic = omap_32k_timer_set_periodic, + .set_state_oneshot = omap_32k_timer_shutdown, + .tick_resume = omap_32k_timer_shutdown, }; static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)