summaryrefslogtreecommitdiffstats
path: root/target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c
diff options
context:
space:
mode:
authorlars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-22 18:13:02 +0000
committerlars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-22 18:13:02 +0000
commit15b54dd2c0764032b4a1ac4ad3964bbd2b159fc8 (patch)
tree81451fdfa8fd3505f92633bd3393b944425ee15f /target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c
parent08ecc47d814795b113c96127d7be0cb6ed18b303 (diff)
[xburst] Cleanup clock module a bit and replace last users of __cpm_*
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19281 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c')
-rw-r--r--target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c
index d19bb81f0..9fb0cebab 100644
--- a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c
+++ b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/pm.c
@@ -18,45 +18,25 @@
#include <linux/delay.h>
#include <linux/suspend.h>
#include <asm/mach-jz4740/regs.h>
+#include <asm/mach-jz4740/clock.h>
extern void jz4740_intc_suspend(void);
extern void jz4740_intc_resume(void);
static int jz_pm_enter(suspend_state_t state)
{
- unsigned long nfcsr = REG_EMC_NFCSR;
- uint32_t scr = REG_CPM_SCR;
-
- /* Disable nand flash */
- REG_EMC_NFCSR = ~0xff;
-
- udelay(100);
-
- /*stop udc and usb*/
- REG_CPM_SCR &= ~( 1<<6 | 1<<7);
- REG_CPM_SCR |= 0<<6 | 1<<7;
-
jz4740_intc_suspend();
- /* Enter SLEEP mode */
- REG_CPM_LCR &= ~CPM_LCR_LPM_MASK;
- REG_CPM_LCR |= CPM_LCR_LPM_SLEEP;
+ jz4740_clock_set_wait_mode(JZ4740_WAIT_MODE_SLEEP);
+
__asm__(".set\tmips3\n\t"
"wait\n\t"
".set\tmips0");
- /* Restore to IDLE mode */
- REG_CPM_LCR &= ~CPM_LCR_LPM_MASK;
- REG_CPM_LCR |= CPM_LCR_LPM_IDLE;
-
- /* Restore nand flash control register */
- REG_EMC_NFCSR = nfcsr;
+ jz4740_clock_set_wait_mode(JZ4740_WAIT_MODE_IDLE);
jz4740_intc_resume();
- /* Restore sleep control register */
- REG_CPM_SCR = scr;
-
return 0;
}