aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2010-01-11 08:25:15 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-05-11 11:24:59 -0400
commit1106143d7ab43ba07678c88c85417df219354ae8 (patch)
tree93eed0f0dae58aaa00549a4e1d49a349a631de14
parentc8ee5c69516fdd973b981e3ac12d49b3133930cd (diff)
[ARM] pxa: add MFP_LPM_KEEP_OUTPUT flag to pin config
Some pins are expected to keep their last level during suspend, and introduce MFP_LPM_KEEP_OUTPUT for this. Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h2
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
index 658b28ed129b..c54cef25895c 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
@@ -25,6 +25,8 @@
25#define MFP_DIR(x) (((x) >> 23) & 0x1) 25#define MFP_DIR(x) (((x) >> 23) & 0x1)
26 26
27#define MFP_LPM_CAN_WAKEUP (0x1 << 24) 27#define MFP_LPM_CAN_WAKEUP (0x1 << 24)
28#define MFP_LPM_KEEP_OUTPUT (0x1 << 25)
29
28#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE) 30#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
29#define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL) 31#define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL)
30#define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH) 32#define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH)
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index cf6b720c055f..c98b5a8c3b0f 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -328,6 +328,17 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
328{ 328{
329 int i; 329 int i;
330 330
331 /* set corresponding PGSR bit of those marked MFP_LPM_KEEP_OUTPUT */
332 for (i = 0; i < pxa_last_gpio; i++) {
333 if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
334 (GPDR(i) & GPIO_bit(i))) {
335 if (GPLR(i) & GPIO_bit(i))
336 PGSR(i) |= GPIO_bit(i);
337 else
338 PGSR(i) &= ~GPIO_bit(i);
339 }
340 }
341
331 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { 342 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
332 343
333 saved_gafr[0][i] = GAFR_L(i); 344 saved_gafr[0][i] = GAFR_L(i);