ARM: tegra: timer: Convert timer suspend/resume to syscore
Colin Cross [Tue, 29 Mar 2011 00:49:12 +0000 (17:49 -0700)]
Signed-off-by: Colin Cross <ccross@android.com>
Change-Id: I914e2836b3ab36218658afc77751a7b394f62400

arch/arm/mach-tegra/timer.c

index 2935c33..cb83ca8 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/clocksource.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/mach/time.h>
 #include <asm/localtimer.h>
@@ -249,13 +250,28 @@ struct sys_timer tegra_timer = {
 #ifdef CONFIG_PM
 static u32 usec_config;
 
-void tegra_timer_suspend(void)
+static int tegra_timer_suspend(void)
 {
        usec_config = timer_readl(TIMERUS_USEC_CFG);
+
+       return 0;
 }
 
-void tegra_timer_resume(void)
+static void tegra_timer_resume(void)
 {
        timer_writel(usec_config, TIMERUS_USEC_CFG);
 }
+
+static struct syscore_ops tegra_timer_syscore_ops = {
+       .suspend = tegra_timer_suspend,
+       .resume = tegra_timer_resume,
+};
+
+static int tegra_timer_syscore_init(void)
+{
+       register_syscore_ops(&tegra_timer_syscore_ops);
+
+       return 0;
+}
+subsys_initcall(tegra_timer_syscore_init);
 #endif