diff options
author | Tony Lin <tony.lin@freescale.com> | 2011-08-16 17:00:26 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 20:23:15 +0800 |
commit | cb9b8a45b67baef7020575ef0e7699078d569d05 (patch) | |
tree | fe797848eecc9809c0ea73d8063f753db6a69aa2 /arch/arm/plat-mxc/gpio.c | |
parent | c3ef0d30ebfef7d92504060096daeab5c726f919 (diff) |
ENGR00154890 [MX6Q]suspend/resume restore GPIO interrupt enable status
re-init GPIO interrupt to make GPIO interrupt workable after
suspend/resume (dormant mode)
Signed-off-by: Tony Lin <tony.lin@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc/gpio.c')
-rwxr-xr-x | arch/arm/plat-mxc/gpio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index 0a4743a355da..cd9958d51b66 100755 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c @@ -305,9 +305,10 @@ static int mxc_gpio_direction_output(struct gpio_chip *chip, */ static struct lock_class_key gpio_lock_class; -int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) +int mxc_gpio_init(struct mxc_gpio_port *port, int cnt) { int i, j; + static bool initialed; /* save for local usage */ mxc_gpio_ports = port; @@ -337,8 +338,9 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) spin_lock_init(&port[i].lock); - /* its a serious configuration bug when it fails */ - BUG_ON( gpiochip_add(&port[i].chip) < 0 ); + if (!initialed) + /* its a serious configuration bug when it fails */ + BUG_ON(gpiochip_add(&port[i].chip) < 0); if (cpu_is_mx1() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51() || cpu_is_mx53() || cpu_is_mx6q()) { @@ -355,7 +357,7 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) } } } - + initialed = true; if (cpu_is_mx2()) { /* setup one handler for all GPIO interrupts */ irq_set_chained_handler(port[0].irq, mx2_gpio_irq_handler); |