From patchwork Mon Jul 6 10:54:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50724 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 02004218EA for ; Mon, 6 Jul 2015 10:59:08 +0000 (UTC) Received: by laer2 with SMTP id r2sf45978985lae.3 for ; Mon, 06 Jul 2015 03:59:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe:cc :mime-version:content-type:content-transfer-encoding:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list; bh=4x0vkigE2zz1OHXsOSECPffQ7rTa5XREP4MTsfSYTRY=; b=JKQaoYHAm9B2oXMKqhNjSKtNKKUFLz/U34g+o9fR7ey0vYRtGCCrAiZs55lImYfV3C J7jahGESEggmHFME3KAk5g5uC+MLUz3DNwvJD63vupUOOnyCmAm3XwQfGxAzvFZ/6q12 5AHQXarX1XlynPWIXNTD8f/JSwMf8dRAy+V6j0BzVpn3bEx5jznO3k85b0atShs2m9KX 6inzmOnXAziJlQKNxtSh4nr50+7JUsUMXIiFVSMZcveW+eJb9zooKWBqymu+rCJeXO18 kHJxlrM86W8ClptIqMlko98RXs/v6QxoCiDE5wan6wWoceIEhd5sg9XdbjAITtwtINVd 3ufQ== X-Gm-Message-State: ALoCoQnnVulBB6R8WZYJvdJrc193AuThHsvRY9gRZ0cf5NSTIExmCIf1ro8MiwVmGuw2LDCNf2nz X-Received: by 10.112.28.111 with SMTP id a15mr30114846lbh.21.1436180346669; Mon, 06 Jul 2015 03:59:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls626276laj.86.gmail; Mon, 06 Jul 2015 03:59:06 -0700 (PDT) X-Received: by 10.112.40.236 with SMTP id a12mr2968275lbl.1.1436180346372; Mon, 06 Jul 2015 03:59:06 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id p8si14977450laf.10.2015.07.06.03.59.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 03:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by lazt12 with SMTP id t12so4740194laz.2 for ; Mon, 06 Jul 2015 03:59:06 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr48445581lbc.19.1436180346178; Mon, 06 Jul 2015 03:59:06 -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 hn6csp1643552lbb; Mon, 6 Jul 2015 03:59:05 -0700 (PDT) X-Received: by 10.66.136.78 with SMTP id py14mr104213708pab.1.1436180344463; Mon, 06 Jul 2015 03:59:04 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id l3si13815880pdj.121.2015.07.06.03.59.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 03:59:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC45n-0007Pa-D0; Mon, 06 Jul 2015 10:57:43 +0000 Received: from mail-pa0-f44.google.com ([209.85.220.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC44t-0005qS-N5 for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 10:56:48 +0000 Received: by pacws9 with SMTP id ws9so95246940pac.0 for ; Mon, 06 Jul 2015 03:56:27 -0700 (PDT) X-Received: by 10.70.65.10 with SMTP id t10mr104168488pds.151.1436180187376; Mon, 06 Jul 2015 03:56:27 -0700 (PDT) Received: from localhost ([122.171.186.190]) by mx.google.com with ESMTPSA id do16sm17895064pac.15.2015.07.06.03.56.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 Jul 2015 03:56:26 -0700 (PDT) From: Viresh Kumar To: linux-arm-kernel@lists.infradead.org, Daniel Lezcano , linux@arm.linux.org.uk, arnd.bergmann@linaro.org, olof@lixom.net Subject: [PATCH 12/18] ARM/omap1/time: Migrate to new 'set-state' interface Date: Mon, 6 Jul 2015 16:24:19 +0530 Message-Id: <1680d1e2a6b9dd6b76e12c86bde5d84abcebe705.1436178990.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_035647_791066_9B52F14F X-CRM114-Status: GOOD ( 13.76 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.220.44 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, Kevin Hilman , Tony Lindgren , Viresh Kumar , arm@kernel.org, Santosh Shilimkar , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.46 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 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. Cc: Santosh Shilimkar Cc: 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)