diff options
Diffstat (limited to 'arch/mips/alchemy/common/power.c')
-rw-r--r-- | arch/mips/alchemy/common/power.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/mips/alchemy/common/power.c b/arch/mips/alchemy/common/power.c index 33a3cdb7444a..997dd56bcc5e 100644 --- a/arch/mips/alchemy/common/power.c +++ b/arch/mips/alchemy/common/power.c | |||
@@ -85,7 +85,11 @@ static unsigned int sleep_static_memctlr[4][3]; | |||
85 | #define SLEEP_TEST_TIMEOUT 1 | 85 | #define SLEEP_TEST_TIMEOUT 1 |
86 | #ifdef SLEEP_TEST_TIMEOUT | 86 | #ifdef SLEEP_TEST_TIMEOUT |
87 | static int sleep_ticks; | 87 | static int sleep_ticks; |
88 | void wakeup_counter0_set(int ticks); | 88 | static void wakeup_counter0_set(int ticks) |
89 | { | ||
90 | au_writel(au_readl(SYS_TOYREAD) + ticks, SYS_TOYMATCH2); | ||
91 | au_sync(); | ||
92 | } | ||
89 | #endif | 93 | #endif |
90 | 94 | ||
91 | static void save_core_regs(void) | 95 | static void save_core_regs(void) |
@@ -183,7 +187,6 @@ static void restore_core_regs(void) | |||
183 | } | 187 | } |
184 | 188 | ||
185 | restore_au1xxx_intctl(); | 189 | restore_au1xxx_intctl(); |
186 | wakeup_counter0_adjust(); | ||
187 | } | 190 | } |
188 | 191 | ||
189 | unsigned long suspend_mode; | 192 | unsigned long suspend_mode; |
@@ -411,6 +414,15 @@ static struct ctl_table pm_dir_table[] = { | |||
411 | */ | 414 | */ |
412 | static int __init pm_init(void) | 415 | static int __init pm_init(void) |
413 | { | 416 | { |
417 | /* init TOY to tick at 1Hz. No need to wait for access bits | ||
418 | * since there's plenty of time between here and the first | ||
419 | * suspend cycle. | ||
420 | */ | ||
421 | if (au_readl(SYS_TOYTRIM) != 32767) { | ||
422 | au_writel(32767, SYS_TOYTRIM); | ||
423 | au_sync(); | ||
424 | } | ||
425 | |||
414 | register_sysctl_table(pm_dir_table); | 426 | register_sysctl_table(pm_dir_table); |
415 | return 0; | 427 | return 0; |
416 | } | 428 | } |