summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/clock-pxa3xx.c
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2010-11-23 17:07:48 +0800
committerEric Miao <eric.y.miao@gmail.com>2010-12-18 21:02:03 +0800
commitaae8224ddd72e045bb92eaf6b73b89282c771c69 (patch)
treee0176e31c5185d8f180f607a252da9061ff0a63b /arch/arm/mach-pxa/clock-pxa3xx.c
parentf113fe4e844be15394edcbc32b0ec196cdd0a0ff (diff)
downloadop-kernel-dev-aae8224ddd72e045bb92eaf6b73b89282c771c69.zip
op-kernel-dev-aae8224ddd72e045bb92eaf6b73b89282c771c69.tar.gz
ARM: pxa: introduce pxa3xx_clock_sysclass for clock suspend/resume
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/clock-pxa3xx.c')
-rw-r--r--arch/arm/mach-pxa/clock-pxa3xx.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
index 34a36c4..dd122d98 100644
--- a/arch/arm/mach-pxa/clock-pxa3xx.c
+++ b/arch/arm/mach-pxa/clock-pxa3xx.c
@@ -159,3 +159,41 @@ const struct clkops clk_pxa3xx_pout_ops = {
.enable = clk_pout_enable,
.disable = clk_pout_disable,
};
+
+#ifdef CONFIG_PM
+static uint32_t cken[2];
+static uint32_t accr;
+
+static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state)
+{
+ cken[0] = CKENA;
+ cken[1] = CKENB;
+ accr = ACCR;
+ return 0;
+}
+
+static int pxa3xx_clock_resume(struct sys_device *d)
+{
+ ACCR = accr;
+ CKENA = cken[0];
+ CKENB = cken[1];
+ return 0;
+}
+#else
+#define pxa3xx_clock_suspend NULL
+#define pxa3xx_clock_resume NULL
+#endif
+
+struct sysdev_class pxa3xx_clock_sysclass = {
+ .name = "pxa3xx-clock",
+ .suspend = pxa3xx_clock_suspend,
+ .resume = pxa3xx_clock_resume,
+};
+
+static int __init pxa3xx_clock_init(void)
+{
+ if (cpu_is_pxa3xx())
+ return sysdev_class_register(&pxa3xx_clock_sysclass);
+ return 0;
+}
+postcore_initcall(pxa3xx_clock_init);
OpenPOWER on IntegriCloud