Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186453

[PATCH 10/18] ARM/mmp/time: Migrate to new 'set-state' interface

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 10/18] ARM/mmp/time: Migrate to new 'set-state' interface
Date Fri, 17 Jul 2015 07:20:02 +0200
Message-ID <pN6dY-4dF-9@gated-at.bofh.it> (permalink)
References <pN6dX-4dF-3@gated-at.bofh.it>
X-Original-To arm@kernel.org, olof@lixom.net
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=CJ3ZuipPPsccYM/C2oqIez90EqqB6YaN2euZnFMa58w=; b=WDI6gVaYA5qiYm76Qp8mvoSuQ4PtijvWLfV4irbgVXX5bH7zfuqamBGLfmXZoFXNfg DftZOkUj68POXmWV+6wGgelkpdkVqDmR/rMHLPQQh3Oqr329bhcJTVUI7Z+ZF0TrCseN iJ4yO+LJKpUKBmh1J8xlK8uJGoAkCeEoBx4eKh7FNDGyKtIAI2Ml6MGFMMdJqaeW0URG R69mJN0ilDERiS9+Z7xCmyP0wX8VaTu1pM0KrJcIDNPHyvao5a06Z8bZPA60ZNeqBahS zVHgZv+EbuABSvvvOiHKCr2llS6u+fBioduJBNWoc15AfUj2FWGtiFPH2oKMChHtGh/K Asiw==
X-Gm-Message-State ALoCoQngPwphM1l7PUZDrcMMecGqIelBnKrZbCbqmkiqxU0rddYZ6IpNe/TkaAioDcVAPibeTBaK
X-Received by 10.66.141.42 with SMTP id rl10mr25313076pab.25.1437109941221; Thu, 16 Jul 2015 22:12:21 -0700 (PDT)
X-Mailer git-send-email 2.4.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 74
Organization linux.* mail to news gateway
X-Original-Cc linaro-kernel@lists.linaro.org, arnd.bergmann@linaro.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar <viresh.kumar@linaro.org>, Eric Miao <eric.y.miao@gmail.com>, Haojian Zhuang <haojian.zhuang@gmail.com>, linux-kernel@vger.kernel.org (open list), Russell King <linux@arm.linux.org.uk>
X-Original-Date Fri, 17 Jul 2015 10:41:04 +0530
X-Original-Message-ID <a785fb39e1b7070da5d53a7d09b140c80c31974e.1437101996.git.viresh.kumar@linaro.org>
X-Original-References <cover.1437101996.git.viresh.kumar@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1186453

Show key headers only | View raw


Migrate mmp 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.

We weren't doing anything in set_mode(RESUME) except of
local_irq_{save|restore}(), which isn't required and so ->tick_resume
isn't implemented.

Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 arch/arm/mach-mmp/time.c | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 10bfa03e58d4..dbc697b2fda1 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -124,32 +124,25 @@ static int timer_set_next_event(unsigned long delta,
 	return 0;
 }
 
-static void timer_set_mode(enum clock_event_mode mode,
-			   struct clock_event_device *dev)
+static int timer_set_shutdown(struct clock_event_device *evt)
 {
 	unsigned long flags;
 
 	local_irq_save(flags);
-	switch (mode) {
-	case CLOCK_EVT_MODE_ONESHOT:
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-		/* disable the matching interrupt */
-		__raw_writel(0x00, mmp_timer_base + TMR_IER(0));
-		break;
-	case CLOCK_EVT_MODE_RESUME:
-	case CLOCK_EVT_MODE_PERIODIC:
-		break;
-	}
+	/* disable the matching interrupt */
+	__raw_writel(0x00, mmp_timer_base + TMR_IER(0));
 	local_irq_restore(flags);
+
+	return 0;
 }
 
 static struct clock_event_device ckevt = {
-	.name		= "clockevent",
-	.features	= CLOCK_EVT_FEAT_ONESHOT,
-	.rating		= 200,
-	.set_next_event	= timer_set_next_event,
-	.set_mode	= timer_set_mode,
+	.name			= "clockevent",
+	.features		= CLOCK_EVT_FEAT_ONESHOT,
+	.rating			= 200,
+	.set_next_event		= timer_set_next_event,
+	.set_state_shutdown	= timer_set_shutdown,
+	.set_state_oneshot	= timer_set_shutdown,
 };
 
 static cycle_t clksrc_read(struct clocksource *cs)
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 10/18] ARM/mmp/time: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-17 07:20 +0200

csiph-web