From patchwork Fri Jul 17 05:11:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51220 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 3392822A28 for ; Fri, 17 Jul 2015 05:13:12 +0000 (UTC) Received: by lbbpo10 with SMTP id po10sf22857366lbb.1 for ; Thu, 16 Jul 2015 22:13:11 -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=uIgZzot4ODOj1rV6vRk1sv0e2m0d2FMGF4CJr6N45Uk=; b=GcNLhxZDSG1BxXxj3rYhgEihqzRWymRaC55qLbJDg9KsCkggldy5cnItrOjTS9B6f/ T0L27VSIlpUocKmcKrZiSaX5TuByWaPuIoM0gWvflcFLBGGRgMRtqiBkPAST/vdvG56T HWyneXaPaG6n1yXEn+NWE3GKTzUOBd5Ds20ocaS5R9xIsWmEb9WkY64vGw2L9tiFdL95 Ceg3l/J8IJg+NXqRIOrPv/wKyW3FQQpeEMiIYx7yoWsol2+G4A+7BE4JIVV/vwnYvJmX bS2ZVe4Co/dV7lKLypJ/+nZCwnfyV/KX+qpCnT6+dTuqh+z04b7ifZFMIPxS5TbgGYty m4TQ== X-Gm-Message-State: ALoCoQliBMTMYSDR/fqvBuG4pSufLpJCg4CxeatqDeCNomn+c5pmYvC+9vGRXICFNqV5i3dLAkoi X-Received: by 10.194.2.169 with SMTP id 9mr6635822wjv.2.1437109991159; Thu, 16 Jul 2015 22:13:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls465084laj.72.gmail; Thu, 16 Jul 2015 22:13:10 -0700 (PDT) X-Received: by 10.112.43.36 with SMTP id t4mr12877384lbl.100.1437109990804; Thu, 16 Jul 2015 22:13:10 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id le10si8854169lac.158.2015.07.16.22.13.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 22:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagx9 with SMTP id x9so55006520lag.1 for ; Thu, 16 Jul 2015 22:13:10 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr12494321lbc.112.1437109990701; Thu, 16 Jul 2015 22:13:10 -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 hn6csp668583lbb; Thu, 16 Jul 2015 22:13:09 -0700 (PDT) X-Received: by 10.66.55.41 with SMTP id o9mr25661746pap.148.1437109986122; Thu, 16 Jul 2015 22:13:06 -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.03; Thu, 16 Jul 2015 22:13:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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 S1756865AbbGQFMn (ORCPT + 5 others); Fri, 17 Jul 2015 01:12:43 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34536 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbbGQFMl (ORCPT ); Fri, 17 Jul 2015 01:12:41 -0400 Received: by pacan13 with SMTP id an13so54834849pac.1 for ; Thu, 16 Jul 2015 22:12:40 -0700 (PDT) X-Received: by 10.70.62.66 with SMTP id w2mr25540157pdr.106.1437109960322; Thu, 16 Jul 2015 22:12:40 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id h12sm9678765pdk.77.2015.07.16.22.12.39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 22:12:39 -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 14/18] ARM/omap2/timer: Migrate to new 'set-state' interface Date: Fri, 17 Jul 2015 10:41:08 +0530 Message-Id: <74364615a643f65b6de9faa4112365e4880c7047.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: list List-ID: X-Mailing-List: linux-omap@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.49 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 omap2 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-omap2/timer.c | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index cac46d852da1..16b37e7196f5 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -102,38 +102,38 @@ static int omap2_gp_timer_set_next_event(unsigned long cycles, return 0; } -static void omap2_gp_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int omap2_gp_timer_shutdown(struct clock_event_device *evt) +{ + __omap_dm_timer_stop(&clkev, OMAP_TIMER_POSTED, clkev.rate); + return 0; +} + +static int omap2_gp_timer_set_periodic(struct clock_event_device *evt) { u32 period; __omap_dm_timer_stop(&clkev, OMAP_TIMER_POSTED, clkev.rate); - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - period = clkev.rate / HZ; - period -= 1; - /* Looks like we need to first set the load value separately */ - __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG, - 0xffffffff - period, OMAP_TIMER_POSTED); - __omap_dm_timer_load_start(&clkev, - OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST, - 0xffffffff - period, OMAP_TIMER_POSTED); - break; - case CLOCK_EVT_MODE_ONESHOT: - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_RESUME: - break; - } + period = clkev.rate / HZ; + period -= 1; + /* Looks like we need to first set the load value separately */ + __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG, 0xffffffff - period, + OMAP_TIMER_POSTED); + __omap_dm_timer_load_start(&clkev, + OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST, + 0xffffffff - period, OMAP_TIMER_POSTED); + return 0; } static struct clock_event_device clockevent_gpt = { - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .rating = 300, - .set_next_event = omap2_gp_timer_set_next_event, - .set_mode = omap2_gp_timer_set_mode, + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + .rating = 300, + .set_next_event = omap2_gp_timer_set_next_event, + .set_state_shutdown = omap2_gp_timer_shutdown, + .set_state_periodic = omap2_gp_timer_set_periodic, + .set_state_oneshot = omap2_gp_timer_shutdown, + .tick_resume = omap2_gp_timer_shutdown, }; static struct property device_disabled = {