aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/timer32k.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/timer32k.c')
-rw-r--r--arch/arm/mach-omap1/timer32k.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 325b9a0aa4a0..eae49c3980c9 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -71,6 +71,7 @@
71 71
72/* 16xx specific defines */ 72/* 16xx specific defines */
73#define OMAP1_32K_TIMER_BASE 0xfffb9000 73#define OMAP1_32K_TIMER_BASE 0xfffb9000
74#define OMAP1_32KSYNC_TIMER_BASE 0xfffbc400
74#define OMAP1_32K_TIMER_CR 0x08 75#define OMAP1_32K_TIMER_CR 0x08
75#define OMAP1_32K_TIMER_TVR 0x00 76#define OMAP1_32K_TIMER_TVR 0x00
76#define OMAP1_32K_TIMER_TCR 0x04 77#define OMAP1_32K_TIMER_TCR 0x04
@@ -182,10 +183,29 @@ static __init void omap_init_32k_timer(void)
182 * Timer initialization 183 * Timer initialization
183 * --------------------------------------------------------------------------- 184 * ---------------------------------------------------------------------------
184 */ 185 */
185bool __init omap_32k_timer_init(void) 186int __init omap_32k_timer_init(void)
186{ 187{
187 omap_init_clocksource_32k(); 188 int ret = -ENODEV;
188 omap_init_32k_timer();
189 189
190 return true; 190 if (cpu_is_omap16xx()) {
191 void __iomem *base;
192 struct clk *sync32k_ick;
193
194 base = ioremap(OMAP1_32KSYNC_TIMER_BASE, SZ_1K);
195 if (!base) {
196 pr_err("32k_counter: failed to map base addr\n");
197 return -ENODEV;
198 }
199
200 sync32k_ick = clk_get(NULL, "omap_32ksync_ick");
201 if (!IS_ERR(sync32k_ick))
202 clk_enable(sync32k_ick);
203
204 ret = omap_init_clocksource_32k(base);
205 }
206
207 if (!ret)
208 omap_init_32k_timer();
209
210 return ret;
191} 211}