diff options
author | Nicolas Pitre <nico@org.rmk.(none)> | 2005-06-16 16:23:56 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-06-16 16:23:56 -0400 |
commit | 22f11c4e662ef0bdd87f09370a76c83ed738d5fd (patch) | |
tree | 3b3c2df768eacbd59240cd4be8d9922ab4a0ba7d /arch/arm | |
parent | 95220a2ea334b5ff2168cc9bf31c0e08b29bae21 (diff) |
[PATCH] ARM: 2715/1: restore CPLD interrupts upon resume for Lubbock and Mainstone
Patch from Nicolas Pitre
Without this some devices fail to work again after a suspend event.
Signed-off-by: Nicolas Pitre
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/lubbock.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-pxa/mainstone.c | 31 |
2 files changed, 60 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index dd012d6e2f5c..f2c9e0d2b24b 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -15,6 +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/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/sysdev.h> | ||
18 | #include <linux/major.h> | 19 | #include <linux/major.h> |
19 | #include <linux/fb.h> | 20 | #include <linux/fb.h> |
20 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
@@ -106,6 +107,35 @@ static void __init lubbock_init_irq(void) | |||
106 | set_irq_type(IRQ_GPIO(0), IRQT_FALLING); | 107 | set_irq_type(IRQ_GPIO(0), IRQT_FALLING); |
107 | } | 108 | } |
108 | 109 | ||
110 | #ifdef CONFIG_PM | ||
111 | |||
112 | static int lubbock_irq_resume(struct sys_device *dev) | ||
113 | { | ||
114 | LUB_IRQ_MASK_EN = lubbock_irq_enabled; | ||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | static struct sysdev_class lubbock_irq_sysclass = { | ||
119 | set_kset_name("cpld_irq"), | ||
120 | .resume = lubbock_irq_resume, | ||
121 | }; | ||
122 | |||
123 | static struct sys_device lubbock_irq_device = { | ||
124 | .cls = &lubbock_irq_sysclass, | ||
125 | }; | ||
126 | |||
127 | static int __init lubbock_irq_device_init(void) | ||
128 | { | ||
129 | int ret = sysdev_class_register(&lubbock_irq_sysclass); | ||
130 | if (ret == 0) | ||
131 | ret = sysdev_register(&lubbock_irq_device); | ||
132 | return ret; | ||
133 | } | ||
134 | |||
135 | device_initcall(lubbock_irq_device_init); | ||
136 | |||
137 | #endif | ||
138 | |||
109 | static int lubbock_udc_is_connected(void) | 139 | static int lubbock_udc_is_connected(void) |
110 | { | 140 | { |
111 | return (LUB_MISC_RD & (1 << 9)) == 0; | 141 | return (LUB_MISC_RD & (1 << 9)) == 0; |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 6823ae28ae6a..9896afca751f 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/sysdev.h> | ||
18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
19 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
20 | #include <linux/bitops.h> | 21 | #include <linux/bitops.h> |
@@ -62,7 +63,6 @@ static struct irqchip mainstone_irq_chip = { | |||
62 | .unmask = mainstone_unmask_irq, | 63 | .unmask = mainstone_unmask_irq, |
63 | }; | 64 | }; |
64 | 65 | ||
65 | |||
66 | static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, | 66 | static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, |
67 | struct pt_regs *regs) | 67 | struct pt_regs *regs) |
68 | { | 68 | { |
@@ -100,6 +100,35 @@ static void __init mainstone_init_irq(void) | |||
100 | set_irq_type(IRQ_GPIO(0), IRQT_FALLING); | 100 | set_irq_type(IRQ_GPIO(0), IRQT_FALLING); |
101 | } | 101 | } |
102 | 102 | ||
103 | #ifdef CONFIG_PM | ||
104 | |||
105 | static int mainstone_irq_resume(struct sys_device *dev) | ||
106 | { | ||
107 | MST_INTMSKENA = mainstone_irq_enabled; | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | static struct sysdev_class mainstone_irq_sysclass = { | ||
112 | set_kset_name("cpld_irq"), | ||
113 | .resume = mainstone_irq_resume, | ||
114 | }; | ||
115 | |||
116 | static struct sys_device mainstone_irq_device = { | ||
117 | .cls = &mainstone_irq_sysclass, | ||
118 | }; | ||
119 | |||
120 | static int __init mainstone_irq_device_init(void) | ||
121 | { | ||
122 | int ret = sysdev_class_register(&mainstone_irq_sysclass); | ||
123 | if (ret == 0) | ||
124 | ret = sysdev_register(&mainstone_irq_device); | ||
125 | return ret; | ||
126 | } | ||
127 | |||
128 | device_initcall(mainstone_irq_device_init); | ||
129 | |||
130 | #endif | ||
131 | |||
103 | 132 | ||
104 | static struct resource smc91x_resources[] = { | 133 | static struct resource smc91x_resources[] = { |
105 | [0] = { | 134 | [0] = { |