diff options
Diffstat (limited to 'arch')
74 files changed, 488 insertions, 846 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index 113085a77123..7aa4262ada7a 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
@@ -22,17 +22,16 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/syscore_ops.h> |
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
27 | #include <linux/amba/bus.h> | 27 | #include <linux/amba/bus.h> |
28 | 28 | ||
29 | #include <asm/mach/irq.h> | 29 | #include <asm/mach/irq.h> |
30 | #include <asm/hardware/vic.h> | 30 | #include <asm/hardware/vic.h> |
31 | 31 | ||
32 | #if defined(CONFIG_PM) | 32 | #ifdef CONFIG_PM |
33 | /** | 33 | /** |
34 | * struct vic_device - VIC PM device | 34 | * struct vic_device - VIC PM device |
35 | * @sysdev: The system device which is registered. | ||
36 | * @irq: The IRQ number for the base of the VIC. | 35 | * @irq: The IRQ number for the base of the VIC. |
37 | * @base: The register base for the VIC. | 36 | * @base: The register base for the VIC. |
38 | * @resume_sources: A bitmask of interrupts for resume. | 37 | * @resume_sources: A bitmask of interrupts for resume. |
@@ -43,8 +42,6 @@ | |||
43 | * @protect: Save for VIC_PROTECT. | 42 | * @protect: Save for VIC_PROTECT. |
44 | */ | 43 | */ |
45 | struct vic_device { | 44 | struct vic_device { |
46 | struct sys_device sysdev; | ||
47 | |||
48 | void __iomem *base; | 45 | void __iomem *base; |
49 | int irq; | 46 | int irq; |
50 | u32 resume_sources; | 47 | u32 resume_sources; |
@@ -59,11 +56,6 @@ struct vic_device { | |||
59 | static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; | 56 | static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; |
60 | 57 | ||
61 | static int vic_id; | 58 | static int vic_id; |
62 | |||
63 | static inline struct vic_device *to_vic(struct sys_device *sys) | ||
64 | { | ||
65 | return container_of(sys, struct vic_device, sysdev); | ||
66 | } | ||
67 | #endif /* CONFIG_PM */ | 59 | #endif /* CONFIG_PM */ |
68 | 60 | ||
69 | /** | 61 | /** |
@@ -85,10 +77,9 @@ static void vic_init2(void __iomem *base) | |||
85 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | 77 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); |
86 | } | 78 | } |
87 | 79 | ||
88 | #if defined(CONFIG_PM) | 80 | #ifdef CONFIG_PM |
89 | static int vic_class_resume(struct sys_device *dev) | 81 | static void resume_one_vic(struct vic_device *vic) |
90 | { | 82 | { |
91 | struct vic_device *vic = to_vic(dev); | ||
92 | void __iomem *base = vic->base; | 83 | void __iomem *base = vic->base; |
93 | 84 | ||
94 | printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base); | 85 | printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base); |
@@ -107,13 +98,18 @@ static int vic_class_resume(struct sys_device *dev) | |||
107 | 98 | ||
108 | writel(vic->soft_int, base + VIC_INT_SOFT); | 99 | writel(vic->soft_int, base + VIC_INT_SOFT); |
109 | writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR); | 100 | writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR); |
101 | } | ||
110 | 102 | ||
111 | return 0; | 103 | static void vic_resume(void) |
104 | { | ||
105 | int id; | ||
106 | |||
107 | for (id = vic_id - 1; id >= 0; id--) | ||
108 | resume_one_vic(vic_devices + id); | ||
112 | } | 109 | } |
113 | 110 | ||
114 | static int vic_class_suspend(struct sys_device *dev, pm_message_t state) | 111 | static void suspend_one_vic(struct vic_device *vic) |
115 | { | 112 | { |
116 | struct vic_device *vic = to_vic(dev); | ||
117 | void __iomem *base = vic->base; | 113 | void __iomem *base = vic->base; |
118 | 114 | ||
119 | printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base); | 115 | printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base); |
@@ -128,14 +124,21 @@ static int vic_class_suspend(struct sys_device *dev, pm_message_t state) | |||
128 | 124 | ||
129 | writel(vic->resume_irqs, base + VIC_INT_ENABLE); | 125 | writel(vic->resume_irqs, base + VIC_INT_ENABLE); |
130 | writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR); | 126 | writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR); |
127 | } | ||
128 | |||
129 | static int vic_suspend(void) | ||
130 | { | ||
131 | int id; | ||
132 | |||
133 | for (id = 0; id < vic_id; id++) | ||
134 | suspend_one_vic(vic_devices + id); | ||
131 | 135 | ||
132 | return 0; | 136 | return 0; |
133 | } | 137 | } |
134 | 138 | ||
135 | struct sysdev_class vic_class = { | 139 | struct syscore_ops vic_syscore_ops = { |
136 | .name = "vic", | 140 | .suspend = vic_suspend, |
137 | .suspend = vic_class_suspend, | 141 | .resume = vic_resume, |
138 | .resume = vic_class_resume, | ||
139 | }; | 142 | }; |
140 | 143 | ||
141 | /** | 144 | /** |
@@ -147,30 +150,8 @@ struct sysdev_class vic_class = { | |||
147 | */ | 150 | */ |
148 | static int __init vic_pm_init(void) | 151 | static int __init vic_pm_init(void) |
149 | { | 152 | { |
150 | struct vic_device *dev = vic_devices; | 153 | if (vic_id > 0) |
151 | int err; | 154 | register_syscore_ops(&vic_syscore_ops); |
152 | int id; | ||
153 | |||
154 | if (vic_id == 0) | ||
155 | return 0; | ||
156 | |||
157 | err = sysdev_class_register(&vic_class); | ||
158 | if (err) { | ||
159 | printk(KERN_ERR "%s: cannot register class\n", __func__); | ||
160 | return err; | ||
161 | } | ||
162 | |||
163 | for (id = 0; id < vic_id; id++, dev++) { | ||
164 | dev->sysdev.id = id; | ||
165 | dev->sysdev.cls = &vic_class; | ||
166 | |||
167 | err = sysdev_register(&dev->sysdev); | ||
168 | if (err) { | ||
169 | printk(KERN_ERR "%s: failed to register device\n", | ||
170 | __func__); | ||
171 | return err; | ||
172 | } | ||
173 | } | ||
174 | 155 | ||
175 | return 0; | 156 | return 0; |
176 | } | 157 | } |
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 883f6be5117a..d5adaae5ee2c 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h | |||
@@ -34,7 +34,6 @@ | |||
34 | * timer interrupt which may be pending. | 34 | * timer interrupt which may be pending. |
35 | */ | 35 | */ |
36 | struct sys_timer { | 36 | struct sys_timer { |
37 | struct sys_device dev; | ||
38 | void (*init)(void); | 37 | void (*init)(void); |
39 | void (*suspend)(void); | 38 | void (*suspend)(void); |
40 | void (*resume)(void); | 39 | void (*resume)(void); |
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c index 31a316c1777b..0f107dcb0347 100644 --- a/arch/arm/kernel/leds.c +++ b/arch/arm/kernel/leds.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/sysdev.h> | 12 | #include <linux/sysdev.h> |
13 | #include <linux/syscore_ops.h> | ||
13 | 14 | ||
14 | #include <asm/leds.h> | 15 | #include <asm/leds.h> |
15 | 16 | ||
@@ -69,36 +70,37 @@ static ssize_t leds_store(struct sys_device *dev, | |||
69 | 70 | ||
70 | static SYSDEV_ATTR(event, 0200, NULL, leds_store); | 71 | static SYSDEV_ATTR(event, 0200, NULL, leds_store); |
71 | 72 | ||
72 | static int leds_suspend(struct sys_device *dev, pm_message_t state) | 73 | static struct sysdev_class leds_sysclass = { |
74 | .name = "leds", | ||
75 | }; | ||
76 | |||
77 | static struct sys_device leds_device = { | ||
78 | .id = 0, | ||
79 | .cls = &leds_sysclass, | ||
80 | }; | ||
81 | |||
82 | static int leds_suspend(void) | ||
73 | { | 83 | { |
74 | leds_event(led_stop); | 84 | leds_event(led_stop); |
75 | return 0; | 85 | return 0; |
76 | } | 86 | } |
77 | 87 | ||
78 | static int leds_resume(struct sys_device *dev) | 88 | static void leds_resume(void) |
79 | { | 89 | { |
80 | leds_event(led_start); | 90 | leds_event(led_start); |
81 | return 0; | ||
82 | } | 91 | } |
83 | 92 | ||
84 | static int leds_shutdown(struct sys_device *dev) | 93 | static void leds_shutdown(void) |
85 | { | 94 | { |
86 | leds_event(led_halted); | 95 | leds_event(led_halted); |
87 | return 0; | ||
88 | } | 96 | } |
89 | 97 | ||
90 | static struct sysdev_class leds_sysclass = { | 98 | static struct syscore_ops leds_syscore_ops = { |
91 | .name = "leds", | ||
92 | .shutdown = leds_shutdown, | 99 | .shutdown = leds_shutdown, |
93 | .suspend = leds_suspend, | 100 | .suspend = leds_suspend, |
94 | .resume = leds_resume, | 101 | .resume = leds_resume, |
95 | }; | 102 | }; |
96 | 103 | ||
97 | static struct sys_device leds_device = { | ||
98 | .id = 0, | ||
99 | .cls = &leds_sysclass, | ||
100 | }; | ||
101 | |||
102 | static int __init leds_init(void) | 104 | static int __init leds_init(void) |
103 | { | 105 | { |
104 | int ret; | 106 | int ret; |
@@ -107,6 +109,8 @@ static int __init leds_init(void) | |||
107 | ret = sysdev_register(&leds_device); | 109 | ret = sysdev_register(&leds_device); |
108 | if (ret == 0) | 110 | if (ret == 0) |
109 | ret = sysdev_create_file(&leds_device, &attr_event); | 111 | ret = sysdev_create_file(&leds_device, &attr_event); |
112 | if (ret == 0) | ||
113 | register_syscore_ops(&leds_syscore_ops); | ||
110 | return ret; | 114 | return ret; |
111 | } | 115 | } |
112 | 116 | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 1ff46cabc7ef..cb634c3e28e9 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/timex.h> | 21 | #include <linux/timex.h> |
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/profile.h> | 23 | #include <linux/profile.h> |
24 | #include <linux/sysdev.h> | 24 | #include <linux/syscore_ops.h> |
25 | #include <linux/timer.h> | 25 | #include <linux/timer.h> |
26 | #include <linux/irq.h> | 26 | #include <linux/irq.h> |
27 | 27 | ||
@@ -115,48 +115,37 @@ void timer_tick(void) | |||
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | #if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) | 117 | #if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) |
118 | static int timer_suspend(struct sys_device *dev, pm_message_t state) | 118 | static int timer_suspend(void) |
119 | { | 119 | { |
120 | struct sys_timer *timer = container_of(dev, struct sys_timer, dev); | 120 | if (system_timer->suspend) |
121 | 121 | system_timer->suspend(); | |
122 | if (timer->suspend != NULL) | ||
123 | timer->suspend(); | ||
124 | 122 | ||
125 | return 0; | 123 | return 0; |
126 | } | 124 | } |
127 | 125 | ||
128 | static int timer_resume(struct sys_device *dev) | 126 | static void timer_resume(void) |
129 | { | 127 | { |
130 | struct sys_timer *timer = container_of(dev, struct sys_timer, dev); | 128 | if (system_timer->resume) |
131 | 129 | system_timer->resume(); | |
132 | if (timer->resume != NULL) | ||
133 | timer->resume(); | ||
134 | |||
135 | return 0; | ||
136 | } | 130 | } |
137 | #else | 131 | #else |
138 | #define timer_suspend NULL | 132 | #define timer_suspend NULL |
139 | #define timer_resume NULL | 133 | #define timer_resume NULL |
140 | #endif | 134 | #endif |
141 | 135 | ||
142 | static struct sysdev_class timer_sysclass = { | 136 | static struct syscore_ops timer_syscore_ops = { |
143 | .name = "timer", | ||
144 | .suspend = timer_suspend, | 137 | .suspend = timer_suspend, |
145 | .resume = timer_resume, | 138 | .resume = timer_resume, |
146 | }; | 139 | }; |
147 | 140 | ||
148 | static int __init timer_init_sysfs(void) | 141 | static int __init timer_init_syscore_ops(void) |
149 | { | 142 | { |
150 | int ret = sysdev_class_register(&timer_sysclass); | 143 | register_syscore_ops(&timer_syscore_ops); |
151 | if (ret == 0) { | ||
152 | system_timer->dev.cls = &timer_sysclass; | ||
153 | ret = sysdev_register(&system_timer->dev); | ||
154 | } | ||
155 | 144 | ||
156 | return ret; | 145 | return 0; |
157 | } | 146 | } |
158 | 147 | ||
159 | device_initcall(timer_init_sysfs); | 148 | device_initcall(timer_init_syscore_ops); |
160 | 149 | ||
161 | void __init time_init(void) | 150 | void __init time_init(void) |
162 | { | 151 | { |
diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c index 10d917d9e3ad..8755ca8dd48d 100644 --- a/arch/arm/mach-exynos4/pm.c +++ b/arch/arm/mach-exynos4/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/suspend.h> | 18 | #include <linux/suspend.h> |
19 | #include <linux/syscore_ops.h> | ||
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
20 | 21 | ||
21 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
@@ -372,7 +373,27 @@ void exynos4_scu_enable(void __iomem *scu_base) | |||
372 | flush_cache_all(); | 373 | flush_cache_all(); |
373 | } | 374 | } |
374 | 375 | ||
375 | static int exynos4_pm_resume(struct sys_device *dev) | 376 | static struct sysdev_driver exynos4_pm_driver = { |
377 | .add = exynos4_pm_add, | ||
378 | }; | ||
379 | |||
380 | static __init int exynos4_pm_drvinit(void) | ||
381 | { | ||
382 | unsigned int tmp; | ||
383 | |||
384 | s3c_pm_init(); | ||
385 | |||
386 | /* All wakeup disable */ | ||
387 | |||
388 | tmp = __raw_readl(S5P_WAKEUP_MASK); | ||
389 | tmp |= ((0xFF << 8) | (0x1F << 1)); | ||
390 | __raw_writel(tmp, S5P_WAKEUP_MASK); | ||
391 | |||
392 | return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver); | ||
393 | } | ||
394 | arch_initcall(exynos4_pm_drvinit); | ||
395 | |||
396 | static void exynos4_pm_resume(void) | ||
376 | { | 397 | { |
377 | /* For release retention */ | 398 | /* For release retention */ |
378 | 399 | ||
@@ -394,27 +415,15 @@ static int exynos4_pm_resume(struct sys_device *dev) | |||
394 | /* enable L2X0*/ | 415 | /* enable L2X0*/ |
395 | writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL); | 416 | writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL); |
396 | #endif | 417 | #endif |
397 | |||
398 | return 0; | ||
399 | } | 418 | } |
400 | 419 | ||
401 | static struct sysdev_driver exynos4_pm_driver = { | 420 | static struct syscore_ops exynos4_pm_syscore_ops = { |
402 | .add = exynos4_pm_add, | ||
403 | .resume = exynos4_pm_resume, | 421 | .resume = exynos4_pm_resume, |
404 | }; | 422 | }; |
405 | 423 | ||
406 | static __init int exynos4_pm_drvinit(void) | 424 | static __init int exynos4_pm_syscore_init(void) |
407 | { | 425 | { |
408 | unsigned int tmp; | 426 | register_syscore_ops(&exynos4_pm_syscore_ops); |
409 | 427 | return 0; | |
410 | s3c_pm_init(); | ||
411 | |||
412 | /* All wakeup disable */ | ||
413 | |||
414 | tmp = __raw_readl(S5P_WAKEUP_MASK); | ||
415 | tmp |= ((0xFF << 8) | (0x1F << 1)); | ||
416 | __raw_writel(tmp, S5P_WAKEUP_MASK); | ||
417 | |||
418 | return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver); | ||
419 | } | 428 | } |
420 | arch_initcall(exynos4_pm_drvinit); | 429 | arch_initcall(exynos4_pm_syscore_init); |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 980803ff348c..d3e96451529c 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/string.h> | 26 | #include <linux/string.h> |
27 | #include <linux/sysdev.h> | 27 | #include <linux/syscore_ops.h> |
28 | #include <linux/amba/bus.h> | 28 | #include <linux/amba/bus.h> |
29 | #include <linux/amba/kmi.h> | 29 | #include <linux/amba/kmi.h> |
30 | #include <linux/clocksource.h> | 30 | #include <linux/clocksource.h> |
@@ -180,13 +180,13 @@ static void __init ap_init_irq(void) | |||
180 | #ifdef CONFIG_PM | 180 | #ifdef CONFIG_PM |
181 | static unsigned long ic_irq_enable; | 181 | static unsigned long ic_irq_enable; |
182 | 182 | ||
183 | static int irq_suspend(struct sys_device *dev, pm_message_t state) | 183 | static int irq_suspend(void) |
184 | { | 184 | { |
185 | ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE); | 185 | ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE); |
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | 188 | ||
189 | static int irq_resume(struct sys_device *dev) | 189 | static void irq_resume(void) |
190 | { | 190 | { |
191 | /* disable all irq sources */ | 191 | /* disable all irq sources */ |
192 | writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); | 192 | writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); |
@@ -194,33 +194,25 @@ static int irq_resume(struct sys_device *dev) | |||
194 | writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); | 194 | writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); |
195 | 195 | ||
196 | writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET); | 196 | writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET); |
197 | return 0; | ||
198 | } | 197 | } |
199 | #else | 198 | #else |
200 | #define irq_suspend NULL | 199 | #define irq_suspend NULL |
201 | #define irq_resume NULL | 200 | #define irq_resume NULL |
202 | #endif | 201 | #endif |
203 | 202 | ||
204 | static struct sysdev_class irq_class = { | 203 | static struct syscore_ops irq_syscore_ops = { |
205 | .name = "irq", | ||
206 | .suspend = irq_suspend, | 204 | .suspend = irq_suspend, |
207 | .resume = irq_resume, | 205 | .resume = irq_resume, |
208 | }; | 206 | }; |
209 | 207 | ||
210 | static struct sys_device irq_device = { | 208 | static int __init irq_syscore_init(void) |
211 | .id = 0, | ||
212 | .cls = &irq_class, | ||
213 | }; | ||
214 | |||
215 | static int __init irq_init_sysfs(void) | ||
216 | { | 209 | { |
217 | int ret = sysdev_class_register(&irq_class); | 210 | register_syscore_ops(&irq_syscore_ops); |
218 | if (ret == 0) | 211 | |
219 | ret = sysdev_register(&irq_device); | 212 | return 0; |
220 | return ret; | ||
221 | } | 213 | } |
222 | 214 | ||
223 | device_initcall(irq_init_sysfs); | 215 | device_initcall(irq_syscore_init); |
224 | 216 | ||
225 | /* | 217 | /* |
226 | * Flash handling. | 218 | * Flash handling. |
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index bfbecec6d05f..810a982a66f8 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/sysdev.h> | ||
19 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
20 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
21 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c index 1ce090448493..1d5859d9a0e3 100644 --- a/arch/arm/mach-pxa/clock-pxa2xx.c +++ b/arch/arm/mach-pxa/clock-pxa2xx.c | |||
@@ -9,7 +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 | #include <linux/syscore_ops.h> |
13 | 13 | ||
14 | #include <mach/pxa2xx-regs.h> | 14 | #include <mach/pxa2xx-regs.h> |
15 | 15 | ||
@@ -33,32 +33,22 @@ const struct clkops clk_pxa2xx_cken_ops = { | |||
33 | #ifdef CONFIG_PM | 33 | #ifdef CONFIG_PM |
34 | static uint32_t saved_cken; | 34 | static uint32_t saved_cken; |
35 | 35 | ||
36 | static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) | 36 | static int pxa2xx_clock_suspend(void) |
37 | { | 37 | { |
38 | saved_cken = CKEN; | 38 | saved_cken = CKEN; |
39 | return 0; | 39 | return 0; |
40 | } | 40 | } |
41 | 41 | ||
42 | static int pxa2xx_clock_resume(struct sys_device *d) | 42 | static void pxa2xx_clock_resume(void) |
43 | { | 43 | { |
44 | CKEN = saved_cken; | 44 | CKEN = saved_cken; |
45 | return 0; | ||
46 | } | 45 | } |
47 | #else | 46 | #else |
48 | #define pxa2xx_clock_suspend NULL | 47 | #define pxa2xx_clock_suspend NULL |
49 | #define pxa2xx_clock_resume NULL | 48 | #define pxa2xx_clock_resume NULL |
50 | #endif | 49 | #endif |
51 | 50 | ||
52 | struct sysdev_class pxa2xx_clock_sysclass = { | 51 | struct syscore_ops pxa2xx_clock_syscore_ops = { |
53 | .name = "pxa2xx-clock", | ||
54 | .suspend = pxa2xx_clock_suspend, | 52 | .suspend = pxa2xx_clock_suspend, |
55 | .resume = pxa2xx_clock_resume, | 53 | .resume = pxa2xx_clock_resume, |
56 | }; | 54 | }; |
57 | |||
58 | static int __init pxa2xx_clock_init(void) | ||
59 | { | ||
60 | if (cpu_is_pxa2xx()) | ||
61 | return sysdev_class_register(&pxa2xx_clock_sysclass); | ||
62 | return 0; | ||
63 | } | ||
64 | postcore_initcall(pxa2xx_clock_init); | ||
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c index 3f864cd0bd28..2a37a9a8f621 100644 --- a/arch/arm/mach-pxa/clock-pxa3xx.c +++ b/arch/arm/mach-pxa/clock-pxa3xx.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/io.h> | 12 | #include <linux/io.h> |
13 | #include <linux/syscore_ops.h> | ||
13 | 14 | ||
14 | #include <mach/smemc.h> | 15 | #include <mach/smemc.h> |
15 | #include <mach/pxa3xx-regs.h> | 16 | #include <mach/pxa3xx-regs.h> |
@@ -182,7 +183,7 @@ const struct clkops clk_pxa3xx_pout_ops = { | |||
182 | static uint32_t cken[2]; | 183 | static uint32_t cken[2]; |
183 | static uint32_t accr; | 184 | static uint32_t accr; |
184 | 185 | ||
185 | static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) | 186 | static int pxa3xx_clock_suspend(void) |
186 | { | 187 | { |
187 | cken[0] = CKENA; | 188 | cken[0] = CKENA; |
188 | cken[1] = CKENB; | 189 | cken[1] = CKENB; |
@@ -190,28 +191,18 @@ static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) | |||
190 | return 0; | 191 | return 0; |
191 | } | 192 | } |
192 | 193 | ||
193 | static int pxa3xx_clock_resume(struct sys_device *d) | 194 | static void pxa3xx_clock_resume(void) |
194 | { | 195 | { |
195 | ACCR = accr; | 196 | ACCR = accr; |
196 | CKENA = cken[0]; | 197 | CKENA = cken[0]; |
197 | CKENB = cken[1]; | 198 | CKENB = cken[1]; |
198 | return 0; | ||
199 | } | 199 | } |
200 | #else | 200 | #else |
201 | #define pxa3xx_clock_suspend NULL | 201 | #define pxa3xx_clock_suspend NULL |
202 | #define pxa3xx_clock_resume NULL | 202 | #define pxa3xx_clock_resume NULL |
203 | #endif | 203 | #endif |
204 | 204 | ||
205 | struct sysdev_class pxa3xx_clock_sysclass = { | 205 | struct syscore_ops pxa3xx_clock_syscore_ops = { |
206 | .name = "pxa3xx-clock", | ||
207 | .suspend = pxa3xx_clock_suspend, | 206 | .suspend = pxa3xx_clock_suspend, |
208 | .resume = pxa3xx_clock_resume, | 207 | .resume = pxa3xx_clock_resume, |
209 | }; | 208 | }; |
210 | |||
211 | static int __init pxa3xx_clock_init(void) | ||
212 | { | ||
213 | if (cpu_is_pxa3xx() || cpu_is_pxa95x()) | ||
214 | return sysdev_class_register(&pxa3xx_clock_sysclass); | ||
215 | return 0; | ||
216 | } | ||
217 | postcore_initcall(pxa3xx_clock_init); | ||
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index f9f349a21b54..1f2fb9c43f06 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #include <linux/clkdev.h> | 1 | #include <linux/clkdev.h> |
2 | #include <linux/sysdev.h> | 2 | #include <linux/syscore_ops.h> |
3 | 3 | ||
4 | struct clkops { | 4 | struct clkops { |
5 | void (*enable)(struct clk *); | 5 | void (*enable)(struct clk *); |
@@ -54,7 +54,7 @@ extern const struct clkops clk_pxa2xx_cken_ops; | |||
54 | void clk_pxa2xx_cken_enable(struct clk *clk); | 54 | void clk_pxa2xx_cken_enable(struct clk *clk); |
55 | void clk_pxa2xx_cken_disable(struct clk *clk); | 55 | void clk_pxa2xx_cken_disable(struct clk *clk); |
56 | 56 | ||
57 | extern struct sysdev_class pxa2xx_clock_sysclass; | 57 | extern struct syscore_ops pxa2xx_clock_syscore_ops; |
58 | 58 | ||
59 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | 59 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) |
60 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ | 60 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ |
@@ -74,5 +74,6 @@ extern const struct clkops clk_pxa3xx_smemc_ops; | |||
74 | extern void clk_pxa3xx_cken_enable(struct clk *); | 74 | extern void clk_pxa3xx_cken_enable(struct clk *); |
75 | extern void clk_pxa3xx_cken_disable(struct clk *); | 75 | extern void clk_pxa3xx_cken_disable(struct clk *); |
76 | 76 | ||
77 | extern struct sysdev_class pxa3xx_clock_sysclass; | 77 | extern struct syscore_ops pxa3xx_clock_syscore_ops; |
78 | |||
78 | #endif | 79 | #endif |
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c index b88d601a8090..13518a705399 100644 --- a/arch/arm/mach-pxa/cm-x270.c +++ b/arch/arm/mach-pxa/cm-x270.c | |||
@@ -10,7 +10,6 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/sysdev.h> | ||
14 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
15 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
16 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index 8225e2e58c6e..a10996782476 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/sysdev.h> | 13 | #include <linux/syscore_ops.h> |
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | 16 | ||
@@ -388,7 +388,7 @@ static inline void cmx2xx_init_display(void) {} | |||
388 | #ifdef CONFIG_PM | 388 | #ifdef CONFIG_PM |
389 | static unsigned long sleep_save_msc[10]; | 389 | static unsigned long sleep_save_msc[10]; |
390 | 390 | ||
391 | static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state) | 391 | static int cmx2xx_suspend(void) |
392 | { | 392 | { |
393 | cmx2xx_pci_suspend(); | 393 | cmx2xx_pci_suspend(); |
394 | 394 | ||
@@ -412,7 +412,7 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state) | |||
412 | return 0; | 412 | return 0; |
413 | } | 413 | } |
414 | 414 | ||
415 | static int cmx2xx_resume(struct sys_device *dev) | 415 | static void cmx2xx_resume(void) |
416 | { | 416 | { |
417 | cmx2xx_pci_resume(); | 417 | cmx2xx_pci_resume(); |
418 | 418 | ||
@@ -420,27 +420,18 @@ static int cmx2xx_resume(struct sys_device *dev) | |||
420 | __raw_writel(sleep_save_msc[0], MSC0); | 420 | __raw_writel(sleep_save_msc[0], MSC0); |
421 | __raw_writel(sleep_save_msc[1], MSC1); | 421 | __raw_writel(sleep_save_msc[1], MSC1); |
422 | __raw_writel(sleep_save_msc[2], MSC2); | 422 | __raw_writel(sleep_save_msc[2], MSC2); |
423 | |||
424 | return 0; | ||
425 | } | 423 | } |
426 | 424 | ||
427 | static struct sysdev_class cmx2xx_pm_sysclass = { | 425 | static struct syscore_ops cmx2xx_pm_syscore_ops = { |
428 | .name = "pm", | ||
429 | .resume = cmx2xx_resume, | 426 | .resume = cmx2xx_resume, |
430 | .suspend = cmx2xx_suspend, | 427 | .suspend = cmx2xx_suspend, |
431 | }; | 428 | }; |
432 | 429 | ||
433 | static struct sys_device cmx2xx_pm_device = { | ||
434 | .cls = &cmx2xx_pm_sysclass, | ||
435 | }; | ||
436 | |||
437 | static int __init cmx2xx_pm_init(void) | 430 | static int __init cmx2xx_pm_init(void) |
438 | { | 431 | { |
439 | int error; | 432 | register_syscore_ops(&cmx2xx_pm_syscore_ops); |
440 | error = sysdev_class_register(&cmx2xx_pm_sysclass); | 433 | |
441 | if (error == 0) | 434 | return 0; |
442 | error = sysdev_register(&cmx2xx_pm_device); | ||
443 | return error; | ||
444 | } | 435 | } |
445 | #else | 436 | #else |
446 | static int __init cmx2xx_pm_init(void) { return 0; } | 437 | static int __init cmx2xx_pm_init(void) { return 0; } |
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c index 81c3c433e2d6..d28e802e2448 100644 --- a/arch/arm/mach-pxa/colibri-evalboard.c +++ b/arch/arm/mach-pxa/colibri-evalboard.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/sysdev.h> | ||
17 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
18 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
19 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 44c1b77ece67..80538b8806ed 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/pwm_backlight.h> | 23 | #include <linux/pwm_backlight.h> |
24 | #include <linux/i2c/pxa-i2c.h> | 24 | #include <linux/i2c/pxa-i2c.h> |
25 | #include <linux/sysdev.h> | ||
26 | 25 | ||
27 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
28 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index 6fc5d328ba7f..7545a48ed88b 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/mtd/partitions.h> | 17 | #include <linux/mtd/partitions.h> |
18 | #include <linux/mtd/physmap.h> | 18 | #include <linux/mtd/physmap.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/sysdev.h> | ||
21 | #include <linux/ucb1400.h> | 20 | #include <linux/ucb1400.h> |
22 | 21 | ||
23 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index a079d8baa45a..e6c9344a95ae 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -61,10 +61,10 @@ extern unsigned pxa3xx_get_clk_frequency_khz(int); | |||
61 | #define pxa3xx_get_clk_frequency_khz(x) (0) | 61 | #define pxa3xx_get_clk_frequency_khz(x) (0) |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | extern struct sysdev_class pxa_irq_sysclass; | 64 | extern struct syscore_ops pxa_irq_syscore_ops; |
65 | extern struct sysdev_class pxa_gpio_sysclass; | 65 | extern struct syscore_ops pxa_gpio_syscore_ops; |
66 | extern struct sysdev_class pxa2xx_mfp_sysclass; | 66 | extern struct syscore_ops pxa2xx_mfp_syscore_ops; |
67 | extern struct sysdev_class pxa3xx_mfp_sysclass; | 67 | extern struct syscore_ops pxa3xx_mfp_syscore_ops; |
68 | 68 | ||
69 | void __init pxa_set_ffuart_info(void *info); | 69 | void __init pxa_set_ffuart_info(void *info); |
70 | void __init pxa_set_btuart_info(void *info); | 70 | void __init pxa_set_btuart_info(void *info); |
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 6251e3f5c62c..32ed551bf9c5 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/syscore_ops.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
21 | 21 | ||
@@ -183,7 +183,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) | |||
183 | static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; | 183 | static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; |
184 | static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; | 184 | static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; |
185 | 185 | ||
186 | static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) | 186 | static int pxa_irq_suspend(void) |
187 | { | 187 | { |
188 | int i; | 188 | int i; |
189 | 189 | ||
@@ -202,7 +202,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) | |||
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int pxa_irq_resume(struct sys_device *dev) | 205 | static void pxa_irq_resume(void) |
206 | { | 206 | { |
207 | int i; | 207 | int i; |
208 | 208 | ||
@@ -218,22 +218,13 @@ static int pxa_irq_resume(struct sys_device *dev) | |||
218 | __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); | 218 | __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); |
219 | 219 | ||
220 | __raw_writel(1, IRQ_BASE + ICCR); | 220 | __raw_writel(1, IRQ_BASE + ICCR); |
221 | return 0; | ||
222 | } | 221 | } |
223 | #else | 222 | #else |
224 | #define pxa_irq_suspend NULL | 223 | #define pxa_irq_suspend NULL |
225 | #define pxa_irq_resume NULL | 224 | #define pxa_irq_resume NULL |
226 | #endif | 225 | #endif |
227 | 226 | ||
228 | struct sysdev_class pxa_irq_sysclass = { | 227 | struct syscore_ops pxa_irq_syscore_ops = { |
229 | .name = "irq", | ||
230 | .suspend = pxa_irq_suspend, | 228 | .suspend = pxa_irq_suspend, |
231 | .resume = pxa_irq_resume, | 229 | .resume = pxa_irq_resume, |
232 | }; | 230 | }; |
233 | |||
234 | static int __init pxa_irq_init(void) | ||
235 | { | ||
236 | return sysdev_class_register(&pxa_irq_sysclass); | ||
237 | } | ||
238 | |||
239 | core_initcall(pxa_irq_init); | ||
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index f5de541725b1..6cf8180bf5bd 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/syscore_ops.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/bitops.h> | 21 | #include <linux/bitops.h> |
@@ -159,30 +159,22 @@ static void __init lpd270_init_irq(void) | |||
159 | 159 | ||
160 | 160 | ||
161 | #ifdef CONFIG_PM | 161 | #ifdef CONFIG_PM |
162 | static int lpd270_irq_resume(struct sys_device *dev) | 162 | static void lpd270_irq_resume(void) |
163 | { | 163 | { |
164 | __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); | 164 | __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); |
165 | return 0; | ||
166 | } | 165 | } |
167 | 166 | ||
168 | static struct sysdev_class lpd270_irq_sysclass = { | 167 | static struct syscore_ops lpd270_irq_syscore_ops = { |
169 | .name = "cpld_irq", | ||
170 | .resume = lpd270_irq_resume, | 168 | .resume = lpd270_irq_resume, |
171 | }; | 169 | }; |
172 | 170 | ||
173 | static struct sys_device lpd270_irq_device = { | ||
174 | .cls = &lpd270_irq_sysclass, | ||
175 | }; | ||
176 | |||
177 | static int __init lpd270_irq_device_init(void) | 171 | static int __init lpd270_irq_device_init(void) |
178 | { | 172 | { |
179 | int ret = -ENODEV; | ||
180 | if (machine_is_logicpd_pxa270()) { | 173 | if (machine_is_logicpd_pxa270()) { |
181 | ret = sysdev_class_register(&lpd270_irq_sysclass); | 174 | register_syscore_ops(&lpd270_irq_syscore_ops); |
182 | if (ret == 0) | 175 | return 0; |
183 | ret = sysdev_register(&lpd270_irq_device); | ||
184 | } | 176 | } |
185 | return ret; | 177 | return -ENODEV; |
186 | } | 178 | } |
187 | 179 | ||
188 | device_initcall(lpd270_irq_device_init); | 180 | device_initcall(lpd270_irq_device_init); |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 3ede978c83d9..e10ddb827147 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/syscore_ops.h> |
19 | #include <linux/major.h> | 19 | #include <linux/major.h> |
20 | #include <linux/fb.h> | 20 | #include <linux/fb.h> |
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
@@ -176,31 +176,22 @@ static void __init lubbock_init_irq(void) | |||
176 | 176 | ||
177 | #ifdef CONFIG_PM | 177 | #ifdef CONFIG_PM |
178 | 178 | ||
179 | static int lubbock_irq_resume(struct sys_device *dev) | 179 | static void lubbock_irq_resume(void) |
180 | { | 180 | { |
181 | LUB_IRQ_MASK_EN = lubbock_irq_enabled; | 181 | LUB_IRQ_MASK_EN = lubbock_irq_enabled; |
182 | return 0; | ||
183 | } | 182 | } |
184 | 183 | ||
185 | static struct sysdev_class lubbock_irq_sysclass = { | 184 | static struct syscore_ops lubbock_irq_syscore_ops = { |
186 | .name = "cpld_irq", | ||
187 | .resume = lubbock_irq_resume, | 185 | .resume = lubbock_irq_resume, |
188 | }; | 186 | }; |
189 | 187 | ||
190 | static struct sys_device lubbock_irq_device = { | ||
191 | .cls = &lubbock_irq_sysclass, | ||
192 | }; | ||
193 | |||
194 | static int __init lubbock_irq_device_init(void) | 188 | static int __init lubbock_irq_device_init(void) |
195 | { | 189 | { |
196 | int ret = -ENODEV; | ||
197 | |||
198 | if (machine_is_lubbock()) { | 190 | if (machine_is_lubbock()) { |
199 | ret = sysdev_class_register(&lubbock_irq_sysclass); | 191 | register_syscore_ops(&lubbock_irq_syscore_ops); |
200 | if (ret == 0) | 192 | return 0; |
201 | ret = sysdev_register(&lubbock_irq_device); | ||
202 | } | 193 | } |
203 | return ret; | 194 | return -ENODEV; |
204 | } | 195 | } |
205 | 196 | ||
206 | device_initcall(lubbock_irq_device_init); | 197 | device_initcall(lubbock_irq_device_init); |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 95163baca29e..3479e2b3b511 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/syscore_ops.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/bitops.h> | 21 | #include <linux/bitops.h> |
@@ -185,31 +185,21 @@ static void __init mainstone_init_irq(void) | |||
185 | 185 | ||
186 | #ifdef CONFIG_PM | 186 | #ifdef CONFIG_PM |
187 | 187 | ||
188 | static int mainstone_irq_resume(struct sys_device *dev) | 188 | static void mainstone_irq_resume(void) |
189 | { | 189 | { |
190 | MST_INTMSKENA = mainstone_irq_enabled; | 190 | MST_INTMSKENA = mainstone_irq_enabled; |
191 | return 0; | ||
192 | } | 191 | } |
193 | 192 | ||
194 | static struct sysdev_class mainstone_irq_sysclass = { | 193 | static struct syscore_ops mainstone_irq_syscore_ops = { |
195 | .name = "cpld_irq", | ||
196 | .resume = mainstone_irq_resume, | 194 | .resume = mainstone_irq_resume, |
197 | }; | 195 | }; |
198 | 196 | ||
199 | static struct sys_device mainstone_irq_device = { | ||
200 | .cls = &mainstone_irq_sysclass, | ||
201 | }; | ||
202 | |||
203 | static int __init mainstone_irq_device_init(void) | 197 | static int __init mainstone_irq_device_init(void) |
204 | { | 198 | { |
205 | int ret = -ENODEV; | 199 | if (machine_is_mainstone()) |
200 | register_syscore_ops(&mainstone_irq_syscore_ops); | ||
206 | 201 | ||
207 | if (machine_is_mainstone()) { | 202 | return 0; |
208 | ret = sysdev_class_register(&mainstone_irq_sysclass); | ||
209 | if (ret == 0) | ||
210 | ret = sysdev_register(&mainstone_irq_device); | ||
211 | } | ||
212 | return ret; | ||
213 | } | 203 | } |
214 | 204 | ||
215 | device_initcall(mainstone_irq_device_init); | 205 | device_initcall(mainstone_irq_device_init); |
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c index 1d1419b73457..87ae3129f4f7 100644 --- a/arch/arm/mach-pxa/mfp-pxa2xx.c +++ b/arch/arm/mach-pxa/mfp-pxa2xx.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/sysdev.h> | 19 | #include <linux/syscore_ops.h> |
20 | 20 | ||
21 | #include <mach/gpio.h> | 21 | #include <mach/gpio.h> |
22 | #include <mach/pxa2xx-regs.h> | 22 | #include <mach/pxa2xx-regs.h> |
@@ -338,7 +338,7 @@ static unsigned long saved_gafr[2][4]; | |||
338 | static unsigned long saved_gpdr[4]; | 338 | static unsigned long saved_gpdr[4]; |
339 | static unsigned long saved_pgsr[4]; | 339 | static unsigned long saved_pgsr[4]; |
340 | 340 | ||
341 | static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state) | 341 | static int pxa2xx_mfp_suspend(void) |
342 | { | 342 | { |
343 | int i; | 343 | int i; |
344 | 344 | ||
@@ -365,7 +365,7 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state) | |||
365 | return 0; | 365 | return 0; |
366 | } | 366 | } |
367 | 367 | ||
368 | static int pxa2xx_mfp_resume(struct sys_device *d) | 368 | static void pxa2xx_mfp_resume(void) |
369 | { | 369 | { |
370 | int i; | 370 | int i; |
371 | 371 | ||
@@ -376,15 +376,13 @@ static int pxa2xx_mfp_resume(struct sys_device *d) | |||
376 | PGSR(i) = saved_pgsr[i]; | 376 | PGSR(i) = saved_pgsr[i]; |
377 | } | 377 | } |
378 | PSSR = PSSR_RDH | PSSR_PH; | 378 | PSSR = PSSR_RDH | PSSR_PH; |
379 | return 0; | ||
380 | } | 379 | } |
381 | #else | 380 | #else |
382 | #define pxa2xx_mfp_suspend NULL | 381 | #define pxa2xx_mfp_suspend NULL |
383 | #define pxa2xx_mfp_resume NULL | 382 | #define pxa2xx_mfp_resume NULL |
384 | #endif | 383 | #endif |
385 | 384 | ||
386 | struct sysdev_class pxa2xx_mfp_sysclass = { | 385 | struct syscore_ops pxa2xx_mfp_syscore_ops = { |
387 | .name = "mfp", | ||
388 | .suspend = pxa2xx_mfp_suspend, | 386 | .suspend = pxa2xx_mfp_suspend, |
389 | .resume = pxa2xx_mfp_resume, | 387 | .resume = pxa2xx_mfp_resume, |
390 | }; | 388 | }; |
@@ -409,6 +407,6 @@ static int __init pxa2xx_mfp_init(void) | |||
409 | for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) | 407 | for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) |
410 | gpdr_lpm[i] = GPDR(i * 32); | 408 | gpdr_lpm[i] = GPDR(i * 32); |
411 | 409 | ||
412 | return sysdev_class_register(&pxa2xx_mfp_sysclass); | 410 | return 0; |
413 | } | 411 | } |
414 | postcore_initcall(pxa2xx_mfp_init); | 412 | postcore_initcall(pxa2xx_mfp_init); |
diff --git a/arch/arm/mach-pxa/mfp-pxa3xx.c b/arch/arm/mach-pxa/mfp-pxa3xx.c index 7a270eecd480..89863a01ecd7 100644 --- a/arch/arm/mach-pxa/mfp-pxa3xx.c +++ b/arch/arm/mach-pxa/mfp-pxa3xx.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | 21 | ||
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/mfp-pxa3xx.h> | 23 | #include <mach/mfp-pxa3xx.h> |
@@ -31,13 +31,13 @@ | |||
31 | * a pull-down mode if they're an active low chip select, and we're | 31 | * a pull-down mode if they're an active low chip select, and we're |
32 | * just entering standby. | 32 | * just entering standby. |
33 | */ | 33 | */ |
34 | static int pxa3xx_mfp_suspend(struct sys_device *d, pm_message_t state) | 34 | static int pxa3xx_mfp_suspend(void) |
35 | { | 35 | { |
36 | mfp_config_lpm(); | 36 | mfp_config_lpm(); |
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | static int pxa3xx_mfp_resume(struct sys_device *d) | 40 | static void pxa3xx_mfp_resume(void) |
41 | { | 41 | { |
42 | mfp_config_run(); | 42 | mfp_config_run(); |
43 | 43 | ||
@@ -47,24 +47,13 @@ static int pxa3xx_mfp_resume(struct sys_device *d) | |||
47 | * preserve them here in case they will be referenced later | 47 | * preserve them here in case they will be referenced later |
48 | */ | 48 | */ |
49 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); | 49 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); |
50 | return 0; | ||
51 | } | 50 | } |
52 | #else | 51 | #else |
53 | #define pxa3xx_mfp_suspend NULL | 52 | #define pxa3xx_mfp_suspend NULL |
54 | #define pxa3xx_mfp_resume NULL | 53 | #define pxa3xx_mfp_resume NULL |
55 | #endif | 54 | #endif |
56 | 55 | ||
57 | struct sysdev_class pxa3xx_mfp_sysclass = { | 56 | struct syscore_ops pxa3xx_mfp_syscore_ops = { |
58 | .name = "mfp", | ||
59 | .suspend = pxa3xx_mfp_suspend, | 57 | .suspend = pxa3xx_mfp_suspend, |
60 | .resume = pxa3xx_mfp_resume, | 58 | .resume = pxa3xx_mfp_resume, |
61 | }; | 59 | }; |
62 | |||
63 | static int __init mfp_init_devicefs(void) | ||
64 | { | ||
65 | if (cpu_is_pxa3xx()) | ||
66 | return sysdev_class_register(&pxa3xx_mfp_sysclass); | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | postcore_initcall(mfp_init_devicefs); | ||
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 23925db8ff74..e3470137c934 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/syscore_ops.h> |
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/gpio_keys.h> | 28 | #include <linux/gpio_keys.h> |
@@ -488,7 +488,7 @@ static void install_bootstrap(void) | |||
488 | } | 488 | } |
489 | 489 | ||
490 | 490 | ||
491 | static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state) | 491 | static int mioa701_sys_suspend(void) |
492 | { | 492 | { |
493 | int i = 0, is_bt_on; | 493 | int i = 0, is_bt_on; |
494 | u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); | 494 | u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); |
@@ -514,7 +514,7 @@ static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state) | |||
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
517 | static int mioa701_sys_resume(struct sys_device *sysdev) | 517 | static void mioa701_sys_resume(void) |
518 | { | 518 | { |
519 | int i = 0; | 519 | int i = 0; |
520 | u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); | 520 | u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); |
@@ -527,43 +527,18 @@ static int mioa701_sys_resume(struct sys_device *sysdev) | |||
527 | *mem_resume_enabler = save_buffer[i++]; | 527 | *mem_resume_enabler = save_buffer[i++]; |
528 | *mem_resume_bt = save_buffer[i++]; | 528 | *mem_resume_bt = save_buffer[i++]; |
529 | *mem_resume_unknown = save_buffer[i++]; | 529 | *mem_resume_unknown = save_buffer[i++]; |
530 | |||
531 | return 0; | ||
532 | } | 530 | } |
533 | 531 | ||
534 | static struct sysdev_class mioa701_sysclass = { | 532 | static struct syscore_ops mioa701_syscore_ops = { |
535 | .name = "mioa701", | 533 | .suspend = mioa701_sys_suspend, |
536 | }; | 534 | .resume = mioa701_sys_resume, |
537 | |||
538 | static struct sys_device sysdev_bootstrap = { | ||
539 | .cls = &mioa701_sysclass, | ||
540 | }; | ||
541 | |||
542 | static struct sysdev_driver driver_bootstrap = { | ||
543 | .suspend = &mioa701_sys_suspend, | ||
544 | .resume = &mioa701_sys_resume, | ||
545 | }; | 535 | }; |
546 | 536 | ||
547 | static int __init bootstrap_init(void) | 537 | static int __init bootstrap_init(void) |
548 | { | 538 | { |
549 | int rc; | ||
550 | int save_size = mioa701_bootstrap_lg + (sizeof(u32) * 3); | 539 | int save_size = mioa701_bootstrap_lg + (sizeof(u32) * 3); |
551 | 540 | ||
552 | rc = sysdev_class_register(&mioa701_sysclass); | 541 | register_syscore_ops(&mioa701_syscore_ops); |
553 | if (rc) { | ||
554 | printk(KERN_ERR "Failed registering mioa701 sys class\n"); | ||
555 | return -ENODEV; | ||
556 | } | ||
557 | rc = sysdev_register(&sysdev_bootstrap); | ||
558 | if (rc) { | ||
559 | printk(KERN_ERR "Failed registering mioa701 sys device\n"); | ||
560 | return -ENODEV; | ||
561 | } | ||
562 | rc = sysdev_driver_register(&mioa701_sysclass, &driver_bootstrap); | ||
563 | if (rc) { | ||
564 | printk(KERN_ERR "Failed registering PMU sys driver\n"); | ||
565 | return -ENODEV; | ||
566 | } | ||
567 | 542 | ||
568 | save_buffer = kmalloc(save_size, GFP_KERNEL); | 543 | save_buffer = kmalloc(save_size, GFP_KERNEL); |
569 | if (!save_buffer) | 544 | if (!save_buffer) |
@@ -576,9 +551,7 @@ static int __init bootstrap_init(void) | |||
576 | static void bootstrap_exit(void) | 551 | static void bootstrap_exit(void) |
577 | { | 552 | { |
578 | kfree(save_buffer); | 553 | kfree(save_buffer); |
579 | sysdev_driver_unregister(&mioa701_sysclass, &driver_bootstrap); | 554 | unregister_syscore_ops(&mioa701_syscore_ops); |
580 | sysdev_unregister(&sysdev_bootstrap); | ||
581 | sysdev_class_unregister(&mioa701_sysclass); | ||
582 | 555 | ||
583 | printk(KERN_CRIT "Unregistering mioa701 suspend will hang next" | 556 | printk(KERN_CRIT "Unregistering mioa701 suspend will hang next" |
584 | "resume !!!\n"); | 557 | "resume !!!\n"); |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index a6f898cbfac9..4061ecddee70 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/wm97xx.h> | 25 | #include <linux/wm97xx.h> |
26 | #include <linux/power_supply.h> | 26 | #include <linux/power_supply.h> |
27 | #include <linux/sysdev.h> | ||
28 | #include <linux/mtd/mtd.h> | 27 | #include <linux/mtd/mtd.h> |
29 | #include <linux/mtd/partitions.h> | 28 | #include <linux/mtd/partitions.h> |
30 | #include <linux/mtd/physmap.h> | 29 | #include <linux/mtd/physmap.h> |
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 8aadad55fbe4..20d1b18b1733 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/pwm_backlight.h> | 25 | #include <linux/pwm_backlight.h> |
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/power_supply.h> | 27 | #include <linux/power_supply.h> |
28 | #include <linux/sysdev.h> | ||
29 | #include <linux/w1-gpio.h> | 28 | #include <linux/w1-gpio.h> |
30 | 29 | ||
31 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index 3b8a4f37dbbe..65f24f0b77e8 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/sysdev.h> | 22 | #include <linux/syscore_ops.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
@@ -233,9 +233,9 @@ static struct palmz72_resume_info palmz72_resume_info = { | |||
233 | 233 | ||
234 | static unsigned long store_ptr; | 234 | static unsigned long store_ptr; |
235 | 235 | ||
236 | /* sys_device for Palm Zire 72 PM */ | 236 | /* syscore_ops for Palm Zire 72 PM */ |
237 | 237 | ||
238 | static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg) | 238 | static int palmz72_pm_suspend(void) |
239 | { | 239 | { |
240 | /* setup the resume_info struct for the original bootloader */ | 240 | /* setup the resume_info struct for the original bootloader */ |
241 | palmz72_resume_info.resume_addr = (u32) cpu_resume; | 241 | palmz72_resume_info.resume_addr = (u32) cpu_resume; |
@@ -249,31 +249,23 @@ static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg) | |||
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
251 | 251 | ||
252 | static int palmz72_pm_resume(struct sys_device *dev) | 252 | static void palmz72_pm_resume(void) |
253 | { | 253 | { |
254 | *PALMZ72_SAVE_DWORD = store_ptr; | 254 | *PALMZ72_SAVE_DWORD = store_ptr; |
255 | return 0; | ||
256 | } | 255 | } |
257 | 256 | ||
258 | static struct sysdev_class palmz72_pm_sysclass = { | 257 | static struct syscore_ops palmz72_pm_syscore_ops = { |
259 | .name = "palmz72_pm", | ||
260 | .suspend = palmz72_pm_suspend, | 258 | .suspend = palmz72_pm_suspend, |
261 | .resume = palmz72_pm_resume, | 259 | .resume = palmz72_pm_resume, |
262 | }; | 260 | }; |
263 | 261 | ||
264 | static struct sys_device palmz72_pm_device = { | ||
265 | .cls = &palmz72_pm_sysclass, | ||
266 | }; | ||
267 | |||
268 | static int __init palmz72_pm_init(void) | 262 | static int __init palmz72_pm_init(void) |
269 | { | 263 | { |
270 | int ret = -ENODEV; | ||
271 | if (machine_is_palmz72()) { | 264 | if (machine_is_palmz72()) { |
272 | ret = sysdev_class_register(&palmz72_pm_sysclass); | 265 | register_syscore_ops(&palmz72_pm_syscore_ops); |
273 | if (ret == 0) | 266 | return 0; |
274 | ret = sysdev_register(&palmz72_pm_device); | ||
275 | } | 267 | } |
276 | return ret; | 268 | return -ENODEV; |
277 | } | 269 | } |
278 | 270 | ||
279 | device_initcall(palmz72_pm_init); | 271 | device_initcall(palmz72_pm_init); |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index a4af8c52d7ee..fed363cec9c6 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -21,7 +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 | #include <linux/syscore_ops.h> |
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | 26 | ||
27 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
@@ -350,21 +350,9 @@ static struct platform_device *pxa25x_devices[] __initdata = { | |||
350 | &pxa_device_asoc_platform, | 350 | &pxa_device_asoc_platform, |
351 | }; | 351 | }; |
352 | 352 | ||
353 | static struct sys_device pxa25x_sysdev[] = { | ||
354 | { | ||
355 | .cls = &pxa_irq_sysclass, | ||
356 | }, { | ||
357 | .cls = &pxa2xx_mfp_sysclass, | ||
358 | }, { | ||
359 | .cls = &pxa_gpio_sysclass, | ||
360 | }, { | ||
361 | .cls = &pxa2xx_clock_sysclass, | ||
362 | } | ||
363 | }; | ||
364 | |||
365 | static int __init pxa25x_init(void) | 353 | static int __init pxa25x_init(void) |
366 | { | 354 | { |
367 | int i, ret = 0; | 355 | int ret = 0; |
368 | 356 | ||
369 | if (cpu_is_pxa25x()) { | 357 | if (cpu_is_pxa25x()) { |
370 | 358 | ||
@@ -377,11 +365,10 @@ static int __init pxa25x_init(void) | |||
377 | 365 | ||
378 | pxa25x_init_pm(); | 366 | pxa25x_init_pm(); |
379 | 367 | ||
380 | for (i = 0; i < ARRAY_SIZE(pxa25x_sysdev); i++) { | 368 | register_syscore_ops(&pxa_irq_syscore_ops); |
381 | ret = sysdev_register(&pxa25x_sysdev[i]); | 369 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); |
382 | if (ret) | 370 | register_syscore_ops(&pxa_gpio_syscore_ops); |
383 | pr_err("failed to register sysdev[%d]\n", i); | 371 | register_syscore_ops(&pxa2xx_clock_syscore_ops); |
384 | } | ||
385 | 372 | ||
386 | ret = platform_add_devices(pxa25x_devices, | 373 | ret = platform_add_devices(pxa25x_devices, |
387 | ARRAY_SIZE(pxa25x_devices)); | 374 | ARRAY_SIZE(pxa25x_devices)); |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 909756eaf4b7..2fecbec58d88 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/suspend.h> | 17 | #include <linux/suspend.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/sysdev.h> | 19 | #include <linux/syscore_ops.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/i2c/pxa-i2c.h> | 22 | #include <linux/i2c/pxa-i2c.h> |
@@ -428,21 +428,9 @@ static struct platform_device *devices[] __initdata = { | |||
428 | &pxa27x_device_pwm1, | 428 | &pxa27x_device_pwm1, |
429 | }; | 429 | }; |
430 | 430 | ||
431 | static struct sys_device pxa27x_sysdev[] = { | ||
432 | { | ||
433 | .cls = &pxa_irq_sysclass, | ||
434 | }, { | ||
435 | .cls = &pxa2xx_mfp_sysclass, | ||
436 | }, { | ||
437 | .cls = &pxa_gpio_sysclass, | ||
438 | }, { | ||
439 | .cls = &pxa2xx_clock_sysclass, | ||
440 | } | ||
441 | }; | ||
442 | |||
443 | static int __init pxa27x_init(void) | 431 | static int __init pxa27x_init(void) |
444 | { | 432 | { |
445 | int i, ret = 0; | 433 | int ret = 0; |
446 | 434 | ||
447 | if (cpu_is_pxa27x()) { | 435 | if (cpu_is_pxa27x()) { |
448 | 436 | ||
@@ -455,11 +443,10 @@ static int __init pxa27x_init(void) | |||
455 | 443 | ||
456 | pxa27x_init_pm(); | 444 | pxa27x_init_pm(); |
457 | 445 | ||
458 | for (i = 0; i < ARRAY_SIZE(pxa27x_sysdev); i++) { | 446 | register_syscore_ops(&pxa_irq_syscore_ops); |
459 | ret = sysdev_register(&pxa27x_sysdev[i]); | 447 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); |
460 | if (ret) | 448 | register_syscore_ops(&pxa_gpio_syscore_ops); |
461 | pr_err("failed to register sysdev[%d]\n", i); | 449 | register_syscore_ops(&pxa2xx_clock_syscore_ops); |
462 | } | ||
463 | 450 | ||
464 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 451 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
465 | } | 452 | } |
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 8dd107391157..8521d7d6f1da 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/sysdev.h> | 23 | #include <linux/syscore_ops.h> |
24 | #include <linux/i2c/pxa-i2c.h> | 24 | #include <linux/i2c/pxa-i2c.h> |
25 | 25 | ||
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
@@ -427,21 +427,9 @@ static struct platform_device *devices[] __initdata = { | |||
427 | &pxa27x_device_pwm1, | 427 | &pxa27x_device_pwm1, |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static struct sys_device pxa3xx_sysdev[] = { | ||
431 | { | ||
432 | .cls = &pxa_irq_sysclass, | ||
433 | }, { | ||
434 | .cls = &pxa3xx_mfp_sysclass, | ||
435 | }, { | ||
436 | .cls = &pxa_gpio_sysclass, | ||
437 | }, { | ||
438 | .cls = &pxa3xx_clock_sysclass, | ||
439 | } | ||
440 | }; | ||
441 | |||
442 | static int __init pxa3xx_init(void) | 430 | static int __init pxa3xx_init(void) |
443 | { | 431 | { |
444 | int i, ret = 0; | 432 | int ret = 0; |
445 | 433 | ||
446 | if (cpu_is_pxa3xx()) { | 434 | if (cpu_is_pxa3xx()) { |
447 | 435 | ||
@@ -462,11 +450,10 @@ static int __init pxa3xx_init(void) | |||
462 | 450 | ||
463 | pxa3xx_init_pm(); | 451 | pxa3xx_init_pm(); |
464 | 452 | ||
465 | for (i = 0; i < ARRAY_SIZE(pxa3xx_sysdev); i++) { | 453 | register_syscore_ops(&pxa_irq_syscore_ops); |
466 | ret = sysdev_register(&pxa3xx_sysdev[i]); | 454 | register_syscore_ops(&pxa3xx_mfp_syscore_ops); |
467 | if (ret) | 455 | register_syscore_ops(&pxa_gpio_syscore_ops); |
468 | pr_err("failed to register sysdev[%d]\n", i); | 456 | register_syscore_ops(&pxa3xx_clock_syscore_ops); |
469 | } | ||
470 | 457 | ||
471 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 458 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
472 | } | 459 | } |
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c index 23b229bd06e9..ecc82a330fad 100644 --- a/arch/arm/mach-pxa/pxa95x.c +++ b/arch/arm/mach-pxa/pxa95x.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/i2c/pxa-i2c.h> | 18 | #include <linux/i2c/pxa-i2c.h> |
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/syscore_ops.h> |
22 | 22 | ||
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/gpio.h> | 24 | #include <mach/gpio.h> |
@@ -260,16 +260,6 @@ static struct platform_device *devices[] __initdata = { | |||
260 | &pxa27x_device_pwm1, | 260 | &pxa27x_device_pwm1, |
261 | }; | 261 | }; |
262 | 262 | ||
263 | static struct sys_device pxa95x_sysdev[] = { | ||
264 | { | ||
265 | .cls = &pxa_irq_sysclass, | ||
266 | }, { | ||
267 | .cls = &pxa_gpio_sysclass, | ||
268 | }, { | ||
269 | .cls = &pxa3xx_clock_sysclass, | ||
270 | } | ||
271 | }; | ||
272 | |||
273 | static int __init pxa95x_init(void) | 263 | static int __init pxa95x_init(void) |
274 | { | 264 | { |
275 | int ret = 0, i; | 265 | int ret = 0, i; |
@@ -293,11 +283,9 @@ static int __init pxa95x_init(void) | |||
293 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) | 283 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) |
294 | return ret; | 284 | return ret; |
295 | 285 | ||
296 | for (i = 0; i < ARRAY_SIZE(pxa95x_sysdev); i++) { | 286 | register_syscore_ops(&pxa_irq_syscore_ops); |
297 | ret = sysdev_register(&pxa95x_sysdev[i]); | 287 | register_syscore_ops(&pxa_gpio_syscore_ops); |
298 | if (ret) | 288 | register_syscore_ops(&pxa3xx_clock_syscore_ops); |
299 | pr_err("failed to register sysdev[%d]\n", i); | ||
300 | } | ||
301 | 289 | ||
302 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 290 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
303 | } | 291 | } |
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index cd1861351f75..d130f77b6d11 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/sysdev.h> | ||
22 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
23 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
24 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c index 232b7316ec08..79923058d10f 100644 --- a/arch/arm/mach-pxa/smemc.c +++ b/arch/arm/mach-pxa/smemc.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/io.h> | 8 | #include <linux/io.h> |
9 | #include <linux/sysdev.h> | 9 | #include <linux/syscore_ops.h> |
10 | 10 | ||
11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
12 | #include <mach/smemc.h> | 12 | #include <mach/smemc.h> |
@@ -16,7 +16,7 @@ static unsigned long msc[2]; | |||
16 | static unsigned long sxcnfg, memclkcfg; | 16 | static unsigned long sxcnfg, memclkcfg; |
17 | static unsigned long csadrcfg[4]; | 17 | static unsigned long csadrcfg[4]; |
18 | 18 | ||
19 | static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) | 19 | static int pxa3xx_smemc_suspend(void) |
20 | { | 20 | { |
21 | msc[0] = __raw_readl(MSC0); | 21 | msc[0] = __raw_readl(MSC0); |
22 | msc[1] = __raw_readl(MSC1); | 22 | msc[1] = __raw_readl(MSC1); |
@@ -30,7 +30,7 @@ static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) | |||
30 | return 0; | 30 | return 0; |
31 | } | 31 | } |
32 | 32 | ||
33 | static int pxa3xx_smemc_resume(struct sys_device *dev) | 33 | static void pxa3xx_smemc_resume(void) |
34 | { | 34 | { |
35 | __raw_writel(msc[0], MSC0); | 35 | __raw_writel(msc[0], MSC0); |
36 | __raw_writel(msc[1], MSC1); | 36 | __raw_writel(msc[1], MSC1); |
@@ -40,34 +40,19 @@ static int pxa3xx_smemc_resume(struct sys_device *dev) | |||
40 | __raw_writel(csadrcfg[1], CSADRCFG1); | 40 | __raw_writel(csadrcfg[1], CSADRCFG1); |
41 | __raw_writel(csadrcfg[2], CSADRCFG2); | 41 | __raw_writel(csadrcfg[2], CSADRCFG2); |
42 | __raw_writel(csadrcfg[3], CSADRCFG3); | 42 | __raw_writel(csadrcfg[3], CSADRCFG3); |
43 | |||
44 | return 0; | ||
45 | } | 43 | } |
46 | 44 | ||
47 | static struct sysdev_class smemc_sysclass = { | 45 | static struct syscore_ops smemc_syscore_ops = { |
48 | .name = "smemc", | ||
49 | .suspend = pxa3xx_smemc_suspend, | 46 | .suspend = pxa3xx_smemc_suspend, |
50 | .resume = pxa3xx_smemc_resume, | 47 | .resume = pxa3xx_smemc_resume, |
51 | }; | 48 | }; |
52 | 49 | ||
53 | static struct sys_device smemc_sysdev = { | ||
54 | .id = 0, | ||
55 | .cls = &smemc_sysclass, | ||
56 | }; | ||
57 | |||
58 | static int __init smemc_init(void) | 50 | static int __init smemc_init(void) |
59 | { | 51 | { |
60 | int ret = 0; | 52 | if (cpu_is_pxa3xx()) |
53 | register_syscore_ops(&smemc_syscore_ops); | ||
61 | 54 | ||
62 | if (cpu_is_pxa3xx()) { | 55 | return 0; |
63 | ret = sysdev_class_register(&smemc_sysclass); | ||
64 | if (ret) | ||
65 | return ret; | ||
66 | |||
67 | ret = sysdev_register(&smemc_sysdev); | ||
68 | } | ||
69 | |||
70 | return ret; | ||
71 | } | 56 | } |
72 | subsys_initcall(smemc_init); | 57 | subsys_initcall(smemc_init); |
73 | #endif | 58 | #endif |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index b9cfbebdfe9c..687417a93698 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/sysdev.h> | ||
19 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
20 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
21 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index b523f119e0f0..903218eab56d 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/mtd/mtd.h> | 44 | #include <linux/mtd/mtd.h> |
45 | #include <linux/mtd/partitions.h> | 45 | #include <linux/mtd/partitions.h> |
46 | #include <linux/mtd/physmap.h> | 46 | #include <linux/mtd/physmap.h> |
47 | #include <linux/syscore_ops.h> | ||
47 | 48 | ||
48 | #include <mach/pxa25x.h> | 49 | #include <mach/pxa25x.h> |
49 | #include <mach/audio.h> | 50 | #include <mach/audio.h> |
@@ -130,20 +131,19 @@ static u8 viper_hw_version(void) | |||
130 | return v1; | 131 | return v1; |
131 | } | 132 | } |
132 | 133 | ||
133 | /* CPU sysdev */ | 134 | /* CPU system core operations. */ |
134 | static int viper_cpu_suspend(struct sys_device *sysdev, pm_message_t state) | 135 | static int viper_cpu_suspend(void) |
135 | { | 136 | { |
136 | viper_icr_set_bit(VIPER_ICR_R_DIS); | 137 | viper_icr_set_bit(VIPER_ICR_R_DIS); |
137 | return 0; | 138 | return 0; |
138 | } | 139 | } |
139 | 140 | ||
140 | static int viper_cpu_resume(struct sys_device *sysdev) | 141 | static void viper_cpu_resume(void) |
141 | { | 142 | { |
142 | viper_icr_clear_bit(VIPER_ICR_R_DIS); | 143 | viper_icr_clear_bit(VIPER_ICR_R_DIS); |
143 | return 0; | ||
144 | } | 144 | } |
145 | 145 | ||
146 | static struct sysdev_driver viper_cpu_sysdev_driver = { | 146 | static struct syscore_ops viper_cpu_syscore_ops = { |
147 | .suspend = viper_cpu_suspend, | 147 | .suspend = viper_cpu_suspend, |
148 | .resume = viper_cpu_resume, | 148 | .resume = viper_cpu_resume, |
149 | }; | 149 | }; |
@@ -945,7 +945,7 @@ static void __init viper_init(void) | |||
945 | viper_init_vcore_gpios(); | 945 | viper_init_vcore_gpios(); |
946 | viper_init_cpufreq(); | 946 | viper_init_cpufreq(); |
947 | 947 | ||
948 | sysdev_driver_register(&cpu_sysdev_class, &viper_cpu_sysdev_driver); | 948 | register_syscore_ops(&viper_cpu_syscore_ops); |
949 | 949 | ||
950 | if (version) { | 950 | if (version) { |
951 | pr_info("viper: hardware v%di%d detected. " | 951 | pr_info("viper: hardware v%di%d detected. " |
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index f71d377c8640..67bd41488bf8 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/gpio_keys.h> | 16 | #include <linux/gpio_keys.h> |
17 | #include <linux/input.h> | 17 | #include <linux/input.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/sysdev.h> | ||
20 | #include <linux/usb/gpio_vbus.h> | 19 | #include <linux/usb/gpio_vbus.h> |
21 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
22 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c index 5e2f35332056..2854129f8cc7 100644 --- a/arch/arm/mach-s3c2410/irq.c +++ b/arch/arm/mach-s3c2410/irq.c | |||
@@ -23,38 +23,12 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/ioport.h> | 25 | #include <linux/ioport.h> |
26 | #include <linux/sysdev.h> | 26 | #include <linux/syscore_ops.h> |
27 | 27 | ||
28 | #include <plat/cpu.h> | 28 | #include <plat/cpu.h> |
29 | #include <plat/pm.h> | 29 | #include <plat/pm.h> |
30 | 30 | ||
31 | static int s3c2410_irq_add(struct sys_device *sysdev) | 31 | struct syscore_ops s3c24xx_irq_syscore_ops = { |
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | static struct sysdev_driver s3c2410_irq_driver = { | ||
37 | .add = s3c2410_irq_add, | ||
38 | .suspend = s3c24xx_irq_suspend, | 32 | .suspend = s3c24xx_irq_suspend, |
39 | .resume = s3c24xx_irq_resume, | 33 | .resume = s3c24xx_irq_resume, |
40 | }; | 34 | }; |
41 | |||
42 | static int __init s3c2410_irq_init(void) | ||
43 | { | ||
44 | return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver); | ||
45 | } | ||
46 | |||
47 | arch_initcall(s3c2410_irq_init); | ||
48 | |||
49 | static struct sysdev_driver s3c2410a_irq_driver = { | ||
50 | .add = s3c2410_irq_add, | ||
51 | .suspend = s3c24xx_irq_suspend, | ||
52 | .resume = s3c24xx_irq_resume, | ||
53 | }; | ||
54 | |||
55 | static int __init s3c2410a_irq_init(void) | ||
56 | { | ||
57 | return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_irq_driver); | ||
58 | } | ||
59 | |||
60 | arch_initcall(s3c2410a_irq_init); | ||
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c index 2970ea9f7c2b..1e2d536adda9 100644 --- a/arch/arm/mach-s3c2410/mach-bast.c +++ b/arch/arm/mach-s3c2410/mach-bast.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/dm9000.h> | 23 | #include <linux/dm9000.h> |
@@ -214,17 +214,16 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { | |||
214 | /* NAND Flash on BAST board */ | 214 | /* NAND Flash on BAST board */ |
215 | 215 | ||
216 | #ifdef CONFIG_PM | 216 | #ifdef CONFIG_PM |
217 | static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) | 217 | static int bast_pm_suspend(void) |
218 | { | 218 | { |
219 | /* ensure that an nRESET is not generated on resume. */ | 219 | /* ensure that an nRESET is not generated on resume. */ |
220 | gpio_direction_output(S3C2410_GPA(21), 1); | 220 | gpio_direction_output(S3C2410_GPA(21), 1); |
221 | return 0; | 221 | return 0; |
222 | } | 222 | } |
223 | 223 | ||
224 | static int bast_pm_resume(struct sys_device *sd) | 224 | static void bast_pm_resume(void) |
225 | { | 225 | { |
226 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); | 226 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); |
227 | return 0; | ||
228 | } | 227 | } |
229 | 228 | ||
230 | #else | 229 | #else |
@@ -232,16 +231,11 @@ static int bast_pm_resume(struct sys_device *sd) | |||
232 | #define bast_pm_resume NULL | 231 | #define bast_pm_resume NULL |
233 | #endif | 232 | #endif |
234 | 233 | ||
235 | static struct sysdev_class bast_pm_sysclass = { | 234 | static struct syscore_ops bast_pm_syscore_ops = { |
236 | .name = "mach-bast", | ||
237 | .suspend = bast_pm_suspend, | 235 | .suspend = bast_pm_suspend, |
238 | .resume = bast_pm_resume, | 236 | .resume = bast_pm_resume, |
239 | }; | 237 | }; |
240 | 238 | ||
241 | static struct sys_device bast_pm_sysdev = { | ||
242 | .cls = &bast_pm_sysclass, | ||
243 | }; | ||
244 | |||
245 | static int smartmedia_map[] = { 0 }; | 239 | static int smartmedia_map[] = { 0 }; |
246 | static int chip0_map[] = { 1 }; | 240 | static int chip0_map[] = { 1 }; |
247 | static int chip1_map[] = { 2 }; | 241 | static int chip1_map[] = { 2 }; |
@@ -642,8 +636,7 @@ static void __init bast_map_io(void) | |||
642 | 636 | ||
643 | static void __init bast_init(void) | 637 | static void __init bast_init(void) |
644 | { | 638 | { |
645 | sysdev_class_register(&bast_pm_sysclass); | 639 | register_syscore_ops(&bast_pm_syscore_ops); |
646 | sysdev_register(&bast_pm_sysdev); | ||
647 | 640 | ||
648 | s3c_i2c0_set_platdata(&bast_i2c_info); | 641 | s3c_i2c0_set_platdata(&bast_i2c_info); |
649 | s3c_nand_set_platdata(&bast_nand_info); | 642 | s3c_nand_set_platdata(&bast_nand_info); |
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c index 725636fc4dc3..4728f9aa7df1 100644 --- a/arch/arm/mach-s3c2410/pm.c +++ b/arch/arm/mach-s3c2410/pm.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/errno.h> | 25 | #include <linux/errno.h> |
26 | #include <linux/time.h> | 26 | #include <linux/time.h> |
27 | #include <linux/sysdev.h> | 27 | #include <linux/sysdev.h> |
28 | #include <linux/syscore_ops.h> | ||
28 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
29 | #include <linux/io.h> | 30 | #include <linux/io.h> |
30 | 31 | ||
@@ -92,7 +93,7 @@ static void s3c2410_pm_prepare(void) | |||
92 | } | 93 | } |
93 | } | 94 | } |
94 | 95 | ||
95 | static int s3c2410_pm_resume(struct sys_device *dev) | 96 | static void s3c2410_pm_resume(void) |
96 | { | 97 | { |
97 | unsigned long tmp; | 98 | unsigned long tmp; |
98 | 99 | ||
@@ -104,10 +105,12 @@ static int s3c2410_pm_resume(struct sys_device *dev) | |||
104 | 105 | ||
105 | if ( machine_is_aml_m5900() ) | 106 | if ( machine_is_aml_m5900() ) |
106 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); | 107 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); |
107 | |||
108 | return 0; | ||
109 | } | 108 | } |
110 | 109 | ||
110 | struct syscore_ops s3c2410_pm_syscore_ops = { | ||
111 | .resume = s3c2410_pm_resume, | ||
112 | }; | ||
113 | |||
111 | static int s3c2410_pm_add(struct sys_device *dev) | 114 | static int s3c2410_pm_add(struct sys_device *dev) |
112 | { | 115 | { |
113 | pm_cpu_prep = s3c2410_pm_prepare; | 116 | pm_cpu_prep = s3c2410_pm_prepare; |
@@ -119,7 +122,6 @@ static int s3c2410_pm_add(struct sys_device *dev) | |||
119 | #if defined(CONFIG_CPU_S3C2410) | 122 | #if defined(CONFIG_CPU_S3C2410) |
120 | static struct sysdev_driver s3c2410_pm_driver = { | 123 | static struct sysdev_driver s3c2410_pm_driver = { |
121 | .add = s3c2410_pm_add, | 124 | .add = s3c2410_pm_add, |
122 | .resume = s3c2410_pm_resume, | ||
123 | }; | 125 | }; |
124 | 126 | ||
125 | /* register ourselves */ | 127 | /* register ourselves */ |
@@ -133,7 +135,6 @@ arch_initcall(s3c2410_pm_drvinit); | |||
133 | 135 | ||
134 | static struct sysdev_driver s3c2410a_pm_driver = { | 136 | static struct sysdev_driver s3c2410a_pm_driver = { |
135 | .add = s3c2410_pm_add, | 137 | .add = s3c2410_pm_add, |
136 | .resume = s3c2410_pm_resume, | ||
137 | }; | 138 | }; |
138 | 139 | ||
139 | static int __init s3c2410a_pm_drvinit(void) | 140 | static int __init s3c2410a_pm_drvinit(void) |
@@ -147,7 +148,6 @@ arch_initcall(s3c2410a_pm_drvinit); | |||
147 | #if defined(CONFIG_CPU_S3C2440) | 148 | #if defined(CONFIG_CPU_S3C2440) |
148 | static struct sysdev_driver s3c2440_pm_driver = { | 149 | static struct sysdev_driver s3c2440_pm_driver = { |
149 | .add = s3c2410_pm_add, | 150 | .add = s3c2410_pm_add, |
150 | .resume = s3c2410_pm_resume, | ||
151 | }; | 151 | }; |
152 | 152 | ||
153 | static int __init s3c2440_pm_drvinit(void) | 153 | static int __init s3c2440_pm_drvinit(void) |
@@ -161,7 +161,6 @@ arch_initcall(s3c2440_pm_drvinit); | |||
161 | #if defined(CONFIG_CPU_S3C2442) | 161 | #if defined(CONFIG_CPU_S3C2442) |
162 | static struct sysdev_driver s3c2442_pm_driver = { | 162 | static struct sysdev_driver s3c2442_pm_driver = { |
163 | .add = s3c2410_pm_add, | 163 | .add = s3c2410_pm_add, |
164 | .resume = s3c2410_pm_resume, | ||
165 | }; | 164 | }; |
166 | 165 | ||
167 | static int __init s3c2442_pm_drvinit(void) | 166 | static int __init s3c2442_pm_drvinit(void) |
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c index adc90a3c5890..f1d3bd8f6f17 100644 --- a/arch/arm/mach-s3c2410/s3c2410.c +++ b/arch/arm/mach-s3c2410/s3c2410.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/syscore_ops.h> | ||
22 | #include <linux/serial_core.h> | 23 | #include <linux/serial_core.h> |
23 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
@@ -40,6 +41,7 @@ | |||
40 | #include <plat/devs.h> | 41 | #include <plat/devs.h> |
41 | #include <plat/clock.h> | 42 | #include <plat/clock.h> |
42 | #include <plat/pll.h> | 43 | #include <plat/pll.h> |
44 | #include <plat/pm.h> | ||
43 | 45 | ||
44 | #include <plat/gpio-core.h> | 46 | #include <plat/gpio-core.h> |
45 | #include <plat/gpio-cfg.h> | 47 | #include <plat/gpio-cfg.h> |
@@ -168,6 +170,9 @@ int __init s3c2410_init(void) | |||
168 | { | 170 | { |
169 | printk("S3C2410: Initialising architecture\n"); | 171 | printk("S3C2410: Initialising architecture\n"); |
170 | 172 | ||
173 | register_syscore_ops(&s3c2410_pm_syscore_ops); | ||
174 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | ||
175 | |||
171 | return sysdev_register(&s3c2410_sysdev); | 176 | return sysdev_register(&s3c2410_sysdev); |
172 | } | 177 | } |
173 | 178 | ||
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c index f3355d2ec634..1a1aa220972b 100644 --- a/arch/arm/mach-s3c2412/irq.c +++ b/arch/arm/mach-s3c2412/irq.c | |||
@@ -202,8 +202,6 @@ static int s3c2412_irq_add(struct sys_device *sysdev) | |||
202 | 202 | ||
203 | static struct sysdev_driver s3c2412_irq_driver = { | 203 | static struct sysdev_driver s3c2412_irq_driver = { |
204 | .add = s3c2412_irq_add, | 204 | .add = s3c2412_irq_add, |
205 | .suspend = s3c24xx_irq_suspend, | ||
206 | .resume = s3c24xx_irq_resume, | ||
207 | }; | 205 | }; |
208 | 206 | ||
209 | static int s3c2412_irq_init(void) | 207 | static int s3c2412_irq_init(void) |
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index 923e01bdf017..85dcaeb9e62f 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
@@ -486,7 +486,7 @@ static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = { | |||
486 | /* Jive power management device */ | 486 | /* Jive power management device */ |
487 | 487 | ||
488 | #ifdef CONFIG_PM | 488 | #ifdef CONFIG_PM |
489 | static int jive_pm_suspend(struct sys_device *sd, pm_message_t state) | 489 | static int jive_pm_suspend(void) |
490 | { | 490 | { |
491 | /* Write the magic value u-boot uses to check for resume into | 491 | /* Write the magic value u-boot uses to check for resume into |
492 | * the INFORM0 register, and ensure INFORM1 is set to the | 492 | * the INFORM0 register, and ensure INFORM1 is set to the |
@@ -498,10 +498,9 @@ static int jive_pm_suspend(struct sys_device *sd, pm_message_t state) | |||
498 | return 0; | 498 | return 0; |
499 | } | 499 | } |
500 | 500 | ||
501 | static int jive_pm_resume(struct sys_device *sd) | 501 | static void jive_pm_resume(void) |
502 | { | 502 | { |
503 | __raw_writel(0x0, S3C2412_INFORM0); | 503 | __raw_writel(0x0, S3C2412_INFORM0); |
504 | return 0; | ||
505 | } | 504 | } |
506 | 505 | ||
507 | #else | 506 | #else |
@@ -509,16 +508,11 @@ static int jive_pm_resume(struct sys_device *sd) | |||
509 | #define jive_pm_resume NULL | 508 | #define jive_pm_resume NULL |
510 | #endif | 509 | #endif |
511 | 510 | ||
512 | static struct sysdev_class jive_pm_sysclass = { | 511 | static struct syscore_ops jive_pm_syscore_ops = { |
513 | .name = "jive-pm", | ||
514 | .suspend = jive_pm_suspend, | 512 | .suspend = jive_pm_suspend, |
515 | .resume = jive_pm_resume, | 513 | .resume = jive_pm_resume, |
516 | }; | 514 | }; |
517 | 515 | ||
518 | static struct sys_device jive_pm_sysdev = { | ||
519 | .cls = &jive_pm_sysclass, | ||
520 | }; | ||
521 | |||
522 | static void __init jive_map_io(void) | 516 | static void __init jive_map_io(void) |
523 | { | 517 | { |
524 | s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc)); | 518 | s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc)); |
@@ -536,10 +530,9 @@ static void jive_power_off(void) | |||
536 | 530 | ||
537 | static void __init jive_machine_init(void) | 531 | static void __init jive_machine_init(void) |
538 | { | 532 | { |
539 | /* register system devices for managing low level suspend */ | 533 | /* register system core operations for managing low level suspend */ |
540 | 534 | ||
541 | sysdev_class_register(&jive_pm_sysclass); | 535 | register_syscore_ops(&jive_pm_syscore_ops); |
542 | sysdev_register(&jive_pm_sysdev); | ||
543 | 536 | ||
544 | /* write our sleep configurations for the IO. Pull down all unused | 537 | /* write our sleep configurations for the IO. Pull down all unused |
545 | * IO, ensure that we have turned off all peripherals we do not | 538 | * IO, ensure that we have turned off all peripherals we do not |
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c index a7417c479ffe..752b13a7b3db 100644 --- a/arch/arm/mach-s3c2412/pm.c +++ b/arch/arm/mach-s3c2412/pm.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/syscore_ops.h> | ||
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | #include <linux/io.h> | 22 | #include <linux/io.h> |
22 | 23 | ||
@@ -86,13 +87,24 @@ static struct sleep_save s3c2412_sleep[] = { | |||
86 | SAVE_ITEM(S3C2413_GPJSLPCON), | 87 | SAVE_ITEM(S3C2413_GPJSLPCON), |
87 | }; | 88 | }; |
88 | 89 | ||
89 | static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state) | 90 | static struct sysdev_driver s3c2412_pm_driver = { |
91 | .add = s3c2412_pm_add, | ||
92 | }; | ||
93 | |||
94 | static __init int s3c2412_pm_init(void) | ||
95 | { | ||
96 | return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); | ||
97 | } | ||
98 | |||
99 | arch_initcall(s3c2412_pm_init); | ||
100 | |||
101 | static int s3c2412_pm_suspend(void) | ||
90 | { | 102 | { |
91 | s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); | 103 | s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); |
92 | return 0; | 104 | return 0; |
93 | } | 105 | } |
94 | 106 | ||
95 | static int s3c2412_pm_resume(struct sys_device *dev) | 107 | static void s3c2412_pm_resume(void) |
96 | { | 108 | { |
97 | unsigned long tmp; | 109 | unsigned long tmp; |
98 | 110 | ||
@@ -102,18 +114,9 @@ static int s3c2412_pm_resume(struct sys_device *dev) | |||
102 | __raw_writel(tmp, S3C2412_PWRCFG); | 114 | __raw_writel(tmp, S3C2412_PWRCFG); |
103 | 115 | ||
104 | s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); | 116 | s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); |
105 | return 0; | ||
106 | } | 117 | } |
107 | 118 | ||
108 | static struct sysdev_driver s3c2412_pm_driver = { | 119 | struct syscore_ops s3c2412_pm_syscore_ops = { |
109 | .add = s3c2412_pm_add, | ||
110 | .suspend = s3c2412_pm_suspend, | 120 | .suspend = s3c2412_pm_suspend, |
111 | .resume = s3c2412_pm_resume, | 121 | .resume = s3c2412_pm_resume, |
112 | }; | 122 | }; |
113 | |||
114 | static __init int s3c2412_pm_init(void) | ||
115 | { | ||
116 | return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); | ||
117 | } | ||
118 | |||
119 | arch_initcall(s3c2412_pm_init); | ||
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c index 4c6df51ddf33..ef0958d3e5c6 100644 --- a/arch/arm/mach-s3c2412/s3c2412.c +++ b/arch/arm/mach-s3c2412/s3c2412.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/syscore_ops.h> | ||
22 | #include <linux/serial_core.h> | 23 | #include <linux/serial_core.h> |
23 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
@@ -244,5 +245,8 @@ int __init s3c2412_init(void) | |||
244 | { | 245 | { |
245 | printk("S3C2412: Initialising architecture\n"); | 246 | printk("S3C2412: Initialising architecture\n"); |
246 | 247 | ||
248 | register_syscore_ops(&s3c2412_pm_syscore_ops); | ||
249 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | ||
250 | |||
247 | return sysdev_register(&s3c2412_sysdev); | 251 | return sysdev_register(&s3c2412_sysdev); |
248 | } | 252 | } |
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c index 77b38f2381c1..28ad20d42445 100644 --- a/arch/arm/mach-s3c2416/irq.c +++ b/arch/arm/mach-s3c2416/irq.c | |||
@@ -236,8 +236,6 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev) | |||
236 | 236 | ||
237 | static struct sysdev_driver s3c2416_irq_driver = { | 237 | static struct sysdev_driver s3c2416_irq_driver = { |
238 | .add = s3c2416_irq_add, | 238 | .add = s3c2416_irq_add, |
239 | .suspend = s3c24xx_irq_suspend, | ||
240 | .resume = s3c24xx_irq_resume, | ||
241 | }; | 239 | }; |
242 | 240 | ||
243 | static int __init s3c2416_irq_init(void) | 241 | static int __init s3c2416_irq_init(void) |
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c index 4a04205b04d5..41db2b21e213 100644 --- a/arch/arm/mach-s3c2416/pm.c +++ b/arch/arm/mach-s3c2416/pm.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/sysdev.h> | 13 | #include <linux/sysdev.h> |
14 | #include <linux/syscore_ops.h> | ||
14 | #include <linux/io.h> | 15 | #include <linux/io.h> |
15 | 16 | ||
16 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
@@ -55,30 +56,26 @@ static int s3c2416_pm_add(struct sys_device *sysdev) | |||
55 | return 0; | 56 | return 0; |
56 | } | 57 | } |
57 | 58 | ||
58 | static int s3c2416_pm_suspend(struct sys_device *dev, pm_message_t state) | 59 | static struct sysdev_driver s3c2416_pm_driver = { |
60 | .add = s3c2416_pm_add, | ||
61 | }; | ||
62 | |||
63 | static __init int s3c2416_pm_init(void) | ||
59 | { | 64 | { |
60 | return 0; | 65 | return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver); |
61 | } | 66 | } |
62 | 67 | ||
63 | static int s3c2416_pm_resume(struct sys_device *dev) | 68 | arch_initcall(s3c2416_pm_init); |
69 | |||
70 | |||
71 | static void s3c2416_pm_resume(void) | ||
64 | { | 72 | { |
65 | /* unset the return-from-sleep amd inform flags */ | 73 | /* unset the return-from-sleep amd inform flags */ |
66 | __raw_writel(0x0, S3C2443_PWRMODE); | 74 | __raw_writel(0x0, S3C2443_PWRMODE); |
67 | __raw_writel(0x0, S3C2412_INFORM0); | 75 | __raw_writel(0x0, S3C2412_INFORM0); |
68 | __raw_writel(0x0, S3C2412_INFORM1); | 76 | __raw_writel(0x0, S3C2412_INFORM1); |
69 | |||
70 | return 0; | ||
71 | } | 77 | } |
72 | 78 | ||
73 | static struct sysdev_driver s3c2416_pm_driver = { | 79 | struct syscore_ops s3c2416_pm_syscore_ops = { |
74 | .add = s3c2416_pm_add, | ||
75 | .suspend = s3c2416_pm_suspend, | ||
76 | .resume = s3c2416_pm_resume, | 80 | .resume = s3c2416_pm_resume, |
77 | }; | 81 | }; |
78 | |||
79 | static __init int s3c2416_pm_init(void) | ||
80 | { | ||
81 | return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver); | ||
82 | } | ||
83 | |||
84 | arch_initcall(s3c2416_pm_init); | ||
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c index ba7fd8737434..494ce913dc95 100644 --- a/arch/arm/mach-s3c2416/s3c2416.c +++ b/arch/arm/mach-s3c2416/s3c2416.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <linux/serial_core.h> | 33 | #include <linux/serial_core.h> |
34 | #include <linux/sysdev.h> | 34 | #include <linux/sysdev.h> |
35 | #include <linux/syscore_ops.h> | ||
35 | #include <linux/clk.h> | 36 | #include <linux/clk.h> |
36 | #include <linux/io.h> | 37 | #include <linux/io.h> |
37 | 38 | ||
@@ -54,6 +55,7 @@ | |||
54 | #include <plat/devs.h> | 55 | #include <plat/devs.h> |
55 | #include <plat/cpu.h> | 56 | #include <plat/cpu.h> |
56 | #include <plat/sdhci.h> | 57 | #include <plat/sdhci.h> |
58 | #include <plat/pm.h> | ||
57 | 59 | ||
58 | #include <plat/iic-core.h> | 60 | #include <plat/iic-core.h> |
59 | #include <plat/fb-core.h> | 61 | #include <plat/fb-core.h> |
@@ -95,6 +97,9 @@ int __init s3c2416_init(void) | |||
95 | 97 | ||
96 | s3c_fb_setname("s3c2443-fb"); | 98 | s3c_fb_setname("s3c2443-fb"); |
97 | 99 | ||
100 | register_syscore_ops(&s3c2416_pm_syscore_ops); | ||
101 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | ||
102 | |||
98 | return sysdev_register(&s3c2416_sysdev); | 103 | return sysdev_register(&s3c2416_sysdev); |
99 | } | 104 | } |
100 | 105 | ||
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index 14dc67897757..d88536393310 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
@@ -284,7 +284,7 @@ static struct platform_device osiris_pcmcia = { | |||
284 | #ifdef CONFIG_PM | 284 | #ifdef CONFIG_PM |
285 | static unsigned char pm_osiris_ctrl0; | 285 | static unsigned char pm_osiris_ctrl0; |
286 | 286 | ||
287 | static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) | 287 | static int osiris_pm_suspend(void) |
288 | { | 288 | { |
289 | unsigned int tmp; | 289 | unsigned int tmp; |
290 | 290 | ||
@@ -304,7 +304,7 @@ static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) | |||
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
306 | 306 | ||
307 | static int osiris_pm_resume(struct sys_device *sd) | 307 | static void osiris_pm_resume(void) |
308 | { | 308 | { |
309 | if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) | 309 | if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) |
310 | __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); | 310 | __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); |
@@ -312,8 +312,6 @@ static int osiris_pm_resume(struct sys_device *sd) | |||
312 | __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); | 312 | __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); |
313 | 313 | ||
314 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); | 314 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); |
315 | |||
316 | return 0; | ||
317 | } | 315 | } |
318 | 316 | ||
319 | #else | 317 | #else |
@@ -321,16 +319,11 @@ static int osiris_pm_resume(struct sys_device *sd) | |||
321 | #define osiris_pm_resume NULL | 319 | #define osiris_pm_resume NULL |
322 | #endif | 320 | #endif |
323 | 321 | ||
324 | static struct sysdev_class osiris_pm_sysclass = { | 322 | static struct syscore_ops osiris_pm_syscore_ops = { |
325 | .name = "mach-osiris", | ||
326 | .suspend = osiris_pm_suspend, | 323 | .suspend = osiris_pm_suspend, |
327 | .resume = osiris_pm_resume, | 324 | .resume = osiris_pm_resume, |
328 | }; | 325 | }; |
329 | 326 | ||
330 | static struct sys_device osiris_pm_sysdev = { | ||
331 | .cls = &osiris_pm_sysclass, | ||
332 | }; | ||
333 | |||
334 | /* Link for DVS driver to TPS65011 */ | 327 | /* Link for DVS driver to TPS65011 */ |
335 | 328 | ||
336 | static void osiris_tps_release(struct device *dev) | 329 | static void osiris_tps_release(struct device *dev) |
@@ -439,8 +432,7 @@ static void __init osiris_map_io(void) | |||
439 | 432 | ||
440 | static void __init osiris_init(void) | 433 | static void __init osiris_init(void) |
441 | { | 434 | { |
442 | sysdev_class_register(&osiris_pm_sysclass); | 435 | register_syscore_ops(&osiris_pm_syscore_ops); |
443 | sysdev_register(&osiris_pm_sysdev); | ||
444 | 436 | ||
445 | s3c_i2c0_set_platdata(NULL); | 437 | s3c_i2c0_set_platdata(NULL); |
446 | s3c_nand_set_platdata(&osiris_nand_info); | 438 | s3c_nand_set_platdata(&osiris_nand_info); |
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c index f7663f731ea0..ce99ff72838d 100644 --- a/arch/arm/mach-s3c2440/s3c2440.c +++ b/arch/arm/mach-s3c2440/s3c2440.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/syscore_ops.h> | ||
22 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
23 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
@@ -33,6 +34,7 @@ | |||
33 | #include <plat/devs.h> | 34 | #include <plat/devs.h> |
34 | #include <plat/cpu.h> | 35 | #include <plat/cpu.h> |
35 | #include <plat/s3c244x.h> | 36 | #include <plat/s3c244x.h> |
37 | #include <plat/pm.h> | ||
36 | 38 | ||
37 | #include <plat/gpio-core.h> | 39 | #include <plat/gpio-core.h> |
38 | #include <plat/gpio-cfg.h> | 40 | #include <plat/gpio-cfg.h> |
@@ -51,6 +53,12 @@ int __init s3c2440_init(void) | |||
51 | s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; | 53 | s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; |
52 | s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT; | 54 | s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT; |
53 | 55 | ||
56 | /* register suspend/resume handlers */ | ||
57 | |||
58 | register_syscore_ops(&s3c2410_pm_syscore_ops); | ||
59 | register_syscore_ops(&s3c244x_pm_syscore_ops); | ||
60 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | ||
61 | |||
54 | /* register our system device for everything else */ | 62 | /* register our system device for everything else */ |
55 | 63 | ||
56 | return sysdev_register(&s3c2440_sysdev); | 64 | return sysdev_register(&s3c2440_sysdev); |
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c index ecf813546554..6224bad4d604 100644 --- a/arch/arm/mach-s3c2440/s3c2442.c +++ b/arch/arm/mach-s3c2440/s3c2442.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/err.h> | 29 | #include <linux/err.h> |
30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
31 | #include <linux/sysdev.h> | 31 | #include <linux/sysdev.h> |
32 | #include <linux/syscore_ops.h> | ||
32 | #include <linux/interrupt.h> | 33 | #include <linux/interrupt.h> |
33 | #include <linux/ioport.h> | 34 | #include <linux/ioport.h> |
34 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
@@ -45,6 +46,7 @@ | |||
45 | #include <plat/clock.h> | 46 | #include <plat/clock.h> |
46 | #include <plat/cpu.h> | 47 | #include <plat/cpu.h> |
47 | #include <plat/s3c244x.h> | 48 | #include <plat/s3c244x.h> |
49 | #include <plat/pm.h> | ||
48 | 50 | ||
49 | #include <plat/gpio-core.h> | 51 | #include <plat/gpio-core.h> |
50 | #include <plat/gpio-cfg.h> | 52 | #include <plat/gpio-cfg.h> |
@@ -167,6 +169,10 @@ int __init s3c2442_init(void) | |||
167 | { | 169 | { |
168 | printk("S3C2442: Initialising architecture\n"); | 170 | printk("S3C2442: Initialising architecture\n"); |
169 | 171 | ||
172 | register_syscore_ops(&s3c2410_pm_syscore_ops); | ||
173 | register_syscore_ops(&s3c244x_pm_syscore_ops); | ||
174 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | ||
175 | |||
170 | return sysdev_register(&s3c2442_sysdev); | 176 | return sysdev_register(&s3c2442_sysdev); |
171 | } | 177 | } |
172 | 178 | ||
diff --git a/arch/arm/mach-s3c2440/s3c244x-irq.c b/arch/arm/mach-s3c2440/s3c244x-irq.c index de07c2feaa32..c63e8f26d901 100644 --- a/arch/arm/mach-s3c2440/s3c244x-irq.c +++ b/arch/arm/mach-s3c2440/s3c244x-irq.c | |||
@@ -116,8 +116,6 @@ static int s3c244x_irq_add(struct sys_device *sysdev) | |||
116 | 116 | ||
117 | static struct sysdev_driver s3c2440_irq_driver = { | 117 | static struct sysdev_driver s3c2440_irq_driver = { |
118 | .add = s3c244x_irq_add, | 118 | .add = s3c244x_irq_add, |
119 | .suspend = s3c24xx_irq_suspend, | ||
120 | .resume = s3c24xx_irq_resume, | ||
121 | }; | 119 | }; |
122 | 120 | ||
123 | static int s3c2440_irq_init(void) | 121 | static int s3c2440_irq_init(void) |
@@ -129,8 +127,6 @@ arch_initcall(s3c2440_irq_init); | |||
129 | 127 | ||
130 | static struct sysdev_driver s3c2442_irq_driver = { | 128 | static struct sysdev_driver s3c2442_irq_driver = { |
131 | .add = s3c244x_irq_add, | 129 | .add = s3c244x_irq_add, |
132 | .suspend = s3c24xx_irq_suspend, | ||
133 | .resume = s3c24xx_irq_resume, | ||
134 | }; | 130 | }; |
135 | 131 | ||
136 | 132 | ||
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c index 90c1707b9c95..7e8a23d2098a 100644 --- a/arch/arm/mach-s3c2440/s3c244x.c +++ b/arch/arm/mach-s3c2440/s3c244x.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/serial_core.h> | 19 | #include <linux/serial_core.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/syscore_ops.h> | ||
22 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
24 | 25 | ||
@@ -134,45 +135,14 @@ void __init s3c244x_init_clocks(int xtal) | |||
134 | s3c2410_baseclk_add(); | 135 | s3c2410_baseclk_add(); |
135 | } | 136 | } |
136 | 137 | ||
137 | #ifdef CONFIG_PM | ||
138 | |||
139 | static struct sleep_save s3c244x_sleep[] = { | ||
140 | SAVE_ITEM(S3C2440_DSC0), | ||
141 | SAVE_ITEM(S3C2440_DSC1), | ||
142 | SAVE_ITEM(S3C2440_GPJDAT), | ||
143 | SAVE_ITEM(S3C2440_GPJCON), | ||
144 | SAVE_ITEM(S3C2440_GPJUP) | ||
145 | }; | ||
146 | |||
147 | static int s3c244x_suspend(struct sys_device *dev, pm_message_t state) | ||
148 | { | ||
149 | s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static int s3c244x_resume(struct sys_device *dev) | ||
154 | { | ||
155 | s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | #else | ||
160 | #define s3c244x_suspend NULL | ||
161 | #define s3c244x_resume NULL | ||
162 | #endif | ||
163 | |||
164 | /* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ | 138 | /* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ |
165 | 139 | ||
166 | struct sysdev_class s3c2440_sysclass = { | 140 | struct sysdev_class s3c2440_sysclass = { |
167 | .name = "s3c2440-core", | 141 | .name = "s3c2440-core", |
168 | .suspend = s3c244x_suspend, | ||
169 | .resume = s3c244x_resume | ||
170 | }; | 142 | }; |
171 | 143 | ||
172 | struct sysdev_class s3c2442_sysclass = { | 144 | struct sysdev_class s3c2442_sysclass = { |
173 | .name = "s3c2442-core", | 145 | .name = "s3c2442-core", |
174 | .suspend = s3c244x_suspend, | ||
175 | .resume = s3c244x_resume | ||
176 | }; | 146 | }; |
177 | 147 | ||
178 | /* need to register class before we actually register the device, and | 148 | /* need to register class before we actually register the device, and |
@@ -194,3 +164,33 @@ static int __init s3c2442_core_init(void) | |||
194 | } | 164 | } |
195 | 165 | ||
196 | core_initcall(s3c2442_core_init); | 166 | core_initcall(s3c2442_core_init); |
167 | |||
168 | |||
169 | #ifdef CONFIG_PM | ||
170 | static struct sleep_save s3c244x_sleep[] = { | ||
171 | SAVE_ITEM(S3C2440_DSC0), | ||
172 | SAVE_ITEM(S3C2440_DSC1), | ||
173 | SAVE_ITEM(S3C2440_GPJDAT), | ||
174 | SAVE_ITEM(S3C2440_GPJCON), | ||
175 | SAVE_ITEM(S3C2440_GPJUP) | ||
176 | }; | ||
177 | |||
178 | static int s3c244x_suspend(void) | ||
179 | { | ||
180 | s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | static void s3c244x_resume(void) | ||
185 | { | ||
186 | s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
187 | } | ||
188 | #else | ||
189 | #define s3c244x_suspend NULL | ||
190 | #define s3c244x_resume NULL | ||
191 | #endif | ||
192 | |||
193 | struct syscore_ops s3c244x_pm_syscore_ops = { | ||
194 | .suspend = s3c244x_suspend, | ||
195 | .resume = s3c244x_resume, | ||
196 | }; | ||
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c index da1bec64b9da..8bec61e242c7 100644 --- a/arch/arm/mach-s3c64xx/irq-pm.c +++ b/arch/arm/mach-s3c64xx/irq-pm.c | |||
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/sysdev.h> | 16 | #include <linux/syscore_ops.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/serial_core.h> | 18 | #include <linux/serial_core.h> |
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
@@ -54,7 +54,7 @@ static struct irq_grp_save { | |||
54 | 54 | ||
55 | static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; | 55 | static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; |
56 | 56 | ||
57 | static int s3c64xx_irq_pm_suspend(struct sys_device *dev, pm_message_t state) | 57 | static int s3c64xx_irq_pm_suspend(void) |
58 | { | 58 | { |
59 | struct irq_grp_save *grp = eint_grp_save; | 59 | struct irq_grp_save *grp = eint_grp_save; |
60 | int i; | 60 | int i; |
@@ -75,7 +75,7 @@ static int s3c64xx_irq_pm_suspend(struct sys_device *dev, pm_message_t state) | |||
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | static int s3c64xx_irq_pm_resume(struct sys_device *dev) | 78 | static void s3c64xx_irq_pm_resume(void) |
79 | { | 79 | { |
80 | struct irq_grp_save *grp = eint_grp_save; | 80 | struct irq_grp_save *grp = eint_grp_save; |
81 | int i; | 81 | int i; |
@@ -94,18 +94,18 @@ static int s3c64xx_irq_pm_resume(struct sys_device *dev) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | S3C_PMDBG("%s: IRQ configuration restored\n", __func__); | 96 | S3C_PMDBG("%s: IRQ configuration restored\n", __func__); |
97 | return 0; | ||
98 | } | 97 | } |
99 | 98 | ||
100 | static struct sysdev_driver s3c64xx_irq_driver = { | 99 | struct syscore_ops s3c64xx_irq_syscore_ops = { |
101 | .suspend = s3c64xx_irq_pm_suspend, | 100 | .suspend = s3c64xx_irq_pm_suspend, |
102 | .resume = s3c64xx_irq_pm_resume, | 101 | .resume = s3c64xx_irq_pm_resume, |
103 | }; | 102 | }; |
104 | 103 | ||
105 | static int __init s3c64xx_irq_pm_init(void) | 104 | static __init int s3c64xx_syscore_init(void) |
106 | { | 105 | { |
107 | return sysdev_driver_register(&s3c64xx_sysclass, &s3c64xx_irq_driver); | 106 | register_syscore_ops(&s3c64xx_irq_syscore_ops); |
108 | } | ||
109 | 107 | ||
110 | arch_initcall(s3c64xx_irq_pm_init); | 108 | return 0; |
109 | } | ||
111 | 110 | ||
111 | core_initcall(s3c64xx_syscore_init); | ||
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 549d7924fd4c..24febae3d4c0 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/suspend.h> | 18 | #include <linux/suspend.h> |
19 | #include <linux/syscore_ops.h> | ||
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
20 | 21 | ||
21 | #include <plat/cpu.h> | 22 | #include <plat/cpu.h> |
@@ -140,7 +141,17 @@ static int s5pv210_pm_add(struct sys_device *sysdev) | |||
140 | return 0; | 141 | return 0; |
141 | } | 142 | } |
142 | 143 | ||
143 | static int s5pv210_pm_resume(struct sys_device *dev) | 144 | static struct sysdev_driver s5pv210_pm_driver = { |
145 | .add = s5pv210_pm_add, | ||
146 | }; | ||
147 | |||
148 | static __init int s5pv210_pm_drvinit(void) | ||
149 | { | ||
150 | return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver); | ||
151 | } | ||
152 | arch_initcall(s5pv210_pm_drvinit); | ||
153 | |||
154 | static void s5pv210_pm_resume(void) | ||
144 | { | 155 | { |
145 | u32 tmp; | 156 | u32 tmp; |
146 | 157 | ||
@@ -150,17 +161,15 @@ static int s5pv210_pm_resume(struct sys_device *dev) | |||
150 | __raw_writel(tmp , S5P_OTHERS); | 161 | __raw_writel(tmp , S5P_OTHERS); |
151 | 162 | ||
152 | s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); | 163 | s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); |
153 | |||
154 | return 0; | ||
155 | } | 164 | } |
156 | 165 | ||
157 | static struct sysdev_driver s5pv210_pm_driver = { | 166 | static struct syscore_ops s5pv210_pm_syscore_ops = { |
158 | .add = s5pv210_pm_add, | ||
159 | .resume = s5pv210_pm_resume, | 167 | .resume = s5pv210_pm_resume, |
160 | }; | 168 | }; |
161 | 169 | ||
162 | static __init int s5pv210_pm_drvinit(void) | 170 | static __init int s5pv210_pm_syscore_init(void) |
163 | { | 171 | { |
164 | return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver); | 172 | register_syscore_ops(&s5pv210_pm_syscore_ops); |
173 | return 0; | ||
165 | } | 174 | } |
166 | arch_initcall(s5pv210_pm_drvinit); | 175 | arch_initcall(s5pv210_pm_syscore_init); |
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index 423ddb3d65e9..dfbf824a69fa 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
17 | #include <linux/sysdev.h> | 17 | #include <linux/syscore_ops.h> |
18 | 18 | ||
19 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
20 | #include <asm/mach/irq.h> | 20 | #include <asm/mach/irq.h> |
@@ -234,7 +234,7 @@ static struct sa1100irq_state { | |||
234 | unsigned int iccr; | 234 | unsigned int iccr; |
235 | } sa1100irq_state; | 235 | } sa1100irq_state; |
236 | 236 | ||
237 | static int sa1100irq_suspend(struct sys_device *dev, pm_message_t state) | 237 | static int sa1100irq_suspend(void) |
238 | { | 238 | { |
239 | struct sa1100irq_state *st = &sa1100irq_state; | 239 | struct sa1100irq_state *st = &sa1100irq_state; |
240 | 240 | ||
@@ -264,7 +264,7 @@ static int sa1100irq_suspend(struct sys_device *dev, pm_message_t state) | |||
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | static int sa1100irq_resume(struct sys_device *dev) | 267 | static void sa1100irq_resume(void) |
268 | { | 268 | { |
269 | struct sa1100irq_state *st = &sa1100irq_state; | 269 | struct sa1100irq_state *st = &sa1100irq_state; |
270 | 270 | ||
@@ -277,24 +277,17 @@ static int sa1100irq_resume(struct sys_device *dev) | |||
277 | 277 | ||
278 | ICMR = st->icmr; | 278 | ICMR = st->icmr; |
279 | } | 279 | } |
280 | return 0; | ||
281 | } | 280 | } |
282 | 281 | ||
283 | static struct sysdev_class sa1100irq_sysclass = { | 282 | static struct syscore_ops sa1100irq_syscore_ops = { |
284 | .name = "sa11x0-irq", | ||
285 | .suspend = sa1100irq_suspend, | 283 | .suspend = sa1100irq_suspend, |
286 | .resume = sa1100irq_resume, | 284 | .resume = sa1100irq_resume, |
287 | }; | 285 | }; |
288 | 286 | ||
289 | static struct sys_device sa1100irq_device = { | ||
290 | .id = 0, | ||
291 | .cls = &sa1100irq_sysclass, | ||
292 | }; | ||
293 | |||
294 | static int __init sa1100irq_init_devicefs(void) | 287 | static int __init sa1100irq_init_devicefs(void) |
295 | { | 288 | { |
296 | sysdev_class_register(&sa1100irq_sysclass); | 289 | register_syscore_ops(&sa1100irq_syscore_ops); |
297 | return sysdev_register(&sa1100irq_device); | 290 | return 0; |
298 | } | 291 | } |
299 | 292 | ||
300 | device_initcall(sa1100irq_init_devicefs); | 293 | device_initcall(sa1100irq_init_devicefs); |
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index d2adcdda23cf..bd9e32187eab 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
@@ -1372,9 +1372,7 @@ static const struct dev_pm_ops omap_mpuio_dev_pm_ops = { | |||
1372 | .resume_noirq = omap_mpuio_resume_noirq, | 1372 | .resume_noirq = omap_mpuio_resume_noirq, |
1373 | }; | 1373 | }; |
1374 | 1374 | ||
1375 | /* use platform_driver for this, now that there's no longer any | 1375 | /* use platform_driver for this. */ |
1376 | * point to sys_device (other than not disturbing old code). | ||
1377 | */ | ||
1378 | static struct platform_driver omap_mpuio_driver = { | 1376 | static struct platform_driver omap_mpuio_driver = { |
1379 | .driver = { | 1377 | .driver = { |
1380 | .name = "mpuio", | 1378 | .name = "mpuio", |
@@ -1745,7 +1743,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) | |||
1745 | } | 1743 | } |
1746 | 1744 | ||
1747 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) | 1745 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) |
1748 | static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) | 1746 | static int omap_gpio_suspend(void) |
1749 | { | 1747 | { |
1750 | int i; | 1748 | int i; |
1751 | 1749 | ||
@@ -1795,12 +1793,12 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) | |||
1795 | return 0; | 1793 | return 0; |
1796 | } | 1794 | } |
1797 | 1795 | ||
1798 | static int omap_gpio_resume(struct sys_device *dev) | 1796 | static void omap_gpio_resume(void) |
1799 | { | 1797 | { |
1800 | int i; | 1798 | int i; |
1801 | 1799 | ||
1802 | if (!cpu_class_is_omap2() && !cpu_is_omap16xx()) | 1800 | if (!cpu_class_is_omap2() && !cpu_is_omap16xx()) |
1803 | return 0; | 1801 | return; |
1804 | 1802 | ||
1805 | for (i = 0; i < gpio_bank_count; i++) { | 1803 | for (i = 0; i < gpio_bank_count; i++) { |
1806 | struct gpio_bank *bank = &gpio_bank[i]; | 1804 | struct gpio_bank *bank = &gpio_bank[i]; |
@@ -1836,21 +1834,13 @@ static int omap_gpio_resume(struct sys_device *dev) | |||
1836 | __raw_writel(bank->saved_wakeup, wake_set); | 1834 | __raw_writel(bank->saved_wakeup, wake_set); |
1837 | spin_unlock_irqrestore(&bank->lock, flags); | 1835 | spin_unlock_irqrestore(&bank->lock, flags); |
1838 | } | 1836 | } |
1839 | |||
1840 | return 0; | ||
1841 | } | 1837 | } |
1842 | 1838 | ||
1843 | static struct sysdev_class omap_gpio_sysclass = { | 1839 | static struct syscore_ops omap_gpio_syscore_ops = { |
1844 | .name = "gpio", | ||
1845 | .suspend = omap_gpio_suspend, | 1840 | .suspend = omap_gpio_suspend, |
1846 | .resume = omap_gpio_resume, | 1841 | .resume = omap_gpio_resume, |
1847 | }; | 1842 | }; |
1848 | 1843 | ||
1849 | static struct sys_device omap_gpio_device = { | ||
1850 | .id = 0, | ||
1851 | .cls = &omap_gpio_sysclass, | ||
1852 | }; | ||
1853 | |||
1854 | #endif | 1844 | #endif |
1855 | 1845 | ||
1856 | #ifdef CONFIG_ARCH_OMAP2PLUS | 1846 | #ifdef CONFIG_ARCH_OMAP2PLUS |
@@ -2108,21 +2098,14 @@ postcore_initcall(omap_gpio_drv_reg); | |||
2108 | 2098 | ||
2109 | static int __init omap_gpio_sysinit(void) | 2099 | static int __init omap_gpio_sysinit(void) |
2110 | { | 2100 | { |
2111 | int ret = 0; | ||
2112 | |||
2113 | mpuio_init(); | 2101 | mpuio_init(); |
2114 | 2102 | ||
2115 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) | 2103 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) |
2116 | if (cpu_is_omap16xx() || cpu_class_is_omap2()) { | 2104 | if (cpu_is_omap16xx() || cpu_class_is_omap2()) |
2117 | if (ret == 0) { | 2105 | register_syscore_ops(&omap_gpio_syscore_ops); |
2118 | ret = sysdev_class_register(&omap_gpio_sysclass); | ||
2119 | if (ret == 0) | ||
2120 | ret = sysdev_register(&omap_gpio_device); | ||
2121 | } | ||
2122 | } | ||
2123 | #endif | 2106 | #endif |
2124 | 2107 | ||
2125 | return ret; | 2108 | return 0; |
2126 | } | 2109 | } |
2127 | 2110 | ||
2128 | arch_initcall(omap_gpio_sysinit); | 2111 | arch_initcall(omap_gpio_sysinit); |
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c index dce088f45678..48ebb9479b61 100644 --- a/arch/arm/plat-pxa/gpio.c +++ b/arch/arm/plat-pxa/gpio.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/syscore_ops.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | 20 | ||
21 | #include <mach/gpio.h> | 21 | #include <mach/gpio.h> |
@@ -295,7 +295,7 @@ void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn) | |||
295 | } | 295 | } |
296 | 296 | ||
297 | #ifdef CONFIG_PM | 297 | #ifdef CONFIG_PM |
298 | static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state) | 298 | static int pxa_gpio_suspend(void) |
299 | { | 299 | { |
300 | struct pxa_gpio_chip *c; | 300 | struct pxa_gpio_chip *c; |
301 | int gpio; | 301 | int gpio; |
@@ -312,7 +312,7 @@ static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state) | |||
312 | return 0; | 312 | return 0; |
313 | } | 313 | } |
314 | 314 | ||
315 | static int pxa_gpio_resume(struct sys_device *dev) | 315 | static void pxa_gpio_resume(void) |
316 | { | 316 | { |
317 | struct pxa_gpio_chip *c; | 317 | struct pxa_gpio_chip *c; |
318 | int gpio; | 318 | int gpio; |
@@ -326,22 +326,13 @@ static int pxa_gpio_resume(struct sys_device *dev) | |||
326 | __raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET); | 326 | __raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET); |
327 | __raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET); | 327 | __raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET); |
328 | } | 328 | } |
329 | return 0; | ||
330 | } | 329 | } |
331 | #else | 330 | #else |
332 | #define pxa_gpio_suspend NULL | 331 | #define pxa_gpio_suspend NULL |
333 | #define pxa_gpio_resume NULL | 332 | #define pxa_gpio_resume NULL |
334 | #endif | 333 | #endif |
335 | 334 | ||
336 | struct sysdev_class pxa_gpio_sysclass = { | 335 | struct syscore_ops pxa_gpio_syscore_ops = { |
337 | .name = "gpio", | ||
338 | .suspend = pxa_gpio_suspend, | 336 | .suspend = pxa_gpio_suspend, |
339 | .resume = pxa_gpio_resume, | 337 | .resume = pxa_gpio_resume, |
340 | }; | 338 | }; |
341 | |||
342 | static int __init pxa_gpio_init(void) | ||
343 | { | ||
344 | return sysdev_class_register(&pxa_gpio_sysclass); | ||
345 | } | ||
346 | |||
347 | core_initcall(pxa_gpio_init); | ||
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c index a9aa5ad3f4eb..be12eadcce20 100644 --- a/arch/arm/plat-pxa/mfp.c +++ b/arch/arm/plat-pxa/mfp.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/sysdev.h> | ||
21 | 20 | ||
22 | #include <plat/mfp.h> | 21 | #include <plat/mfp.h> |
23 | 22 | ||
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c index 27ea852e3370..c10d10c56e2e 100644 --- a/arch/arm/plat-s3c24xx/dma.c +++ b/arch/arm/plat-s3c24xx/dma.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/syscore_ops.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
@@ -1195,19 +1195,12 @@ int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *d | |||
1195 | 1195 | ||
1196 | EXPORT_SYMBOL(s3c2410_dma_getposition); | 1196 | EXPORT_SYMBOL(s3c2410_dma_getposition); |
1197 | 1197 | ||
1198 | static inline struct s3c2410_dma_chan *to_dma_chan(struct sys_device *dev) | 1198 | /* system core operations */ |
1199 | { | ||
1200 | return container_of(dev, struct s3c2410_dma_chan, dev); | ||
1201 | } | ||
1202 | |||
1203 | /* system device class */ | ||
1204 | 1199 | ||
1205 | #ifdef CONFIG_PM | 1200 | #ifdef CONFIG_PM |
1206 | 1201 | ||
1207 | static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state) | 1202 | static void s3c2410_dma_suspend_chan(s3c2410_dma_chan *cp) |
1208 | { | 1203 | { |
1209 | struct s3c2410_dma_chan *cp = to_dma_chan(dev); | ||
1210 | |||
1211 | printk(KERN_DEBUG "suspending dma channel %d\n", cp->number); | 1204 | printk(KERN_DEBUG "suspending dma channel %d\n", cp->number); |
1212 | 1205 | ||
1213 | if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) { | 1206 | if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) { |
@@ -1222,13 +1215,21 @@ static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state) | |||
1222 | 1215 | ||
1223 | s3c2410_dma_dostop(cp); | 1216 | s3c2410_dma_dostop(cp); |
1224 | } | 1217 | } |
1218 | } | ||
1219 | |||
1220 | static int s3c2410_dma_suspend(void) | ||
1221 | { | ||
1222 | struct s3c2410_dma_chan *cp = s3c2410_chans; | ||
1223 | int channel; | ||
1224 | |||
1225 | for (channel = 0; channel < dma_channels; cp++, channel++) | ||
1226 | s3c2410_dma_suspend_chan(cp); | ||
1225 | 1227 | ||
1226 | return 0; | 1228 | return 0; |
1227 | } | 1229 | } |
1228 | 1230 | ||
1229 | static int s3c2410_dma_resume(struct sys_device *dev) | 1231 | static void s3c2410_dma_resume_chan(struct s3c2410_dma_chan *cp) |
1230 | { | 1232 | { |
1231 | struct s3c2410_dma_chan *cp = to_dma_chan(dev); | ||
1232 | unsigned int no = cp->number | DMACH_LOW_LEVEL; | 1233 | unsigned int no = cp->number | DMACH_LOW_LEVEL; |
1233 | 1234 | ||
1234 | /* restore channel's hardware configuration */ | 1235 | /* restore channel's hardware configuration */ |
@@ -1249,13 +1250,21 @@ static int s3c2410_dma_resume(struct sys_device *dev) | |||
1249 | return 0; | 1250 | return 0; |
1250 | } | 1251 | } |
1251 | 1252 | ||
1253 | static void s3c2410_dma_resume(void) | ||
1254 | { | ||
1255 | struct s3c2410_dma_chan *cp = s3c2410_chans + dma_channels - 1; | ||
1256 | int channel; | ||
1257 | |||
1258 | for (channel = dma_channels - 1; channel >= 0; cp++, channel--) | ||
1259 | s3c2410_dma_resume_chan(cp); | ||
1260 | } | ||
1261 | |||
1252 | #else | 1262 | #else |
1253 | #define s3c2410_dma_suspend NULL | 1263 | #define s3c2410_dma_suspend NULL |
1254 | #define s3c2410_dma_resume NULL | 1264 | #define s3c2410_dma_resume NULL |
1255 | #endif /* CONFIG_PM */ | 1265 | #endif /* CONFIG_PM */ |
1256 | 1266 | ||
1257 | struct sysdev_class dma_sysclass = { | 1267 | struct syscore_ops dma_syscore_ops = { |
1258 | .name = "s3c24xx-dma", | ||
1259 | .suspend = s3c2410_dma_suspend, | 1268 | .suspend = s3c2410_dma_suspend, |
1260 | .resume = s3c2410_dma_resume, | 1269 | .resume = s3c2410_dma_resume, |
1261 | }; | 1270 | }; |
@@ -1269,39 +1278,14 @@ static void s3c2410_dma_cache_ctor(void *p) | |||
1269 | 1278 | ||
1270 | /* initialisation code */ | 1279 | /* initialisation code */ |
1271 | 1280 | ||
1272 | static int __init s3c24xx_dma_sysclass_init(void) | 1281 | static int __init s3c24xx_dma_syscore_init(void) |
1273 | { | 1282 | { |
1274 | int ret = sysdev_class_register(&dma_sysclass); | 1283 | register_syscore_ops(&dma_syscore_ops); |
1275 | |||
1276 | if (ret != 0) | ||
1277 | printk(KERN_ERR "dma sysclass registration failed\n"); | ||
1278 | |||
1279 | return ret; | ||
1280 | } | ||
1281 | |||
1282 | core_initcall(s3c24xx_dma_sysclass_init); | ||
1283 | |||
1284 | static int __init s3c24xx_dma_sysdev_register(void) | ||
1285 | { | ||
1286 | struct s3c2410_dma_chan *cp = s3c2410_chans; | ||
1287 | int channel, ret; | ||
1288 | |||
1289 | for (channel = 0; channel < dma_channels; cp++, channel++) { | ||
1290 | cp->dev.cls = &dma_sysclass; | ||
1291 | cp->dev.id = channel; | ||
1292 | ret = sysdev_register(&cp->dev); | ||
1293 | |||
1294 | if (ret) { | ||
1295 | printk(KERN_ERR "error registering dev for dma %d\n", | ||
1296 | channel); | ||
1297 | return ret; | ||
1298 | } | ||
1299 | } | ||
1300 | 1284 | ||
1301 | return 0; | 1285 | return 0; |
1302 | } | 1286 | } |
1303 | 1287 | ||
1304 | late_initcall(s3c24xx_dma_sysdev_register); | 1288 | late_initcall(s3c24xx_dma_syscore_init); |
1305 | 1289 | ||
1306 | int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq, | 1290 | int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq, |
1307 | unsigned int stride) | 1291 | unsigned int stride) |
diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c index c3624d898630..0efb2e2848c8 100644 --- a/arch/arm/plat-s3c24xx/irq-pm.c +++ b/arch/arm/plat-s3c24xx/irq-pm.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/sysdev.h> | ||
18 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
19 | 18 | ||
20 | #include <plat/cpu.h> | 19 | #include <plat/cpu.h> |
@@ -65,7 +64,7 @@ static unsigned long save_extint[3]; | |||
65 | static unsigned long save_eintflt[4]; | 64 | static unsigned long save_eintflt[4]; |
66 | static unsigned long save_eintmask; | 65 | static unsigned long save_eintmask; |
67 | 66 | ||
68 | int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state) | 67 | int s3c24xx_irq_suspend(void) |
69 | { | 68 | { |
70 | unsigned int i; | 69 | unsigned int i; |
71 | 70 | ||
@@ -81,7 +80,7 @@ int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state) | |||
81 | return 0; | 80 | return 0; |
82 | } | 81 | } |
83 | 82 | ||
84 | int s3c24xx_irq_resume(struct sys_device *dev) | 83 | void s3c24xx_irq_resume(void) |
85 | { | 84 | { |
86 | unsigned int i; | 85 | unsigned int i; |
87 | 86 | ||
@@ -93,6 +92,4 @@ int s3c24xx_irq_resume(struct sys_device *dev) | |||
93 | 92 | ||
94 | s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); | 93 | s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); |
95 | __raw_writel(save_eintmask, S3C24XX_EINTMASK); | 94 | __raw_writel(save_eintmask, S3C24XX_EINTMASK); |
96 | |||
97 | return 0; | ||
98 | } | 95 | } |
diff --git a/arch/arm/plat-s5p/irq-pm.c b/arch/arm/plat-s5p/irq-pm.c index 5259ad458bc8..327acb3a4464 100644 --- a/arch/arm/plat-s5p/irq-pm.c +++ b/arch/arm/plat-s5p/irq-pm.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/sysdev.h> | ||
20 | 19 | ||
21 | #include <plat/cpu.h> | 20 | #include <plat/cpu.h> |
22 | #include <plat/irqs.h> | 21 | #include <plat/irqs.h> |
@@ -77,17 +76,15 @@ static struct sleep_save eint_save[] = { | |||
77 | SAVE_ITEM(S5P_EINT_MASK(3)), | 76 | SAVE_ITEM(S5P_EINT_MASK(3)), |
78 | }; | 77 | }; |
79 | 78 | ||
80 | int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state) | 79 | int s3c24xx_irq_suspend(void) |
81 | { | 80 | { |
82 | s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save)); | 81 | s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save)); |
83 | 82 | ||
84 | return 0; | 83 | return 0; |
85 | } | 84 | } |
86 | 85 | ||
87 | int s3c24xx_irq_resume(struct sys_device *dev) | 86 | void s3c24xx_irq_resume(void) |
88 | { | 87 | { |
89 | s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save)); | 88 | s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save)); |
90 | |||
91 | return 0; | ||
92 | } | 89 | } |
93 | 90 | ||
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index cedfff51c82b..3aedac0034ba 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h | |||
@@ -68,6 +68,12 @@ extern void s3c24xx_init_uartdevs(char *name, | |||
68 | struct sys_timer; | 68 | struct sys_timer; |
69 | extern struct sys_timer s3c24xx_timer; | 69 | extern struct sys_timer s3c24xx_timer; |
70 | 70 | ||
71 | extern struct syscore_ops s3c2410_pm_syscore_ops; | ||
72 | extern struct syscore_ops s3c2412_pm_syscore_ops; | ||
73 | extern struct syscore_ops s3c2416_pm_syscore_ops; | ||
74 | extern struct syscore_ops s3c244x_pm_syscore_ops; | ||
75 | extern struct syscore_ops s3c64xx_irq_syscore_ops; | ||
76 | |||
71 | /* system device classes */ | 77 | /* system device classes */ |
72 | 78 | ||
73 | extern struct sysdev_class s3c2410_sysclass; | 79 | extern struct sysdev_class s3c2410_sysclass; |
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h index 937cc2ace517..7fb6f6be8c81 100644 --- a/arch/arm/plat-samsung/include/plat/pm.h +++ b/arch/arm/plat-samsung/include/plat/pm.h | |||
@@ -103,14 +103,16 @@ extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); | |||
103 | 103 | ||
104 | #ifdef CONFIG_PM | 104 | #ifdef CONFIG_PM |
105 | extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); | 105 | extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); |
106 | extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); | 106 | extern int s3c24xx_irq_suspend(void); |
107 | extern int s3c24xx_irq_resume(struct sys_device *dev); | 107 | extern void s3c24xx_irq_resume(void); |
108 | #else | 108 | #else |
109 | #define s3c_irqext_wake NULL | 109 | #define s3c_irqext_wake NULL |
110 | #define s3c24xx_irq_suspend NULL | 110 | #define s3c24xx_irq_suspend NULL |
111 | #define s3c24xx_irq_resume NULL | 111 | #define s3c24xx_irq_resume NULL |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | extern struct syscore_ops s3c24xx_irq_syscore_ops; | ||
115 | |||
114 | /* PM debug functions */ | 116 | /* PM debug functions */ |
115 | 117 | ||
116 | #ifdef CONFIG_SAMSUNG_PM_DEBUG | 118 | #ifdef CONFIG_SAMSUNG_PM_DEBUG |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index f74695075e64..f25e7ec89416 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -398,9 +398,9 @@ static void vfp_enable(void *unused) | |||
398 | } | 398 | } |
399 | 399 | ||
400 | #ifdef CONFIG_PM | 400 | #ifdef CONFIG_PM |
401 | #include <linux/sysdev.h> | 401 | #include <linux/syscore_ops.h> |
402 | 402 | ||
403 | static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state) | 403 | static int vfp_pm_suspend(void) |
404 | { | 404 | { |
405 | struct thread_info *ti = current_thread_info(); | 405 | struct thread_info *ti = current_thread_info(); |
406 | u32 fpexc = fmrx(FPEXC); | 406 | u32 fpexc = fmrx(FPEXC); |
@@ -420,34 +420,25 @@ static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state) | |||
420 | return 0; | 420 | return 0; |
421 | } | 421 | } |
422 | 422 | ||
423 | static int vfp_pm_resume(struct sys_device *dev) | 423 | static void vfp_pm_resume(void) |
424 | { | 424 | { |
425 | /* ensure we have access to the vfp */ | 425 | /* ensure we have access to the vfp */ |
426 | vfp_enable(NULL); | 426 | vfp_enable(NULL); |
427 | 427 | ||
428 | /* and disable it to ensure the next usage restores the state */ | 428 | /* and disable it to ensure the next usage restores the state */ |
429 | fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); | 429 | fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); |
430 | |||
431 | return 0; | ||
432 | } | 430 | } |
433 | 431 | ||
434 | static struct sysdev_class vfp_pm_sysclass = { | 432 | static struct syscore_ops vfp_pm_syscore_ops = { |
435 | .name = "vfp", | ||
436 | .suspend = vfp_pm_suspend, | 433 | .suspend = vfp_pm_suspend, |
437 | .resume = vfp_pm_resume, | 434 | .resume = vfp_pm_resume, |
438 | }; | 435 | }; |
439 | 436 | ||
440 | static struct sys_device vfp_pm_sysdev = { | ||
441 | .cls = &vfp_pm_sysclass, | ||
442 | }; | ||
443 | |||
444 | static void vfp_pm_init(void) | 437 | static void vfp_pm_init(void) |
445 | { | 438 | { |
446 | sysdev_class_register(&vfp_pm_sysclass); | 439 | register_syscore_ops(&vfp_pm_syscore_ops); |
447 | sysdev_register(&vfp_pm_sysdev); | ||
448 | } | 440 | } |
449 | 441 | ||
450 | |||
451 | #else | 442 | #else |
452 | static inline void vfp_pm_init(void) { } | 443 | static inline void vfp_pm_init(void) { } |
453 | #endif /* CONFIG_PM */ | 444 | #endif /* CONFIG_PM */ |
diff --git a/arch/avr32/mach-at32ap/intc.c b/arch/avr32/mach-at32ap/intc.c index 21ce35f33aa5..3e3646186c9f 100644 --- a/arch/avr32/mach-at32ap/intc.c +++ b/arch/avr32/mach-at32ap/intc.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/sysdev.h> | 15 | #include <linux/syscore_ops.h> |
16 | 16 | ||
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | 18 | ||
@@ -21,7 +21,6 @@ | |||
21 | struct intc { | 21 | struct intc { |
22 | void __iomem *regs; | 22 | void __iomem *regs; |
23 | struct irq_chip chip; | 23 | struct irq_chip chip; |
24 | struct sys_device sysdev; | ||
25 | #ifdef CONFIG_PM | 24 | #ifdef CONFIG_PM |
26 | unsigned long suspend_ipr; | 25 | unsigned long suspend_ipr; |
27 | unsigned long saved_ipr[64]; | 26 | unsigned long saved_ipr[64]; |
@@ -146,9 +145,8 @@ void intc_set_suspend_handler(unsigned long offset) | |||
146 | intc0.suspend_ipr = offset; | 145 | intc0.suspend_ipr = offset; |
147 | } | 146 | } |
148 | 147 | ||
149 | static int intc_suspend(struct sys_device *sdev, pm_message_t state) | 148 | static int intc_suspend(void) |
150 | { | 149 | { |
151 | struct intc *intc = container_of(sdev, struct intc, sysdev); | ||
152 | int i; | 150 | int i; |
153 | 151 | ||
154 | if (unlikely(!irqs_disabled())) { | 152 | if (unlikely(!irqs_disabled())) { |
@@ -156,28 +154,25 @@ static int intc_suspend(struct sys_device *sdev, pm_message_t state) | |||
156 | return -EINVAL; | 154 | return -EINVAL; |
157 | } | 155 | } |
158 | 156 | ||
159 | if (unlikely(!intc->suspend_ipr)) { | 157 | if (unlikely(!intc0.suspend_ipr)) { |
160 | pr_err("intc_suspend: suspend_ipr not initialized\n"); | 158 | pr_err("intc_suspend: suspend_ipr not initialized\n"); |
161 | return -EINVAL; | 159 | return -EINVAL; |
162 | } | 160 | } |
163 | 161 | ||
164 | for (i = 0; i < 64; i++) { | 162 | for (i = 0; i < 64; i++) { |
165 | intc->saved_ipr[i] = intc_readl(intc, INTPR0 + 4 * i); | 163 | intc0.saved_ipr[i] = intc_readl(&intc0, INTPR0 + 4 * i); |
166 | intc_writel(intc, INTPR0 + 4 * i, intc->suspend_ipr); | 164 | intc_writel(&intc0, INTPR0 + 4 * i, intc0.suspend_ipr); |
167 | } | 165 | } |
168 | 166 | ||
169 | return 0; | 167 | return 0; |
170 | } | 168 | } |
171 | 169 | ||
172 | static int intc_resume(struct sys_device *sdev) | 170 | static int intc_resume(void) |
173 | { | 171 | { |
174 | struct intc *intc = container_of(sdev, struct intc, sysdev); | ||
175 | int i; | 172 | int i; |
176 | 173 | ||
177 | WARN_ON(!irqs_disabled()); | ||
178 | |||
179 | for (i = 0; i < 64; i++) | 174 | for (i = 0; i < 64; i++) |
180 | intc_writel(intc, INTPR0 + 4 * i, intc->saved_ipr[i]); | 175 | intc_writel(&intc0, INTPR0 + 4 * i, intc0.saved_ipr[i]); |
181 | 176 | ||
182 | return 0; | 177 | return 0; |
183 | } | 178 | } |
@@ -186,27 +181,18 @@ static int intc_resume(struct sys_device *sdev) | |||
186 | #define intc_resume NULL | 181 | #define intc_resume NULL |
187 | #endif | 182 | #endif |
188 | 183 | ||
189 | static struct sysdev_class intc_class = { | 184 | static struct syscore_ops intc_syscore_ops = { |
190 | .name = "intc", | ||
191 | .suspend = intc_suspend, | 185 | .suspend = intc_suspend, |
192 | .resume = intc_resume, | 186 | .resume = intc_resume, |
193 | }; | 187 | }; |
194 | 188 | ||
195 | static int __init intc_init_sysdev(void) | 189 | static int __init intc_init_syscore(void) |
196 | { | 190 | { |
197 | int ret; | 191 | register_syscore_ops(&intc_syscore_ops); |
198 | |||
199 | ret = sysdev_class_register(&intc_class); | ||
200 | if (ret) | ||
201 | return ret; | ||
202 | 192 | ||
203 | intc0.sysdev.id = 0; | 193 | return 0; |
204 | intc0.sysdev.cls = &intc_class; | ||
205 | ret = sysdev_register(&intc0.sysdev); | ||
206 | |||
207 | return ret; | ||
208 | } | 194 | } |
209 | device_initcall(intc_init_sysdev); | 195 | device_initcall(intc_init_syscore); |
210 | 196 | ||
211 | unsigned long intc_get_pending(unsigned int group) | 197 | unsigned long intc_get_pending(unsigned int group) |
212 | { | 198 | { |
diff --git a/arch/blackfin/kernel/nmi.c b/arch/blackfin/kernel/nmi.c index 0b5f72f17fd0..401eb1d8e3b4 100644 --- a/arch/blackfin/kernel/nmi.c +++ b/arch/blackfin/kernel/nmi.c | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
14 | #include <linux/hardirq.h> | 14 | #include <linux/hardirq.h> |
15 | #include <linux/sysdev.h> | 15 | #include <linux/syscore_ops.h> |
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/nmi.h> | 17 | #include <linux/nmi.h> |
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
@@ -196,43 +196,31 @@ void touch_nmi_watchdog(void) | |||
196 | 196 | ||
197 | /* Suspend/resume support */ | 197 | /* Suspend/resume support */ |
198 | #ifdef CONFIG_PM | 198 | #ifdef CONFIG_PM |
199 | static int nmi_wdt_suspend(struct sys_device *dev, pm_message_t state) | 199 | static int nmi_wdt_suspend(void) |
200 | { | 200 | { |
201 | nmi_wdt_stop(); | 201 | nmi_wdt_stop(); |
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int nmi_wdt_resume(struct sys_device *dev) | 205 | static void nmi_wdt_resume(void) |
206 | { | 206 | { |
207 | if (nmi_active) | 207 | if (nmi_active) |
208 | nmi_wdt_start(); | 208 | nmi_wdt_start(); |
209 | return 0; | ||
210 | } | 209 | } |
211 | 210 | ||
212 | static struct sysdev_class nmi_sysclass = { | 211 | static struct syscore_ops nmi_syscore_ops = { |
213 | .name = DRV_NAME, | ||
214 | .resume = nmi_wdt_resume, | 212 | .resume = nmi_wdt_resume, |
215 | .suspend = nmi_wdt_suspend, | 213 | .suspend = nmi_wdt_suspend, |
216 | }; | 214 | }; |
217 | 215 | ||
218 | static struct sys_device device_nmi_wdt = { | 216 | static int __init init_nmi_wdt_syscore(void) |
219 | .id = 0, | ||
220 | .cls = &nmi_sysclass, | ||
221 | }; | ||
222 | |||
223 | static int __init init_nmi_wdt_sysfs(void) | ||
224 | { | 217 | { |
225 | int error; | 218 | if (nmi_active) |
226 | 219 | register_syscore_ops(&nmi_syscore_ops); | |
227 | if (!nmi_active) | ||
228 | return 0; | ||
229 | 220 | ||
230 | error = sysdev_class_register(&nmi_sysclass); | 221 | return 0; |
231 | if (!error) | ||
232 | error = sysdev_register(&device_nmi_wdt); | ||
233 | return error; | ||
234 | } | 222 | } |
235 | late_initcall(init_nmi_wdt_sysfs); | 223 | late_initcall(init_nmi_wdt_syscore); |
236 | 224 | ||
237 | #endif /* CONFIG_PM */ | 225 | #endif /* CONFIG_PM */ |
238 | 226 | ||
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index 7005ee0b074d..49baddcdd14e 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h | |||
@@ -3,7 +3,6 @@ | |||
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <linux/irq.h> | 5 | #include <linux/irq.h> |
6 | #include <linux/sysdev.h> | ||
7 | #include <asm/dcr.h> | 6 | #include <asm/dcr.h> |
8 | #include <asm/msi_bitmap.h> | 7 | #include <asm/msi_bitmap.h> |
9 | 8 | ||
@@ -320,8 +319,6 @@ struct mpic | |||
320 | /* link */ | 319 | /* link */ |
321 | struct mpic *next; | 320 | struct mpic *next; |
322 | 321 | ||
323 | struct sys_device sysdev; | ||
324 | |||
325 | #ifdef CONFIG_PM | 322 | #ifdef CONFIG_PM |
326 | struct mpic_irq_save *save_data; | 323 | struct mpic_irq_save *save_data; |
327 | #endif | 324 | #endif |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index acfaccea5f4f..3675da73623f 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
34 | #include <linux/linux_logo.h> | 34 | #include <linux/linux_logo.h> |
35 | #include <linux/syscore_ops.h> | ||
35 | #include <asm/spu.h> | 36 | #include <asm/spu.h> |
36 | #include <asm/spu_priv1.h> | 37 | #include <asm/spu_priv1.h> |
37 | #include <asm/spu_csa.h> | 38 | #include <asm/spu_csa.h> |
@@ -521,18 +522,8 @@ void spu_init_channels(struct spu *spu) | |||
521 | } | 522 | } |
522 | EXPORT_SYMBOL_GPL(spu_init_channels); | 523 | EXPORT_SYMBOL_GPL(spu_init_channels); |
523 | 524 | ||
524 | static int spu_shutdown(struct sys_device *sysdev) | ||
525 | { | ||
526 | struct spu *spu = container_of(sysdev, struct spu, sysdev); | ||
527 | |||
528 | spu_free_irqs(spu); | ||
529 | spu_destroy_spu(spu); | ||
530 | return 0; | ||
531 | } | ||
532 | |||
533 | static struct sysdev_class spu_sysdev_class = { | 525 | static struct sysdev_class spu_sysdev_class = { |
534 | .name = "spu", | 526 | .name = "spu", |
535 | .shutdown = spu_shutdown, | ||
536 | }; | 527 | }; |
537 | 528 | ||
538 | int spu_add_sysdev_attr(struct sysdev_attribute *attr) | 529 | int spu_add_sysdev_attr(struct sysdev_attribute *attr) |
@@ -797,6 +788,22 @@ static inline void crash_register_spus(struct list_head *list) | |||
797 | } | 788 | } |
798 | #endif | 789 | #endif |
799 | 790 | ||
791 | static void spu_shutdown(void) | ||
792 | { | ||
793 | struct spu *spu; | ||
794 | |||
795 | mutex_lock(&spu_full_list_mutex); | ||
796 | list_for_each_entry(spu, &spu_full_list, full_list) { | ||
797 | spu_free_irqs(spu); | ||
798 | spu_destroy_spu(spu); | ||
799 | } | ||
800 | mutex_unlock(&spu_full_list_mutex); | ||
801 | } | ||
802 | |||
803 | static struct syscore_ops spu_syscore_ops = { | ||
804 | .shutdown = spu_shutdown, | ||
805 | }; | ||
806 | |||
800 | static int __init init_spu_base(void) | 807 | static int __init init_spu_base(void) |
801 | { | 808 | { |
802 | int i, ret = 0; | 809 | int i, ret = 0; |
@@ -830,6 +837,7 @@ static int __init init_spu_base(void) | |||
830 | crash_register_spus(&spu_full_list); | 837 | crash_register_spus(&spu_full_list); |
831 | mutex_unlock(&spu_full_list_mutex); | 838 | mutex_unlock(&spu_full_list_mutex); |
832 | spu_add_sysdev_attr(&attr_stat); | 839 | spu_add_sysdev_attr(&attr_stat); |
840 | register_syscore_ops(&spu_syscore_ops); | ||
833 | 841 | ||
834 | spu_init_affinity(); | 842 | spu_init_affinity(); |
835 | 843 | ||
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 023f24086a0a..7c18a1607d1c 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/signal.h> | 21 | #include <linux/signal.h> |
22 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/sysdev.h> | 24 | #include <linux/syscore_ops.h> |
25 | #include <linux/adb.h> | 25 | #include <linux/adb.h> |
26 | #include <linux/pmu.h> | 26 | #include <linux/pmu.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
@@ -677,7 +677,7 @@ not_found: | |||
677 | return viaint; | 677 | return viaint; |
678 | } | 678 | } |
679 | 679 | ||
680 | static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state) | 680 | static int pmacpic_suspend(void) |
681 | { | 681 | { |
682 | int viaint = pmacpic_find_viaint(); | 682 | int viaint = pmacpic_find_viaint(); |
683 | 683 | ||
@@ -698,7 +698,7 @@ static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state) | |||
698 | return 0; | 698 | return 0; |
699 | } | 699 | } |
700 | 700 | ||
701 | static int pmacpic_resume(struct sys_device *sysdev) | 701 | static void pmacpic_resume(void) |
702 | { | 702 | { |
703 | int i; | 703 | int i; |
704 | 704 | ||
@@ -709,39 +709,19 @@ static int pmacpic_resume(struct sys_device *sysdev) | |||
709 | for (i = 0; i < max_real_irqs; ++i) | 709 | for (i = 0; i < max_real_irqs; ++i) |
710 | if (test_bit(i, sleep_save_mask)) | 710 | if (test_bit(i, sleep_save_mask)) |
711 | pmac_unmask_irq(irq_get_irq_data(i)); | 711 | pmac_unmask_irq(irq_get_irq_data(i)); |
712 | |||
713 | return 0; | ||
714 | } | 712 | } |
715 | 713 | ||
716 | #endif /* CONFIG_PM && CONFIG_PPC32 */ | 714 | static struct syscore_ops pmacpic_syscore_ops = { |
717 | 715 | .suspend = pmacpic_suspend, | |
718 | static struct sysdev_class pmacpic_sysclass = { | 716 | .resume = pmacpic_resume, |
719 | .name = "pmac_pic", | ||
720 | }; | 717 | }; |
721 | 718 | ||
722 | static struct sys_device device_pmacpic = { | 719 | static int __init init_pmacpic_syscore(void) |
723 | .id = 0, | ||
724 | .cls = &pmacpic_sysclass, | ||
725 | }; | ||
726 | |||
727 | static struct sysdev_driver driver_pmacpic = { | ||
728 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) | ||
729 | .suspend = &pmacpic_suspend, | ||
730 | .resume = &pmacpic_resume, | ||
731 | #endif /* CONFIG_PM && CONFIG_PPC32 */ | ||
732 | }; | ||
733 | |||
734 | static int __init init_pmacpic_sysfs(void) | ||
735 | { | 720 | { |
736 | #ifdef CONFIG_PPC32 | 721 | register_syscore_ops(&pmacpic_syscore_ops); |
737 | if (max_irqs == 0) | ||
738 | return -ENODEV; | ||
739 | #endif | ||
740 | printk(KERN_DEBUG "Registering pmac pic with sysfs...\n"); | ||
741 | sysdev_class_register(&pmacpic_sysclass); | ||
742 | sysdev_register(&device_pmacpic); | ||
743 | sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic); | ||
744 | return 0; | 722 | return 0; |
745 | } | 723 | } |
746 | machine_subsys_initcall(powermac, init_pmacpic_sysfs); | ||
747 | 724 | ||
725 | machine_subsys_initcall(powermac, init_pmacpic_syscore); | ||
726 | |||
727 | #endif /* CONFIG_PM && CONFIG_PPC32 */ | ||
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index fa438be962b7..596554a8725e 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/syscore_ops.h> |
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
@@ -902,7 +902,7 @@ static struct { | |||
902 | u32 sercr; | 902 | u32 sercr; |
903 | } ipic_saved_state; | 903 | } ipic_saved_state; |
904 | 904 | ||
905 | static int ipic_suspend(struct sys_device *sdev, pm_message_t state) | 905 | static int ipic_suspend(void) |
906 | { | 906 | { |
907 | struct ipic *ipic = primary_ipic; | 907 | struct ipic *ipic = primary_ipic; |
908 | 908 | ||
@@ -933,7 +933,7 @@ static int ipic_suspend(struct sys_device *sdev, pm_message_t state) | |||
933 | return 0; | 933 | return 0; |
934 | } | 934 | } |
935 | 935 | ||
936 | static int ipic_resume(struct sys_device *sdev) | 936 | static void ipic_resume(void) |
937 | { | 937 | { |
938 | struct ipic *ipic = primary_ipic; | 938 | struct ipic *ipic = primary_ipic; |
939 | 939 | ||
@@ -949,44 +949,26 @@ static int ipic_resume(struct sys_device *sdev) | |||
949 | ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr); | 949 | ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr); |
950 | ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr); | 950 | ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr); |
951 | ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr); | 951 | ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr); |
952 | |||
953 | return 0; | ||
954 | } | 952 | } |
955 | #else | 953 | #else |
956 | #define ipic_suspend NULL | 954 | #define ipic_suspend NULL |
957 | #define ipic_resume NULL | 955 | #define ipic_resume NULL |
958 | #endif | 956 | #endif |
959 | 957 | ||
960 | static struct sysdev_class ipic_sysclass = { | 958 | static struct syscore_ops ipic_syscore_ops = { |
961 | .name = "ipic", | ||
962 | .suspend = ipic_suspend, | 959 | .suspend = ipic_suspend, |
963 | .resume = ipic_resume, | 960 | .resume = ipic_resume, |
964 | }; | 961 | }; |
965 | 962 | ||
966 | static struct sys_device device_ipic = { | 963 | static int __init init_ipic_syscore(void) |
967 | .id = 0, | ||
968 | .cls = &ipic_sysclass, | ||
969 | }; | ||
970 | |||
971 | static int __init init_ipic_sysfs(void) | ||
972 | { | 964 | { |
973 | int rc; | ||
974 | |||
975 | if (!primary_ipic || !primary_ipic->regs) | 965 | if (!primary_ipic || !primary_ipic->regs) |
976 | return -ENODEV; | 966 | return -ENODEV; |
977 | printk(KERN_DEBUG "Registering ipic with sysfs...\n"); | ||
978 | 967 | ||
979 | rc = sysdev_class_register(&ipic_sysclass); | 968 | printk(KERN_DEBUG "Registering ipic system core operations\n"); |
980 | if (rc) { | 969 | register_syscore_ops(&ipic_syscore_ops); |
981 | printk(KERN_ERR "Failed registering ipic sys class\n"); | 970 | |
982 | return -ENODEV; | ||
983 | } | ||
984 | rc = sysdev_register(&device_ipic); | ||
985 | if (rc) { | ||
986 | printk(KERN_ERR "Failed registering ipic sys device\n"); | ||
987 | return -ENODEV; | ||
988 | } | ||
989 | return 0; | 971 | return 0; |
990 | } | 972 | } |
991 | 973 | ||
992 | subsys_initcall(init_ipic_sysfs); | 974 | subsys_initcall(init_ipic_syscore); |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index f91c065bed5a..7e5dc8f4984a 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/syscore_ops.h> | ||
30 | 31 | ||
31 | #include <asm/ptrace.h> | 32 | #include <asm/ptrace.h> |
32 | #include <asm/signal.h> | 33 | #include <asm/signal.h> |
@@ -1702,9 +1703,8 @@ void mpic_reset_core(int cpu) | |||
1702 | #endif /* CONFIG_SMP */ | 1703 | #endif /* CONFIG_SMP */ |
1703 | 1704 | ||
1704 | #ifdef CONFIG_PM | 1705 | #ifdef CONFIG_PM |
1705 | static int mpic_suspend(struct sys_device *dev, pm_message_t state) | 1706 | static void mpic_suspend_one(struct mpic *mpic) |
1706 | { | 1707 | { |
1707 | struct mpic *mpic = container_of(dev, struct mpic, sysdev); | ||
1708 | int i; | 1708 | int i; |
1709 | 1709 | ||
1710 | for (i = 0; i < mpic->num_sources; i++) { | 1710 | for (i = 0; i < mpic->num_sources; i++) { |
@@ -1713,13 +1713,22 @@ static int mpic_suspend(struct sys_device *dev, pm_message_t state) | |||
1713 | mpic->save_data[i].dest = | 1713 | mpic->save_data[i].dest = |
1714 | mpic_irq_read(i, MPIC_INFO(IRQ_DESTINATION)); | 1714 | mpic_irq_read(i, MPIC_INFO(IRQ_DESTINATION)); |
1715 | } | 1715 | } |
1716 | } | ||
1717 | |||
1718 | static int mpic_suspend(void) | ||
1719 | { | ||
1720 | struct mpic *mpic = mpics; | ||
1721 | |||
1722 | while (mpic) { | ||
1723 | mpic_suspend_one(mpic); | ||
1724 | mpic = mpic->next; | ||
1725 | } | ||
1716 | 1726 | ||
1717 | return 0; | 1727 | return 0; |
1718 | } | 1728 | } |
1719 | 1729 | ||
1720 | static int mpic_resume(struct sys_device *dev) | 1730 | static void mpic_resume_one(struct mpic *mpic) |
1721 | { | 1731 | { |
1722 | struct mpic *mpic = container_of(dev, struct mpic, sysdev); | ||
1723 | int i; | 1732 | int i; |
1724 | 1733 | ||
1725 | for (i = 0; i < mpic->num_sources; i++) { | 1734 | for (i = 0; i < mpic->num_sources; i++) { |
@@ -1746,33 +1755,28 @@ static int mpic_resume(struct sys_device *dev) | |||
1746 | } | 1755 | } |
1747 | #endif | 1756 | #endif |
1748 | } /* end for loop */ | 1757 | } /* end for loop */ |
1758 | } | ||
1749 | 1759 | ||
1750 | return 0; | 1760 | static void mpic_resume(void) |
1761 | { | ||
1762 | struct mpic *mpic = mpics; | ||
1763 | |||
1764 | while (mpic) { | ||
1765 | mpic_resume_one(mpic); | ||
1766 | mpic = mpic->next; | ||
1767 | } | ||
1751 | } | 1768 | } |
1752 | #endif | ||
1753 | 1769 | ||
1754 | static struct sysdev_class mpic_sysclass = { | 1770 | static struct syscore_ops mpic_syscore_ops = { |
1755 | #ifdef CONFIG_PM | ||
1756 | .resume = mpic_resume, | 1771 | .resume = mpic_resume, |
1757 | .suspend = mpic_suspend, | 1772 | .suspend = mpic_suspend, |
1758 | #endif | ||
1759 | .name = "mpic", | ||
1760 | }; | 1773 | }; |
1761 | 1774 | ||
1762 | static int mpic_init_sys(void) | 1775 | static int mpic_init_sys(void) |
1763 | { | 1776 | { |
1764 | struct mpic *mpic = mpics; | 1777 | register_syscore_ops(&mpic_syscore_ops); |
1765 | int error, id = 0; | 1778 | return 0; |
1766 | |||
1767 | error = sysdev_class_register(&mpic_sysclass); | ||
1768 | |||
1769 | while (mpic && !error) { | ||
1770 | mpic->sysdev.cls = &mpic_sysclass; | ||
1771 | mpic->sysdev.id = id++; | ||
1772 | error = sysdev_register(&mpic->sysdev); | ||
1773 | mpic = mpic->next; | ||
1774 | } | ||
1775 | return error; | ||
1776 | } | 1779 | } |
1777 | 1780 | ||
1778 | device_initcall(mpic_init_sys); | 1781 | device_initcall(mpic_init_sys); |
1782 | #endif | ||
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 4b89da248d17..bc439de48cd1 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -24,7 +24,6 @@ config SUPERH | |||
24 | select RTC_LIB | 24 | select RTC_LIB |
25 | select GENERIC_ATOMIC64 | 25 | select GENERIC_ATOMIC64 |
26 | select GENERIC_IRQ_SHOW | 26 | select GENERIC_IRQ_SHOW |
27 | select ARCH_NO_SYSDEV_OPS | ||
28 | help | 27 | help |
29 | The SuperH is a RISC processor targeted for use in embedded systems | 28 | The SuperH is a RISC processor targeted for use in embedded systems |
30 | and consumer electronics; it was also used in the Sega Dreamcast | 29 | and consumer electronics; it was also used in the Sega Dreamcast |
diff --git a/arch/unicore32/kernel/irq.c b/arch/unicore32/kernel/irq.c index 2aa30a364bbe..d4efa7d679ff 100644 --- a/arch/unicore32/kernel/irq.c +++ b/arch/unicore32/kernel/irq.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
24 | #include <linux/kallsyms.h> | 24 | #include <linux/kallsyms.h> |
25 | #include <linux/proc_fs.h> | 25 | #include <linux/proc_fs.h> |
26 | #include <linux/sysdev.h> | 26 | #include <linux/syscore_ops.h> |
27 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
28 | 28 | ||
29 | #include <asm/system.h> | 29 | #include <asm/system.h> |
@@ -237,7 +237,7 @@ static struct puv3_irq_state { | |||
237 | unsigned int iccr; | 237 | unsigned int iccr; |
238 | } puv3_irq_state; | 238 | } puv3_irq_state; |
239 | 239 | ||
240 | static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state) | 240 | static int puv3_irq_suspend(void) |
241 | { | 241 | { |
242 | struct puv3_irq_state *st = &puv3_irq_state; | 242 | struct puv3_irq_state *st = &puv3_irq_state; |
243 | 243 | ||
@@ -265,7 +265,7 @@ static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state) | |||
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | static int puv3_irq_resume(struct sys_device *dev) | 268 | static void puv3_irq_resume(void) |
269 | { | 269 | { |
270 | struct puv3_irq_state *st = &puv3_irq_state; | 270 | struct puv3_irq_state *st = &puv3_irq_state; |
271 | 271 | ||
@@ -278,27 +278,20 @@ static int puv3_irq_resume(struct sys_device *dev) | |||
278 | 278 | ||
279 | writel(st->icmr, INTC_ICMR); | 279 | writel(st->icmr, INTC_ICMR); |
280 | } | 280 | } |
281 | return 0; | ||
282 | } | 281 | } |
283 | 282 | ||
284 | static struct sysdev_class puv3_irq_sysclass = { | 283 | static struct syscore_ops puv3_irq_syscore_ops = { |
285 | .name = "pkunity-irq", | ||
286 | .suspend = puv3_irq_suspend, | 284 | .suspend = puv3_irq_suspend, |
287 | .resume = puv3_irq_resume, | 285 | .resume = puv3_irq_resume, |
288 | }; | 286 | }; |
289 | 287 | ||
290 | static struct sys_device puv3_irq_device = { | 288 | static int __init puv3_irq_init_syscore(void) |
291 | .id = 0, | ||
292 | .cls = &puv3_irq_sysclass, | ||
293 | }; | ||
294 | |||
295 | static int __init puv3_irq_init_devicefs(void) | ||
296 | { | 289 | { |
297 | sysdev_class_register(&puv3_irq_sysclass); | 290 | register_syscore_ops(&puv3_irq_syscore_ops); |
298 | return sysdev_register(&puv3_irq_device); | 291 | return 0; |
299 | } | 292 | } |
300 | 293 | ||
301 | device_initcall(puv3_irq_init_devicefs); | 294 | device_initcall(puv3_irq_init_syscore); |
302 | 295 | ||
303 | void __init init_IRQ(void) | 296 | void __init init_IRQ(void) |
304 | { | 297 | { |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cc6c53a95bfd..140e254fe546 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -71,7 +71,6 @@ config X86 | |||
71 | select GENERIC_IRQ_SHOW | 71 | select GENERIC_IRQ_SHOW |
72 | select IRQ_FORCED_THREADING | 72 | select IRQ_FORCED_THREADING |
73 | select USE_GENERIC_SMP_HELPERS if SMP | 73 | select USE_GENERIC_SMP_HELPERS if SMP |
74 | select ARCH_NO_SYSDEV_OPS | ||
75 | 74 | ||
76 | config INSTRUCTION_DECODER | 75 | config INSTRUCTION_DECODER |
77 | def_bool (KPROBES || PERF_EVENTS) | 76 | def_bool (KPROBES || PERF_EVENTS) |
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index adee12e0da1f..3bfa02235965 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c | |||
@@ -1238,7 +1238,6 @@ static int suspend(int vetoable) | |||
1238 | dpm_suspend_noirq(PMSG_SUSPEND); | 1238 | dpm_suspend_noirq(PMSG_SUSPEND); |
1239 | 1239 | ||
1240 | local_irq_disable(); | 1240 | local_irq_disable(); |
1241 | sysdev_suspend(PMSG_SUSPEND); | ||
1242 | syscore_suspend(); | 1241 | syscore_suspend(); |
1243 | 1242 | ||
1244 | local_irq_enable(); | 1243 | local_irq_enable(); |
@@ -1258,7 +1257,6 @@ static int suspend(int vetoable) | |||
1258 | err = (err == APM_SUCCESS) ? 0 : -EIO; | 1257 | err = (err == APM_SUCCESS) ? 0 : -EIO; |
1259 | 1258 | ||
1260 | syscore_resume(); | 1259 | syscore_resume(); |
1261 | sysdev_resume(); | ||
1262 | local_irq_enable(); | 1260 | local_irq_enable(); |
1263 | 1261 | ||
1264 | dpm_resume_noirq(PMSG_RESUME); | 1262 | dpm_resume_noirq(PMSG_RESUME); |
@@ -1282,7 +1280,6 @@ static void standby(void) | |||
1282 | dpm_suspend_noirq(PMSG_SUSPEND); | 1280 | dpm_suspend_noirq(PMSG_SUSPEND); |
1283 | 1281 | ||
1284 | local_irq_disable(); | 1282 | local_irq_disable(); |
1285 | sysdev_suspend(PMSG_SUSPEND); | ||
1286 | syscore_suspend(); | 1283 | syscore_suspend(); |
1287 | local_irq_enable(); | 1284 | local_irq_enable(); |
1288 | 1285 | ||
@@ -1292,7 +1289,6 @@ static void standby(void) | |||
1292 | 1289 | ||
1293 | local_irq_disable(); | 1290 | local_irq_disable(); |
1294 | syscore_resume(); | 1291 | syscore_resume(); |
1295 | sysdev_resume(); | ||
1296 | local_irq_enable(); | 1292 | local_irq_enable(); |
1297 | 1293 | ||
1298 | dpm_resume_noirq(PMSG_RESUME); | 1294 | dpm_resume_noirq(PMSG_RESUME); |