diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2010-11-23 04:07:48 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-18 08:02:03 -0500 |
commit | aae8224ddd72e045bb92eaf6b73b89282c771c69 (patch) | |
tree | e0176e31c5185d8f180f607a252da9061ff0a63b /arch/arm/mach-pxa/clock-pxa3xx.c | |
parent | f113fe4e844be15394edcbc32b0ec196cdd0a0ff (diff) |
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.c | 38 |
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 34a36c4af19b..dd122d981752 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 = { | |||
159 | .enable = clk_pout_enable, | 159 | .enable = clk_pout_enable, |
160 | .disable = clk_pout_disable, | 160 | .disable = clk_pout_disable, |
161 | }; | 161 | }; |
162 | |||
163 | #ifdef CONFIG_PM | ||
164 | static uint32_t cken[2]; | ||
165 | static uint32_t accr; | ||
166 | |||
167 | static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) | ||
168 | { | ||
169 | cken[0] = CKENA; | ||
170 | cken[1] = CKENB; | ||
171 | accr = ACCR; | ||
172 | return 0; | ||
173 | } | ||
174 | |||
175 | static int pxa3xx_clock_resume(struct sys_device *d) | ||
176 | { | ||
177 | ACCR = accr; | ||
178 | CKENA = cken[0]; | ||
179 | CKENB = cken[1]; | ||
180 | return 0; | ||
181 | } | ||
182 | #else | ||
183 | #define pxa3xx_clock_suspend NULL | ||
184 | #define pxa3xx_clock_resume NULL | ||
185 | #endif | ||
186 | |||
187 | struct sysdev_class pxa3xx_clock_sysclass = { | ||
188 | .name = "pxa3xx-clock", | ||
189 | .suspend = pxa3xx_clock_suspend, | ||
190 | .resume = pxa3xx_clock_resume, | ||
191 | }; | ||
192 | |||
193 | static int __init pxa3xx_clock_init(void) | ||
194 | { | ||
195 | if (cpu_is_pxa3xx()) | ||
196 | return sysdev_class_register(&pxa3xx_clock_sysclass); | ||
197 | return 0; | ||
198 | } | ||
199 | postcore_initcall(pxa3xx_clock_init); | ||