summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/localtimer.c
diff options
context:
space:
mode:
authorXinyu Chen <b03824@freescale.com>2012-03-05 16:15:20 +0800
committerXinyu Chen <b03824@freescale.com>2012-03-05 16:48:29 +0800
commit4c92f34de3030cb96767d145a95051d5c6320c08 (patch)
tree593d1cc5cb977eb59e4749a5221ca20458bbbd6e /arch/arm/mach-mx6/localtimer.c
parent9ba4c42103fae2c3daff774d95d5103268d28a5b (diff)
ENGR00176068-1 mx6q: add smp_twd clock for localtimer
Add a smp_twd system clock which is simple clock from parent of cpu_clk, and it's rate is half of the cpu_clk. This is used for reprograming the twd clock event after cpu freq is changed. Also disable local timer setup when wait mode enabled. Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/localtimer.c')
-rw-r--r--arch/arm/mach-mx6/localtimer.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/mach-mx6/localtimer.c b/arch/arm/mach-mx6/localtimer.c
index d72fa9312fc2..b8bfdaba0de1 100644
--- a/arch/arm/mach-mx6/localtimer.c
+++ b/arch/arm/mach-mx6/localtimer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,13 +25,18 @@
#include <mach/hardware.h>
+extern bool enable_wait_mode;
/*
* Setup the local clock events for a CPU.
*/
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
{
#ifdef CONFIG_LOCAL_TIMERS
- evt->irq = IRQ_LOCALTIMER;
- twd_timer_setup(evt);
+ if (!enable_wait_mode) {
+ evt->irq = IRQ_LOCALTIMER;
+ twd_timer_setup(evt);
+ return 0;
+ }
#endif
+ return -1;
}