From patchwork Fri Jul 17 05:11:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51226 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABB8522A28 for ; Fri, 17 Jul 2015 05:14:16 +0000 (UTC) Received: by lbbvz8 with SMTP id vz8sf22882887lbb.2 for ; Thu, 16 Jul 2015 22:14:15 -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=vye2n7U12s2H+rzQI9UHi1UbwfzeQnGZHVwGbTGaRZY=; b=Ob54mnDlhFvfCpLf7akQrtcNBWzFFq5TWqePA+3bOsPzLOImwCFeoTalBGRYdWiF6D tCd1wNiNIZSDmHGfWaS/yXIVmpVMNO8EKKmJvrzYP2quTyoXps7m5wb6Ckz7PfeBaYNg lUug4f18SsQThrjznSwSRF3Nzljc1InQdbQ96dHaHKlcSWiEk64Ox+snpCoRzYg0TByg KE1olyojDq2x7LVvtY5L4D/Wh/CHYEF09jUecr2EmPZgrcsZjd3ZanSN2em7XC/kg29z ex114AzCteV9XXKRa0cy8xc/pgWZlfOfhIiY2p4sovLAUt+Ec8PZgBZAYE4sDv2RihNI r45g== X-Gm-Message-State: ALoCoQmkE+TNHy5HoAGBaXVUuTL+CmAI9kvOCtCleu3MM68X3f4aLiBN9oMDgKkAJP/9yAml0A92 X-Received: by 10.112.160.39 with SMTP id xh7mr6572699lbb.22.1437110055663; Thu, 16 Jul 2015 22:14:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.1 with SMTP id g1ls430366lag.46.gmail; Thu, 16 Jul 2015 22:14:15 -0700 (PDT) X-Received: by 10.112.143.136 with SMTP id se8mr12666636lbb.101.1437110055484; Thu, 16 Jul 2015 22:14:15 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id c4si8869219laf.113.2015.07.16.22.14.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 22:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbyj8 with SMTP id yj8so55244191lbb.0 for ; Thu, 16 Jul 2015 22:14:15 -0700 (PDT) X-Received: by 10.152.5.197 with SMTP id u5mr11632230lau.76.1437110055201; Thu, 16 Jul 2015 22:14:15 -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 hn6csp668964lbb; Thu, 16 Jul 2015 22:14:14 -0700 (PDT) X-Received: by 10.70.30.161 with SMTP id t1mr25998430pdh.138.1437110053367; Thu, 16 Jul 2015 22:14:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si16642218pbz.8.2015.07.16.22.14.12; Thu, 16 Jul 2015 22:14:13 -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 S1757002AbbGQFOK (ORCPT + 28 others); Fri, 17 Jul 2015 01:14:10 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34452 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756810AbbGQFMc (ORCPT ); Fri, 17 Jul 2015 01:12:32 -0400 Received: by pacan13 with SMTP id an13so54832870pac.1 for ; Thu, 16 Jul 2015 22:12:32 -0700 (PDT) X-Received: by 10.67.5.37 with SMTP id cj5mr25897298pad.44.1437109951958; Thu, 16 Jul 2015 22:12:31 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id yr9sm9729944pab.26.2015.07.16.22.12.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 22:12:31 -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 12/18] ARM/omap1/time: Migrate to new 'set-state' interface Date: Fri, 17 Jul 2015 10:41:06 +0530 Message-Id: <29105e102085a9c1a1eea4f634db2890aca884b8.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.217.175 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 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/time.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index a7588cfd0286..524977a31a49 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c @@ -124,29 +124,26 @@ static int omap_mpu_set_next_event(unsigned long cycles, return 0; } -static void omap_mpu_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int omap_mpu_set_oneshot(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - omap_mpu_set_autoreset(0); - break; - case CLOCK_EVT_MODE_ONESHOT: - omap_mpu_timer_stop(0); - omap_mpu_remove_autoreset(0); - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_RESUME: - break; - } + omap_mpu_timer_stop(0); + omap_mpu_remove_autoreset(0); + return 0; +} + +static int omap_mpu_set_periodic(struct clock_event_device *evt) +{ + omap_mpu_set_autoreset(0); + return 0; } static struct clock_event_device clockevent_mpu_timer1 = { - .name = "mpu_timer1", - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_next_event = omap_mpu_set_next_event, - .set_mode = omap_mpu_set_mode, + .name = "mpu_timer1", + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + .set_next_event = omap_mpu_set_next_event, + .set_state_periodic = omap_mpu_set_periodic, + .set_state_oneshot = omap_mpu_set_oneshot, }; static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id)