diff options
author | Magnus Damm <damm@opensource.se> | 2009-11-27 05:16:21 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-11-30 12:02:49 +0900 |
commit | 2ebe0ff7e669e7d5fc51c2add74dd71692d7bc8d (patch) | |
tree | 188eea4ebaa31cab72a3e36ef4818cb118bf0af7 /arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |
parent | 98779ad8226c6f6e301fa186c07247e78c6f7253 (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/kernel/cpu/sh4a/setup-sh7724.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 11 |
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 9c3cc8f638b..16e18749ac1 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 { /* RWDT */ unsigned short rwtcnt; unsigned short rwtcsr; + /* CPG */ + unsigned long irdaclk; + unsigned long spuclk; } sh7724_rstandby_state; static 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, sh7724_rstandby_state.rwtcsr |= 0xa500; __raw_writew(sh7724_rstandby_state.rwtcsr & 0x07, 0xa4520004); + /* CPG */ + sh7724_rstandby_state.irdaclk = __raw_readl(0xa4150018); /* IRDACLKCR */ + sh7724_rstandby_state.spuclk = __raw_readl(0xa415003c); /* SPUCLKCR */ + return NOTIFY_DONE; } @@ -1052,6 +1059,10 @@ static int sh7724_post_sleep_notifier_call(struct notifier_block *nb, __raw_writew(sh7724_rstandby_state.rwtcnt, 0xa4520000); /* RWTCNT */ __raw_writew(sh7724_rstandby_state.rwtcsr, 0xa4520004); /* RWTCSR */ + /* CPG */ + __raw_writel(sh7724_rstandby_state.irdaclk, 0xa4150018); /* IRDACLKCR */ + __raw_writel(sh7724_rstandby_state.spuclk, 0xa415003c); /* SPUCLKCR */ + return NOTIFY_DONE; } |