From: Viresh Kumar <viresh.kumar@linaro.org>
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 <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>
Subject: [PATCH 10/18] ARM/mmp/time: Migrate to new 'set-state' interface
Date: Fri, 17 Jul 2015 10:41:04 +0530 [thread overview]
Message-ID: <a785fb39e1b7070da5d53a7d09b140c80c31974e.1437101996.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1437101996.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1437101996.git.viresh.kumar@linaro.org>
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
next prev parent reply other threads:[~2015-07-17 5:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1437101996.git.viresh.kumar@linaro.org>
2015-07-17 5:10 ` [PATCH 01/18] ARM/smp_twd: " Viresh Kumar
2015-07-17 5:10 ` [PATCH 02/18] ARM/cns3xxx/timer: " Viresh Kumar
2015-07-17 5:10 ` [PATCH 03/18] ARM/davinci/time: " Viresh Kumar
2015-07-17 5:10 ` [PATCH 04/18] ARM/dc21285-timer: " Viresh Kumar
2015-07-17 5:10 ` [PATCH 05/18] ARM/gemini/time: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 06/18] ARM/imx/epit: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 07/18] ARM/ixp4xx/timer: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 08/18] ARM/ks8695/time: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 09/18] ARM/lpc32xx/timer: " Viresh Kumar
2015-07-17 5:11 ` Viresh Kumar [this message]
2015-07-17 5:11 ` [PATCH 11/18] ARM/netx/time: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 12/18] ARM/omap1/time: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 13/18] ARM/omap1/timer32: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 14/18] ARM/omap2/timer: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 15/18] ARM/SPEAr/time: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 16/18] ARM/w90x900/time: " Viresh Kumar
2015-07-24 4:53 ` Wan ZongShun
2015-07-17 5:11 ` [PATCH 17/18] ARM/iop/time: " Viresh Kumar
2015-07-17 5:11 ` [PATCH 18/18] ARM/orion/time: " Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a785fb39e1b7070da5d53a7d09b140c80c31974e.1437101996.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=arm@kernel.org \
--cc=arnd.bergmann@linaro.org \
--cc=eric.y.miao@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=olof@lixom.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®