aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-22 16:02:55 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-04-24 13:16:08 -0400
commitb7808056141bc4d67213036921a5a685ebec0274 (patch)
treedd9f762b5d2f35f862d417aae81181994677f444
parent3c437ffd20329619672b12a97bee944bccdd4ec9 (diff)
ARM / Integrator: Use struct syscore_ops for core PM
Replace the sysdev class and struct sys_device used for power management by the Integrator interrupt-handling code with a struct syscore_ops object which is simpler. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c26
1 files changed, 9 insertions, 17 deletions
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
181static unsigned long ic_irq_enable; 181static unsigned long ic_irq_enable;
182 182
183static int irq_suspend(struct sys_device *dev, pm_message_t state) 183static 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
189static int irq_resume(struct sys_device *dev) 189static 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
204static struct sysdev_class irq_class = { 203static 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
210static struct sys_device irq_device = { 208static int __init irq_syscore_init(void)
211 .id = 0,
212 .cls = &irq_class,
213};
214
215static 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
223device_initcall(irq_init_sysfs); 215device_initcall(irq_syscore_init);
224 216
225/* 217/*
226 * Flash handling. 218 * Flash handling.