aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-lpc32xx
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:12 -0400
commit9325a3a896b611454f6ab3dcedf69c5799dd5617 (patch)
tree102ca7254c043717a9091223007d0c29ff919ff1 /arch/arm/mach-lpc32xx
parent7cfa3c69ca97acfd7cac19652d82aa610015bab8 (diff)
ARM/lpc32xx/timer: Migrate to new 'set-state' interface
Migrate lpc32xx 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: Roland Stigge <stigge@antcom.de> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'arch/arm/mach-lpc32xx')
-rw-r--r--arch/arm/mach-lpc32xx/timer.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index 4e5837299c04..ff3499d1fb1a 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -43,36 +43,24 @@ static int lpc32xx_clkevt_next_event(unsigned long delta,
43 return 0; 43 return 0;
44} 44}
45 45
46static void lpc32xx_clkevt_mode(enum clock_event_mode mode, 46static int lpc32xx_shutdown(struct clock_event_device *evt)
47 struct clock_event_device *dev)
48{ 47{
49 switch (mode) { 48 /*
50 case CLOCK_EVT_MODE_PERIODIC: 49 * Disable the timer. When using oneshot, we must also
51 WARN_ON(1); 50 * disable the timer to wait for the first call to
52 break; 51 * set_next_event().
53 52 */
54 case CLOCK_EVT_MODE_ONESHOT: 53 __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
55 case CLOCK_EVT_MODE_SHUTDOWN: 54 return 0;
56 /*
57 * Disable the timer. When using oneshot, we must also
58 * disable the timer to wait for the first call to
59 * set_next_event().
60 */
61 __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
62 break;
63
64 case CLOCK_EVT_MODE_UNUSED:
65 case CLOCK_EVT_MODE_RESUME:
66 break;
67 }
68} 55}
69 56
70static struct clock_event_device lpc32xx_clkevt = { 57static struct clock_event_device lpc32xx_clkevt = {
71 .name = "lpc32xx_clkevt", 58 .name = "lpc32xx_clkevt",
72 .features = CLOCK_EVT_FEAT_ONESHOT, 59 .features = CLOCK_EVT_FEAT_ONESHOT,
73 .rating = 300, 60 .rating = 300,
74 .set_next_event = lpc32xx_clkevt_next_event, 61 .set_next_event = lpc32xx_clkevt_next_event,
75 .set_mode = lpc32xx_clkevt_mode, 62 .set_state_shutdown = lpc32xx_shutdown,
63 .set_state_oneshot = lpc32xx_shutdown,
76}; 64};
77 65
78static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id) 66static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id)