aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/generic.c')
-rw-r--r--arch/arm/mach-pxa/generic.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 80721c610d41..331f29b2d0cd 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -19,14 +19,8 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/delay.h>
23#include <linux/ioport.h>
24#include <linux/pm.h>
25#include <linux/string.h>
26#include <linux/sysdev.h>
27 22
28#include <asm/hardware.h> 23#include <asm/hardware.h>
29#include <asm/irq.h>
30#include <asm/system.h> 24#include <asm/system.h>
31#include <asm/pgtable.h> 25#include <asm/pgtable.h>
32#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -134,59 +128,3 @@ void __init pxa_map_io(void)
134 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); 128 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
135 get_clk_frequency_khz(1); 129 get_clk_frequency_khz(1);
136} 130}
137
138#ifdef CONFIG_PM
139
140static unsigned long saved_gplr[4];
141static unsigned long saved_gpdr[4];
142static unsigned long saved_grer[4];
143static unsigned long saved_gfer[4];
144
145static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
146{
147 int i, gpio;
148
149 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
150 saved_gplr[i] = GPLR(gpio);
151 saved_gpdr[i] = GPDR(gpio);
152 saved_grer[i] = GRER(gpio);
153 saved_gfer[i] = GFER(gpio);
154
155 /* Clear GPIO transition detect bits */
156 GEDR(gpio) = GEDR(gpio);
157 }
158 return 0;
159}
160
161static int pxa_gpio_resume(struct sys_device *dev)
162{
163 int i, gpio;
164
165 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
166 /* restore level with set/clear */
167 GPSR(gpio) = saved_gplr[i];
168 GPCR(gpio) = ~saved_gplr[i];
169
170 GRER(gpio) = saved_grer[i];
171 GFER(gpio) = saved_gfer[i];
172 GPDR(gpio) = saved_gpdr[i];
173 }
174 return 0;
175}
176#else
177#define pxa_gpio_suspend NULL
178#define pxa_gpio_resume NULL
179#endif
180
181struct sysdev_class pxa_gpio_sysclass = {
182 .name = "gpio",
183 .suspend = pxa_gpio_suspend,
184 .resume = pxa_gpio_resume,
185};
186
187static int __init pxa_gpio_init(void)
188{
189 return sysdev_class_register(&pxa_gpio_sysclass);
190}
191
192core_initcall(pxa_gpio_init);