aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pxa27x.c
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-01-28 18:00:02 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-02-04 08:17:33 -0500
commit16dfdbf038706c12c56f327d14c6b901edc376a3 (patch)
tree1f761ae7ff1c4ba837d24c69521d5cbe0b2d7e72 /arch/arm/mach-pxa/pxa27x.c
parentc016550490687c6bdbcdf06c7b4d874b6c7c6e4e (diff)
[ARM] pxa: introduce sysdev for GPIO register saving/restoring
Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r--arch/arm/mach-pxa/pxa27x.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 343296a710b3..46a951c3e5a0 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -172,11 +172,6 @@ static struct clk pxa27x_clks[] = {
172#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x 172#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
173#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] 173#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
174 174
175#define RESTORE_GPLEVEL(n) do { \
176 GPSR##n = sleep_save[SLEEP_SAVE_GPLR##n]; \
177 GPCR##n = ~sleep_save[SLEEP_SAVE_GPLR##n]; \
178} while (0)
179
180/* 175/*
181 * List of global PXA peripheral registers to preserve. 176 * List of global PXA peripheral registers to preserve.
182 * More ones like CP and general purpose register values are preserved 177 * More ones like CP and general purpose register values are preserved
@@ -184,10 +179,6 @@ static struct clk pxa27x_clks[] = {
184 */ 179 */
185enum { SLEEP_SAVE_START = 0, 180enum { SLEEP_SAVE_START = 0,
186 181
187 SLEEP_SAVE_GPLR0, SLEEP_SAVE_GPLR1, SLEEP_SAVE_GPLR2, SLEEP_SAVE_GPLR3,
188 SLEEP_SAVE_GPDR0, SLEEP_SAVE_GPDR1, SLEEP_SAVE_GPDR2, SLEEP_SAVE_GPDR3,
189 SLEEP_SAVE_GRER0, SLEEP_SAVE_GRER1, SLEEP_SAVE_GRER2, SLEEP_SAVE_GRER3,
190 SLEEP_SAVE_GFER0, SLEEP_SAVE_GFER1, SLEEP_SAVE_GFER2, SLEEP_SAVE_GFER3,
191 SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2, SLEEP_SAVE_PGSR3, 182 SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2, SLEEP_SAVE_PGSR3,
192 183
193 SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR0_U, 184 SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR0_U,
@@ -208,10 +199,6 @@ enum { SLEEP_SAVE_START = 0,
208 199
209void pxa27x_cpu_pm_save(unsigned long *sleep_save) 200void pxa27x_cpu_pm_save(unsigned long *sleep_save)
210{ 201{
211 SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2); SAVE(GPLR3);
212 SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2); SAVE(GPDR3);
213 SAVE(GRER0); SAVE(GRER1); SAVE(GRER2); SAVE(GRER3);
214 SAVE(GFER0); SAVE(GFER1); SAVE(GFER2); SAVE(GFER3);
215 SAVE(PGSR0); SAVE(PGSR1); SAVE(PGSR2); SAVE(PGSR3); 202 SAVE(PGSR0); SAVE(PGSR1); SAVE(PGSR2); SAVE(PGSR3);
216 203
217 SAVE(GAFR0_L); SAVE(GAFR0_U); 204 SAVE(GAFR0_L); SAVE(GAFR0_U);
@@ -225,9 +212,6 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save)
225 212
226 SAVE(CKEN); 213 SAVE(CKEN);
227 SAVE(PSTR); 214 SAVE(PSTR);
228
229 /* Clear GPIO transition detect bits */
230 GEDR0 = GEDR0; GEDR1 = GEDR1; GEDR2 = GEDR2; GEDR3 = GEDR3;
231} 215}
232 216
233void pxa27x_cpu_pm_restore(unsigned long *sleep_save) 217void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
@@ -236,15 +220,10 @@ void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
236 PSPR = 0; 220 PSPR = 0;
237 221
238 /* restore registers */ 222 /* restore registers */
239 RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1);
240 RESTORE_GPLEVEL(2); RESTORE_GPLEVEL(3);
241 RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2); RESTORE(GPDR3);
242 RESTORE(GAFR0_L); RESTORE(GAFR0_U); 223 RESTORE(GAFR0_L); RESTORE(GAFR0_U);
243 RESTORE(GAFR1_L); RESTORE(GAFR1_U); 224 RESTORE(GAFR1_L); RESTORE(GAFR1_U);
244 RESTORE(GAFR2_L); RESTORE(GAFR2_U); 225 RESTORE(GAFR2_L); RESTORE(GAFR2_U);
245 RESTORE(GAFR3_L); RESTORE(GAFR3_U); 226 RESTORE(GAFR3_L); RESTORE(GAFR3_U);
246 RESTORE(GRER0); RESTORE(GRER1); RESTORE(GRER2); RESTORE(GRER3);
247 RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2); RESTORE(GFER3);
248 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); RESTORE(PGSR3); 227 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); RESTORE(PGSR3);
249 228
250 RESTORE(MDREFR); 229 RESTORE(MDREFR);
@@ -412,6 +391,8 @@ static struct sys_device pxa27x_sysdev[] = {
412 }, { 391 }, {
413 .id = 1, 392 .id = 1,
414 .cls = &pxa_irq_sysclass, 393 .cls = &pxa_irq_sysclass,
394 }, {
395 .cls = &pxa_gpio_sysclass,
415 }, 396 },
416}; 397};
417 398