aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/kernel/timers
diff options
context:
space:
mode:
authorAndriy Skulysh <askulysh@gmail.com>2006-09-27 16:20:22 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 16:20:22 +0900
commit3aa770e7972723f479122cf66b529017d2175289 (patch)
treef70d870381cec8034693704e346c53b311db688f /arch/sh/kernel/timers
parentef48e8e3498605351f91f195cc9af0ef981b0dde (diff)
sh: APM/PM support.
This adds some simple PM stubs and the basic APM interfaces, primarily for use by hp6xx, where the existing userland expects it. Signed-off-by: Andriy Skulysh <askulysh@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/timers')
-rw-r--r--arch/sh/kernel/timers/timer-tmu.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c
index d4212add53b..ea4bdf8cdf0 100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
@@ -188,6 +188,18 @@ static struct clk tmu0_clk = {
.ops = &tmu_clk_ops,
};
+static int tmu_timer_start(void)
+{
+ ctrl_outb(TMU_TSTR_INIT, TMU_TSTR);
+ return 0;
+}
+
+static int tmu_timer_stop(void)
+{
+ ctrl_outb(0, TMU_TSTR);
+ return 0;
+}
+
static int tmu_timer_init(void)
{
unsigned long interval;
@@ -197,7 +209,7 @@ static int tmu_timer_init(void)
tmu0_clk.parent = clk_get("module_clk");
/* Start TMU0 */
- ctrl_outb(0, TMU_TSTR);
+ tmu_timer_stop();
#if !defined(CONFIG_CPU_SUBTYPE_SH7300) && !defined(CONFIG_CPU_SUBTYPE_SH7760)
ctrl_outb(TMU_TOCR_INIT, TMU_TOCR);
#endif
@@ -211,13 +223,15 @@ static int tmu_timer_init(void)
ctrl_outl(interval, TMU0_TCOR);
ctrl_outl(interval, TMU0_TCNT);
- ctrl_outb(TMU_TSTR_INIT, TMU_TSTR);
+ tmu_timer_start();
return 0;
}
struct sys_timer_ops tmu_timer_ops = {
.init = tmu_timer_init,
+ .start = tmu_timer_start,
+ .stop = tmu_timer_stop,
.get_frequency = tmu_timer_get_frequency,
.get_offset = tmu_timer_get_offset,
};