Skip to content

Commit

Permalink
plat-omap: gpio: Configure gpio padconf wakeups on late_init()
Browse files Browse the repository at this point in the history
Configuring in the idle path is too slow.
Possible revisit, if padconf changes past late_init() idle will miss this
but suspend will enable it properly.

This wakeup code got lost in the DSPBRIDGE commit, putting back in.

Change-Id: I75633ae625e60741621e01c2386fdc3a7574b18e
Signed-off-by: Mike Chan <mike@android.com>
  • Loading branch information
Rebecca Schultz Zavin authored and Mike Chan committed Apr 14, 2010
1 parent 4f76699 commit 6cc5745
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions arch/arm/plat-omap/gpio.c
Expand Up @@ -1712,6 +1712,29 @@ static int __init omap3_gpio_pads_init(void)
}
}
gpio_pads[gpio_amt].gpio = -1;

/* Configure gpio pad wakeups on late init */
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
if (bank->method == METHOD_GPIO_24XX) {
int j;
for (j = 0; j < 32; j++) {
int offset = gpio_pad_map[j + i * 32];
u16 v;

if (!offset)
continue;

v = omap_ctrl_readw(offset);
if (bank->suspend_wakeup & (1 << j))
v |= OMAP3_PADCONF_WAKEUPENABLE0;
else
v &= ~OMAP3_PADCONF_WAKEUPENABLE0;
omap_ctrl_writew(v, offset);
}
}
}

return 0;
}
late_initcall(omap3_gpio_pads_init);
Expand Down

0 comments on commit 6cc5745

Please sign in to comment.