Skip to content

Commit

Permalink
[ARM] pxa: add MFP_LPM_KEEP_OUTPUT flag to pin config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Miao committed May 11, 2010
1 parent c8ee5c6 commit 1106143
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#define MFP_DIR(x) (((x) >> 23) & 0x1)

#define MFP_LPM_CAN_WAKEUP (0x1 << 24)
#define MFP_LPM_KEEP_OUTPUT (0x1 << 25)

#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
#define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL)
#define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH)
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/mach-pxa/mfp-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,17 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
{
int i;

/* set corresponding PGSR bit of those marked MFP_LPM_KEEP_OUTPUT */
for (i = 0; i < pxa_last_gpio; i++) {
if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
(GPDR(i) & GPIO_bit(i))) {
if (GPLR(i) & GPIO_bit(i))
PGSR(i) |= GPIO_bit(i);
else
PGSR(i) &= ~GPIO_bit(i);
}
}

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

saved_gafr[0][i] = GAFR_L(i);
Expand Down

0 comments on commit 1106143

Please sign in to comment.