aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-02-27 03:09:52 -0500
committerViresh Kumar <viresh.kumar@linaro.org>2015-07-16 22:56:21 -0400
commita785fb39e1b7070da5d53a7d09b140c80c31974e (patch)
tree295ae349bcf1c5975b67ad31c632f35d5ba82eb4 /arch/arm/mach-mmp
parent9325a3a896b611454f6ab3dcedf69c5799dd5617 (diff)
ARM/mmp/time: Migrate to new 'set-state' interface
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>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r--arch/arm/mach-mmp/time.c29
1 files 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,
124 return 0; 124 return 0;
125} 125}
126 126
127static void timer_set_mode(enum clock_event_mode mode, 127static int timer_set_shutdown(struct clock_event_device *evt)
128 struct clock_event_device *dev)
129{ 128{
130 unsigned long flags; 129 unsigned long flags;
131 130
132 local_irq_save(flags); 131 local_irq_save(flags);
133 switch (mode) { 132 /* disable the matching interrupt */
134 case CLOCK_EVT_MODE_ONESHOT: 133 __raw_writel(0x00, mmp_timer_base + TMR_IER(0));
135 case CLOCK_EVT_MODE_UNUSED:
136 case CLOCK_EVT_MODE_SHUTDOWN:
137 /* disable the matching interrupt */
138 __raw_writel(0x00, mmp_timer_base + TMR_IER(0));
139 break;
140 case CLOCK_EVT_MODE_RESUME:
141 case CLOCK_EVT_MODE_PERIODIC:
142 break;
143 }
144 local_irq_restore(flags); 134 local_irq_restore(flags);
135
136 return 0;
145} 137}
146 138
147static struct clock_event_device ckevt = { 139static struct clock_event_device ckevt = {
148 .name = "clockevent", 140 .name = "clockevent",
149 .features = CLOCK_EVT_FEAT_ONESHOT, 141 .features = CLOCK_EVT_FEAT_ONESHOT,
150 .rating = 200, 142 .rating = 200,
151 .set_next_event = timer_set_next_event, 143 .set_next_event = timer_set_next_event,
152 .set_mode = timer_set_mode, 144 .set_state_shutdown = timer_set_shutdown,
145 .set_state_oneshot = timer_set_shutdown,
153}; 146};
154 147
155static cycle_t clksrc_read(struct clocksource *cs) 148static cycle_t clksrc_read(struct clocksource *cs)