diff options
author | Ben Dooks <ben-linux@fluff.org> | 2006-09-19 04:51:32 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-25 05:25:30 -0400 |
commit | 0033a2f0d028400ad04588efbd5740c73f0eb740 (patch) | |
tree | 16ea22f882eac68b61041dc7f3fdc13313fdfa7e /arch/arm/mach-s3c2410/s3c2410-pm.c | |
parent | 34348012d6b43eca5e241fe97381420d5758866c (diff) |
[ARM] 3803/2: S3C24XX: PM split S3C2410 out of core pm
Remove the S3C2410 specific items out of the
core PM code. Add sysdev driver for all the
S3C24XX series that used the S3C2410 PM code.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2410/s3c2410-pm.c')
-rw-r--r-- | arch/arm/mach-s3c2410/s3c2410-pm.c | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/s3c2410-pm.c b/arch/arm/mach-s3c2410/s3c2410-pm.c new file mode 100644 index 000000000000..3080d25a12de --- /dev/null +++ b/arch/arm/mach-s3c2410/s3c2410-pm.c | |||
@@ -0,0 +1,111 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/s3c2410-pm.c | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 (and compatible) Power Manager (Suspend-To-RAM) support | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/init.h> | ||
24 | #include <linux/suspend.h> | ||
25 | #include <linux/errno.h> | ||
26 | #include <linux/time.h> | ||
27 | #include <linux/sysdev.h> | ||
28 | |||
29 | #include <asm/hardware.h> | ||
30 | #include <asm/io.h> | ||
31 | |||
32 | #include <asm/arch/regs-gpio.h> | ||
33 | |||
34 | #include "cpu.h" | ||
35 | #include "pm.h" | ||
36 | |||
37 | #ifdef CONFIG_S3C2410_PM_DEBUG | ||
38 | extern void pm_dbg(const char *fmt, ...); | ||
39 | #define DBG(fmt...) pm_dbg(fmt) | ||
40 | #else | ||
41 | #define DBG(fmt...) printk(KERN_DEBUG fmt) | ||
42 | #endif | ||
43 | |||
44 | static void s3c2410_pm_prepare(void) | ||
45 | { | ||
46 | /* ensure at least GSTATUS3 has the resume address */ | ||
47 | |||
48 | __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2410_GSTATUS3); | ||
49 | |||
50 | DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); | ||
51 | DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); | ||
52 | } | ||
53 | |||
54 | int s3c2410_pm_resume(struct sys_device *dev) | ||
55 | { | ||
56 | unsigned long tmp; | ||
57 | |||
58 | /* unset the return-from-sleep flag, to ensure reset */ | ||
59 | |||
60 | tmp = __raw_readl(S3C2410_GSTATUS2); | ||
61 | tmp &= S3C2410_GSTATUS2_OFFRESET; | ||
62 | __raw_writel(tmp, S3C2410_GSTATUS2); | ||
63 | |||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | static int s3c2410_pm_add(struct sys_device *dev) | ||
68 | { | ||
69 | pm_cpu_prep = s3c2410_pm_prepare; | ||
70 | pm_cpu_sleep = s3c2410_cpu_suspend; | ||
71 | |||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | static struct sysdev_driver s3c2410_pm_driver = { | ||
76 | .add = s3c2410_pm_add, | ||
77 | .resume = s3c2410_pm_resume, | ||
78 | }; | ||
79 | |||
80 | /* register ourselves */ | ||
81 | |||
82 | static int __init s3c2410_pm_drvinit(void) | ||
83 | { | ||
84 | return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_pm_driver); | ||
85 | } | ||
86 | |||
87 | arch_initcall(s3c2410_pm_drvinit); | ||
88 | |||
89 | static struct sysdev_driver s3c2440_pm_driver = { | ||
90 | .add = s3c2410_pm_add, | ||
91 | .resume = s3c2410_pm_resume, | ||
92 | }; | ||
93 | |||
94 | static int __init s3c2440_pm_drvinit(void) | ||
95 | { | ||
96 | return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_pm_driver); | ||
97 | } | ||
98 | |||
99 | arch_initcall(s3c2440_pm_drvinit); | ||
100 | |||
101 | static struct sysdev_driver s3c2442_pm_driver = { | ||
102 | .add = s3c2410_pm_add, | ||
103 | .resume = s3c2410_pm_resume, | ||
104 | }; | ||
105 | |||
106 | static int __init s3c2442_pm_drvinit(void) | ||
107 | { | ||
108 | return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_pm_driver); | ||
109 | } | ||
110 | |||
111 | arch_initcall(s3c2442_pm_drvinit); | ||