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: 6812841 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 8F322C05AC for ; Fri, 17 Jul 2015 05:14:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9F4F207A0 for ; Fri, 17 Jul 2015 05:14:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4BCF20788 for ; Fri, 17 Jul 2015 05:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756986AbbGQFOJ (ORCPT ); Fri, 17 Jul 2015 01:14:09 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34452 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756807AbbGQFMc (ORCPT ); Fri, 17 Jul 2015 01:12:32 -0400 Received: by pacan13 with SMTP id an13so54832871pac.1 for ; Thu, 16 Jul 2015 22:12:32 -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=ds5p7sHcMbHp0TZft1Q3KigYzTdHT62uDfjApkNBao0=; b=T81fj2Yu0UobKoIMfNi6abzm9jH19P6RtVlDLqGRHMro08AkcPHFbLVH2N4IvWKQje IaqmC/4jrZu7GL4YBMNBMAeHqkhK1y2NUaDToTGL15tgJNuN/cZFvCI4L42eOMnsSuCC mk0lKf+yoU/lcy6X2x7spSyWzYTB4gjrKTr+oTjYfitUSrUjuyTo/FRJCxlUX0+xjU3j IOYc7ufNIQP7DesPmBmrfi9eWRTEd/2tYwwx/AYbHOsQMCHlzdqRNwSZ9WQUAfuZYrP6 tjfneu/AXBi/7Oxeg7INNXpiMzLh/xLIIP2dg0lIR3CDl4SszgonZDYGZuPlGkUwsRLi DsTg== X-Gm-Message-State: ALoCoQmm13XqDdXDYZWw3lMTiizFLqdHAZS0qCsnu5CpyfZE2f7v+TkaM/bjbGRawWb4uxzMfffC 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-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 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)