diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2010-11-23 04:00:03 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-16 01:31:20 -0500 |
commit | f113fe4e844be15394edcbc32b0ec196cdd0a0ff (patch) | |
tree | dceebef68696118b028354e1b6ec94f45bc8ed94 /arch/arm/mach-pxa/clock-pxa2xx.c | |
parent | 2a125dd56b3a853701063fe8a678ad7603e385fd (diff) |
ARM: pxa: introduce pxa2xx_clock_sysclass for clock suspend/resume
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/clock-pxa2xx.c')
-rw-r--r-- | arch/arm/mach-pxa/clock-pxa2xx.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c index 416b3f06efb7..66eb531ae29b 100644 --- a/arch/arm/mach-pxa/clock-pxa2xx.c +++ b/arch/arm/mach-pxa/clock-pxa2xx.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/sysdev.h> | ||
12 | 13 | ||
13 | #include <mach/pxa2xx-regs.h> | 14 | #include <mach/pxa2xx-regs.h> |
14 | 15 | ||
@@ -28,3 +29,28 @@ const struct clkops clk_pxa2xx_cken_ops = { | |||
28 | .enable = clk_pxa2xx_cken_enable, | 29 | .enable = clk_pxa2xx_cken_enable, |
29 | .disable = clk_pxa2xx_cken_disable, | 30 | .disable = clk_pxa2xx_cken_disable, |
30 | }; | 31 | }; |
32 | |||
33 | #ifdef CONFIG_PM | ||
34 | static uint32_t saved_cken; | ||
35 | |||
36 | static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) | ||
37 | { | ||
38 | saved_cken = CKEN; | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static int pxa2xx_clock_resume(struct sys_device *d) | ||
43 | { | ||
44 | CKEN = saved_cken; | ||
45 | return 0; | ||
46 | } | ||
47 | #else | ||
48 | #define pxa2xx_clock_suspend NULL | ||
49 | #define pxa2xx_clock_resume NULL | ||
50 | #endif | ||
51 | |||
52 | struct sysdev_class pxa2xx_clock_sysclass = { | ||
53 | .name = "pxa2xx-clock", | ||
54 | .suspend = pxa2xx_clock_suspend, | ||
55 | .resume = pxa2xx_clock_resume, | ||
56 | }; | ||