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: 51219 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EC31022A28 for ; Fri, 17 Jul 2015 05:13:08 +0000 (UTC) Received: by widjy10 with SMTP id jy10sf9109033wid.3 for ; Thu, 16 Jul 2015 22:13:08 -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=O3Jf5QYgxfNguvkuPcXVNUSZtfV3GJkM3AdizQ8Wi80=; b=Q8krRWMcPME0iuG8aMnHmAd4X3BzYKmzKOknptT7aHB8M55t7S2GlvxGB2xQE+G47l +KalKLLz/nuSW/WrY8U8Q8uBdyM+vAokYVV3D/oH9YJ/XOvPxKwRzwjFZ2cxQd+7lch0 tnGzCMN+zI9sFPi5tcUlJA8rZCWLCJvswZnN4EKgU53FXnpJqfLG/QXTF1J3nUAuq8Gg emVSWVSvDAcK32UrJeDWJW/lVXVh5vLZ5oIV1eKAETbV4fOcAeYfThbHvg3t28Ju882I aGmu0qCAhnwyxdaFRk1ga6+nDxAlnFf1jSeLJGOM6fGooBLb53F4nR55ETXV8u7fIbU7 THTg== X-Gm-Message-State: ALoCoQk9l0LbJNXE6QQdHrilaGiYgcg7GHI1DGKKo3K3kx8WWS/VHEBb1JZILp6Isrb9JZs7lkQK X-Received: by 10.112.142.67 with SMTP id ru3mr6680169lbb.1.1437109988280; Thu, 16 Jul 2015 22:13:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.81 with SMTP id v17ls524429laz.2.gmail; Thu, 16 Jul 2015 22:13:08 -0700 (PDT) X-Received: by 10.112.118.137 with SMTP id km9mr12824017lbb.28.1437109988107; Thu, 16 Jul 2015 22:13:08 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id p6si8856285lbm.170.2015.07.16.22.13.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 22:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by laem6 with SMTP id m6so55077485lae.0 for ; Thu, 16 Jul 2015 22:13:08 -0700 (PDT) X-Received: by 10.152.1.66 with SMTP id 2mr13032200lak.56.1437109988007; Thu, 16 Jul 2015 22:13:08 -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 hn6csp668570lbb; Thu, 16 Jul 2015 22:13:06 -0700 (PDT) X-Received: by 10.68.211.197 with SMTP id ne5mr25711203pbc.151.1437109983021; Thu, 16 Jul 2015 22:13:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn2si16701042pdb.54.2015.07.16.22.13.02; Thu, 16 Jul 2015 22:13:03 -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 S1756859AbbGQFMk (ORCPT + 28 others); Fri, 17 Jul 2015 01:12:40 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:34779 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbbGQFMg (ORCPT ); Fri, 17 Jul 2015 01:12:36 -0400 Received: by pdbbh15 with SMTP id bh15so10303159pdb.1 for ; Thu, 16 Jul 2015 22:12:36 -0700 (PDT) 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-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.47 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 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)