Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191868
b: refs/heads/master
c: c09f431
h: refs/heads/master
v: v3
  • Loading branch information
Eric Miao committed May 11, 2010
1 parent 484fbff commit a5e6212
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 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: 1106143d7ab43ba07678c88c85417df219354ae8
refs/heads/master: c09f431c338cf032c68ea68915f4dd85d92fd526
31 changes: 22 additions & 9 deletions trunk/arch/arm/mach-pxa/mfp-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,17 @@ int gpio_set_wake(unsigned int gpio, unsigned int on)
if (!d->valid)
return -EINVAL;

if (d->keypad_gpio)
return -EINVAL;
/* Allow keypad GPIOs to wakeup system when
* configured as generic GPIOs.
*/
if (d->keypad_gpio && (MFP_AF(d->config) == 0) &&
(d->config & MFP_LPM_CAN_WAKEUP)) {
if (on)
PKWR |= d->mask;
else
PKWR &= ~d->mask;
return 0;
}

mux_taken = (PWER & d->mux_mask) & (~d->mask);
if (on && mux_taken)
Expand Down Expand Up @@ -239,21 +248,25 @@ static int pxa27x_pkwr_gpio[] = {
int keypad_set_wake(unsigned int on)
{
unsigned int i, gpio, mask = 0;

if (!on) {
PKWR = 0;
return 0;
}
struct gpio_desc *d;

for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {

gpio = pxa27x_pkwr_gpio[i];
d = &gpio_desc[gpio];

if (gpio_desc[gpio].config & MFP_LPM_CAN_WAKEUP)
/* skip if configured as generic GPIO */
if (MFP_AF(d->config) == 0)
continue;

if (d->config & MFP_LPM_CAN_WAKEUP)
mask |= gpio_desc[gpio].mask;
}

PKWR = mask;
if (on)
PKWR |= mask;
else
PKWR &= ~mask;
return 0;
}

Expand Down

0 comments on commit a5e6212

Please sign in to comment.