Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299785
b: refs/heads/master
c: a13b878
h: refs/heads/master
i:
  299783: dae88a6
v: v3
  • Loading branch information
Igor Grinberg authored and Haojian Zhuang committed Apr 27, 2012
1 parent b987514 commit 474028d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f9d27e3f3317f39c91c286b6184f1ca05452968
refs/heads/master: a13b878780ea98d8415203c4502a8fc5bc614656
7 changes: 7 additions & 0 deletions trunk/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
* bit 23 - Input/Output (PXA2xx specific)
* bit 24 - Wakeup Enable(PXA2xx specific)
* bit 25 - Keep Output (PXA2xx specific)
*/

#define MFP_DIR_IN (0x0 << 23)
Expand All @@ -25,6 +26,12 @@
#define MFP_DIR(x) (((x) >> 23) & 0x1)

#define MFP_LPM_CAN_WAKEUP (0x1 << 24)

/*
* MFP_LPM_KEEP_OUTPUT must be specified for pins that need to
* retain their last output level (low or high).
* Note: MFP_LPM_KEEP_OUTPUT has no effect on pins configured for input.
*/
#define MFP_LPM_KEEP_OUTPUT (0x1 << 25)

#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
Expand Down
12 changes: 10 additions & 2 deletions trunk/arch/arm/mach-pxa/mfp-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,22 @@ static int pxa2xx_mfp_suspend(void)
}

for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {

saved_gafr[0][i] = GAFR_L(i);
saved_gafr[1][i] = GAFR_U(i);
saved_gpdr[i] = GPDR(i * 32);
saved_pgsr[i] = PGSR(i);
}

GPDR(i * 32) = gpdr_lpm[i];
/* set GPDR bits taking into account MFP_LPM_KEEP_OUTPUT */
for (i = 0; i < pxa_last_gpio; i++) {
if ((gpdr_lpm[gpio_to_bank(i)] & GPIO_bit(i)) ||
((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
(saved_gpdr[gpio_to_bank(i)] & GPIO_bit(i))))
GPDR(i) |= GPIO_bit(i);
else
GPDR(i) &= ~GPIO_bit(i);
}

return 0;
}

Expand Down

0 comments on commit 474028d

Please sign in to comment.