forked from Minki/linux
[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>
This commit is contained in:
parent
c8ee5c6951
commit
1106143d7a
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user