summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxs
diff options
context:
space:
mode:
authorZhou Jingyu <b02241@freescale.com>2010-04-14 16:32:30 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:20:24 +0200
commitfb498fe6db3c8dff020efaca19ab678be4bf64aa (patch)
tree14ae6c710078f8d68952cbb24b417ff6571c4517 /arch/arm/plat-mxs
parent55ca5343870b3da987060f18838165a6f317575b (diff)
ENGR00117756: add mx28 standby mode
add mx28 standby mode Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/plat-mxs')
-rw-r--r--arch/arm/plat-mxs/timer-match.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/plat-mxs/timer-match.c b/arch/arm/plat-mxs/timer-match.c
index 7d8f2477f4ba..a24c44e2d68a 100644
--- a/arch/arm/plat-mxs/timer-match.c
+++ b/arch/arm/plat-mxs/timer-match.c
@@ -59,9 +59,27 @@ static int mxs_set_next_event(unsigned long delta,
> 0 ? -ETIME : 0;
}
+
static void mxs_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
{
+ switch (mode) {
+ case CLOCK_EVT_MODE_SHUTDOWN:
+ __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN | BM_TIMROT_TIMCTRLn_IRQ,
+ online_timer->base + HW_TIMROT_TIMCTRLn_CLR(0));
+ break;
+ case CLOCK_EVT_MODE_RESUME:
+ case CLOCK_EVT_MODE_ONESHOT:
+ __raw_writel(BM_TIMROT_ROTCTRL_SFTRST | BM_TIMROT_ROTCTRL_CLKGATE,
+ online_timer->base + HW_TIMROT_ROTCTRL_CLR);
+ __raw_writel(BF_TIMROT_TIMCTRLn_SELECT(online_timer->clk_sel) |
+ BM_TIMROT_TIMCTRLn_IRQ_EN |
+ BM_TIMROT_TIMCTRLn_MATCH_MODE,
+ online_timer->base + HW_TIMROT_TIMCTRLn(online_timer->id));
+ break;
+ default:
+ break;
+ }
}
static struct clock_event_device mxs_clockevent = {
@@ -142,3 +160,5 @@ void mxs_timer_init(struct mxs_sys_timer *timer)
mxs_clockevent_init(online_timer->clk);
setup_irq(online_timer->irq, &mxs_timer_irq);
}
+
+