diff options
author | eric miao <eric.miao@marvell.com> | 2008-01-28 18:00:02 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-02-04 08:17:33 -0500 |
commit | c016550490687c6bdbcdf06c7b4d874b6c7c6e4e (patch) | |
tree | d2b31c1d89c72417d050343caa6a6a5161b6d02f /arch/arm/mach-pxa/pxa25x.c | |
parent | cd5604d5618a802e4ed047eb8b1515edc5fc49b5 (diff) |
[ARM] pxa: introduce sysdev for IRQ register saving/restoring
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/pxa25x.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index ddd05bf78e02..797635eec6b6 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/suspend.h> | 23 | #include <linux/suspend.h> |
24 | #include <linux/sysdev.h> | ||
24 | 25 | ||
25 | #include <asm/hardware.h> | 26 | #include <asm/hardware.h> |
26 | #include <asm/arch/irqs.h> | 27 | #include <asm/arch/irqs.h> |
@@ -165,7 +166,6 @@ enum { SLEEP_SAVE_START = 0, | |||
165 | 166 | ||
166 | SLEEP_SAVE_PSTR, | 167 | SLEEP_SAVE_PSTR, |
167 | 168 | ||
168 | SLEEP_SAVE_ICMR, | ||
169 | SLEEP_SAVE_CKEN, | 169 | SLEEP_SAVE_CKEN, |
170 | 170 | ||
171 | SLEEP_SAVE_SIZE | 171 | SLEEP_SAVE_SIZE |
@@ -184,7 +184,6 @@ static void pxa25x_cpu_pm_save(unsigned long *sleep_save) | |||
184 | SAVE(GAFR1_L); SAVE(GAFR1_U); | 184 | SAVE(GAFR1_L); SAVE(GAFR1_U); |
185 | SAVE(GAFR2_L); SAVE(GAFR2_U); | 185 | SAVE(GAFR2_L); SAVE(GAFR2_U); |
186 | 186 | ||
187 | SAVE(ICMR); ICMR = 0; | ||
188 | SAVE(CKEN); | 187 | SAVE(CKEN); |
189 | SAVE(PSTR); | 188 | SAVE(PSTR); |
190 | 189 | ||
@@ -210,10 +209,6 @@ static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) | |||
210 | PSSR = PSSR_RDH | PSSR_PH; | 209 | PSSR = PSSR_RDH | PSSR_PH; |
211 | 210 | ||
212 | RESTORE(CKEN); | 211 | RESTORE(CKEN); |
213 | |||
214 | ICLR = 0; | ||
215 | ICCR = 1; | ||
216 | RESTORE(ICMR); | ||
217 | RESTORE(PSTR); | 212 | RESTORE(PSTR); |
218 | } | 213 | } |
219 | 214 | ||
@@ -304,9 +299,15 @@ static struct platform_device *pxa25x_devices[] __initdata = { | |||
304 | &pxa25x_device_assp, | 299 | &pxa25x_device_assp, |
305 | }; | 300 | }; |
306 | 301 | ||
302 | static struct sys_device pxa25x_sysdev[] = { | ||
303 | { | ||
304 | .cls = &pxa_irq_sysclass, | ||
305 | }, | ||
306 | }; | ||
307 | |||
307 | static int __init pxa25x_init(void) | 308 | static int __init pxa25x_init(void) |
308 | { | 309 | { |
309 | int ret = 0; | 310 | int i, ret = 0; |
310 | 311 | ||
311 | /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ | 312 | /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ |
312 | if (cpu_is_pxa25x()) | 313 | if (cpu_is_pxa25x()) |
@@ -320,9 +321,18 @@ static int __init pxa25x_init(void) | |||
320 | 321 | ||
321 | pxa25x_init_pm(); | 322 | pxa25x_init_pm(); |
322 | 323 | ||
324 | for (i = 0; i < ARRAY_SIZE(pxa25x_sysdev); i++) { | ||
325 | ret = sysdev_register(&pxa25x_sysdev[i]); | ||
326 | if (ret) | ||
327 | pr_err("failed to register sysdev[%d]\n", i); | ||
328 | } | ||
329 | |||
323 | ret = platform_add_devices(pxa25x_devices, | 330 | ret = platform_add_devices(pxa25x_devices, |
324 | ARRAY_SIZE(pxa25x_devices)); | 331 | ARRAY_SIZE(pxa25x_devices)); |
332 | if (ret) | ||
333 | return ret; | ||
325 | } | 334 | } |
335 | |||
326 | /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ | 336 | /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ |
327 | if (cpu_is_pxa25x()) | 337 | if (cpu_is_pxa25x()) |
328 | ret = platform_device_register(&pxa_device_hwuart); | 338 | ret = platform_device_register(&pxa_device_hwuart); |