From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: Add CPG save/restore code for sh7724 R-standby
Date: Fri, 27 Nov 2009 05:16:21 +0000 [thread overview]
Message-ID: <20091127051621.24738.14619.sendpatchset@rxone.opensource.se> (raw)
From: Magnus Damm <damm@opensource.se>
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>
---
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ work/arch/sh/kernel/cpu/sh4a/setup-sh7724.c 2009-11-27 14:07:07.000000000 +0900
@@ -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_cal
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_ca
__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;
}
next prev reply other threads:[~2009-11-27 5:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 9:28 [PATCH] sh: Improve kfr2r09 serial port setup code Magnus Damm
2009-11-27 7:38 ` [PATCH] sh: Break out SuperH PFC code Magnus Damm
2009-11-27 7:32 ` [PATCH] sh: Move KEYSC header file Magnus Damm
2009-11-27 7:32 ` Magnus Damm
2009-11-27 5:16 ` Magnus Damm [this message]
2009-11-27 4:36 ` [PATCH] sh: Add SDHI power control support to Ecovec Magnus Damm
2009-11-27 4:31 ` [PATCH] mfd: Add power control platform data to SDHI driver Magnus Damm
2009-11-27 19:47 ` Samuel Ortiz
2009-11-28 13:10 ` Magnus Damm
2009-11-29 23:56 ` Samuel Ortiz
2009-11-30 3:05 ` Paul Mundt
2009-11-30 3:05 ` Paul Mundt
2009-11-28 1:43 ` [PATCH] sh: Move KEYSC header file Dmitry Torokhov
2009-11-28 1:43 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091127051621.24738.14619.sendpatchset@rxone.opensource.se \
--to=magnus.damm@gmail.com \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.