diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2010-11-23 17:00:03 +0800 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-16 14:31:20 +0800 |
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 416b3f06efb..66eb531ae29 100644 --- a/arch/arm/mach-pxa/clock-pxa2xx.c +++ b/arch/arm/mach-pxa/clock-pxa2xx.c @@ -9,6 +9,7 @@ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/sysdev.h> #include <mach/pxa2xx-regs.h> @@ -28,3 +29,28 @@ const struct clkops clk_pxa2xx_cken_ops = { .enable = clk_pxa2xx_cken_enable, .disable = clk_pxa2xx_cken_disable, }; + +#ifdef CONFIG_PM +static uint32_t saved_cken; + +static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) +{ + saved_cken = CKEN; + return 0; +} + +static int pxa2xx_clock_resume(struct sys_device *d) +{ + CKEN = saved_cken; + return 0; +} +#else +#define pxa2xx_clock_suspend NULL +#define pxa2xx_clock_resume NULL +#endif + +struct sysdev_class pxa2xx_clock_sysclass = { + .name = "pxa2xx-clock", + .suspend = pxa2xx_clock_suspend, + .resume = pxa2xx_clock_resume, +}; |