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>
This commit is contained in:
parent
3c437ffd20
commit
b780805614
1 changed files with 9 additions and 17 deletions
|
@ -24,7 +24,7 @@
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/sysdev.h>
|
#include <linux/syscore_ops.h>
|
||||||
#include <linux/amba/bus.h>
|
#include <linux/amba/bus.h>
|
||||||
#include <linux/amba/kmi.h>
|
#include <linux/amba/kmi.h>
|
||||||
#include <linux/clocksource.h>
|
#include <linux/clocksource.h>
|
||||||
|
@ -180,13 +180,13 @@ static void __init ap_init_irq(void)
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static unsigned long ic_irq_enable;
|
static unsigned long ic_irq_enable;
|
||||||
|
|
||||||
static int irq_suspend(struct sys_device *dev, pm_message_t state)
|
static int irq_suspend(void)
|
||||||
{
|
{
|
||||||
ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE);
|
ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int irq_resume(struct sys_device *dev)
|
static void irq_resume(void)
|
||||||
{
|
{
|
||||||
/* disable all irq sources */
|
/* disable all irq sources */
|
||||||
writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
|
writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
|
||||||
|
@ -194,33 +194,25 @@ static int irq_resume(struct sys_device *dev)
|
||||||
writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
|
writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
|
||||||
|
|
||||||
writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET);
|
writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define irq_suspend NULL
|
#define irq_suspend NULL
|
||||||
#define irq_resume NULL
|
#define irq_resume NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct sysdev_class irq_class = {
|
static struct syscore_ops irq_syscore_ops = {
|
||||||
.name = "irq",
|
|
||||||
.suspend = irq_suspend,
|
.suspend = irq_suspend,
|
||||||
.resume = irq_resume,
|
.resume = irq_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct sys_device irq_device = {
|
static int __init irq_syscore_init(void)
|
||||||
.id = 0,
|
|
||||||
.cls = &irq_class,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init irq_init_sysfs(void)
|
|
||||||
{
|
{
|
||||||
int ret = sysdev_class_register(&irq_class);
|
register_syscore_ops(&irq_syscore_ops);
|
||||||
if (ret == 0)
|
|
||||||
ret = sysdev_register(&irq_device);
|
return 0;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
device_initcall(irq_init_sysfs);
|
device_initcall(irq_syscore_init);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flash handling.
|
* Flash handling.
|
||||||
|
|
Loading…
Add table
Reference in a new issue