aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-11-27 00:16:21 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-11-29 22:02:49 -0500
commit2ebe0ff7e669e7d5fc51c2add74dd71692d7bc8d (patch)
tree188eea4ebaa31cab72a3e36ef4818cb118bf0af7 /arch/sh
parent98779ad8226c6f6e301fa186c07247e78c6f7253 (diff)
sh: Add CPG save/restore code for sh7724 R-standby
Add sh7724 code to save and restore CPG state during R-standby. Only CPG registers IRDACLKCR and SPUCLKCR require software save and restore. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 9c3cc8f638b6..16e18749ac1b 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -941,6 +941,9 @@ static struct {
941 /* RWDT */ 941 /* RWDT */
942 unsigned short rwtcnt; 942 unsigned short rwtcnt;
943 unsigned short rwtcsr; 943 unsigned short rwtcsr;
944 /* CPG */
945 unsigned long irdaclk;
946 unsigned long spuclk;
944} sh7724_rstandby_state; 947} sh7724_rstandby_state;
945 948
946static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb, 949static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb,
@@ -998,6 +1001,10 @@ static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb,
998 sh7724_rstandby_state.rwtcsr |= 0xa500; 1001 sh7724_rstandby_state.rwtcsr |= 0xa500;
999 __raw_writew(sh7724_rstandby_state.rwtcsr & 0x07, 0xa4520004); 1002 __raw_writew(sh7724_rstandby_state.rwtcsr & 0x07, 0xa4520004);
1000 1003
1004 /* CPG */
1005 sh7724_rstandby_state.irdaclk = __raw_readl(0xa4150018); /* IRDACLKCR */
1006 sh7724_rstandby_state.spuclk = __raw_readl(0xa415003c); /* SPUCLKCR */
1007
1001 return NOTIFY_DONE; 1008 return NOTIFY_DONE;
1002} 1009}
1003 1010
@@ -1052,6 +1059,10 @@ static int sh7724_post_sleep_notifier_call(struct notifier_block *nb,
1052 __raw_writew(sh7724_rstandby_state.rwtcnt, 0xa4520000); /* RWTCNT */ 1059 __raw_writew(sh7724_rstandby_state.rwtcnt, 0xa4520000); /* RWTCNT */
1053 __raw_writew(sh7724_rstandby_state.rwtcsr, 0xa4520004); /* RWTCSR */ 1060 __raw_writew(sh7724_rstandby_state.rwtcsr, 0xa4520004); /* RWTCSR */
1054 1061
1062 /* CPG */
1063 __raw_writel(sh7724_rstandby_state.irdaclk, 0xa4150018); /* IRDACLKCR */
1064 __raw_writel(sh7724_rstandby_state.spuclk, 0xa415003c); /* SPUCLKCR */
1065
1055 return NOTIFY_DONE; 1066 return NOTIFY_DONE;
1056} 1067}
1057 1068