aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap1/timer32k.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 1f7365f5df24..fbbdb806c95a 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/plat-omap/timer32k.c 2 * linux/arch/arm/mach-omap1/timer32k.c
3 * 3 *
4 * OMAP 32K Timer 4 * OMAP 32K Timer
5 * 5 *
@@ -40,7 +40,6 @@
40#include <linux/interrupt.h> 40#include <linux/interrupt.h>
41#include <linux/sched.h> 41#include <linux/sched.h>
42#include <linux/spinlock.h> 42#include <linux/spinlock.h>
43
44#include <linux/err.h> 43#include <linux/err.h>
45#include <linux/clk.h> 44#include <linux/clk.h>
46#include <linux/clocksource.h> 45#include <linux/clocksource.h>
@@ -71,8 +70,6 @@ struct sys_timer omap_timer;
71 70
72#if defined(CONFIG_ARCH_OMAP16XX) 71#if defined(CONFIG_ARCH_OMAP16XX)
73#define TIMER_32K_SYNCHRONIZED 0xfffbc410 72#define TIMER_32K_SYNCHRONIZED 0xfffbc410
74#elif defined(CONFIG_ARCH_OMAP24XX)
75#define TIMER_32K_SYNCHRONIZED (OMAP24XX_32KSYNCT_BASE + 0x10)
76#else 73#else
77#error OMAP 32KHz timer does not currently work on 15XX! 74#error OMAP 32KHz timer does not currently work on 15XX!
78#endif 75#endif
@@ -119,6 +116,14 @@ static inline void omap_32k_timer_stop(void)
119 116
120#define omap_32k_timer_ack_irq() 117#define omap_32k_timer_ack_irq()
121 118
119static int omap_32k_timer_set_next_event(unsigned long delta,
120 struct clock_event_device *dev)
121{
122 omap_32k_timer_start(delta);
123
124 return 0;
125}
126
122static void omap_32k_timer_set_mode(enum clock_event_mode mode, 127static void omap_32k_timer_set_mode(enum clock_event_mode mode,
123 struct clock_event_device *evt) 128 struct clock_event_device *evt)
124{ 129{
@@ -139,8 +144,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
139 144
140static struct clock_event_device clockevent_32k_timer = { 145static struct clock_event_device clockevent_32k_timer = {
141 .name = "32k-timer", 146 .name = "32k-timer",
142 .features = CLOCK_EVT_FEAT_PERIODIC, 147 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
143 .shift = 32, 148 .shift = 32,
149 .set_next_event = omap_32k_timer_set_next_event,
144 .set_mode = omap_32k_timer_set_mode, 150 .set_mode = omap_32k_timer_set_mode,
145}; 151};
146 152
@@ -171,6 +177,8 @@ static struct irqaction omap_32k_timer_irq = {
171 177
172static __init void omap_init_32k_timer(void) 178static __init void omap_init_32k_timer(void)
173{ 179{
180 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
181
174 clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC, 182 clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
175 NSEC_PER_SEC, 183 NSEC_PER_SEC,
176 clockevent_32k_timer.shift); 184 clockevent_32k_timer.shift);