Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307675
b: refs/heads/master
c: c6f31c9
h: refs/heads/master
i:
  307673: f48262c
  307671: b109737
v: v3
  • Loading branch information
Tarun Kanti DebBarma authored and Kevin Hilman committed May 12, 2012
1 parent 0661531 commit 4b68485
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: d13710a7e6241f1725da34004928b93a71b05508
refs/heads/master: c6f31c9ec264233cb6a28053a1739425b18fd581
19 changes: 8 additions & 11 deletions trunk/drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ struct gpio_bank {
u32 enabled_non_wakeup_gpios;
struct gpio_regs context;
u32 saved_datain;
u32 saved_fallingdetect;
u32 saved_risingdetect;
u32 level_mask;
u32 toggle_mask;
spinlock_t lock;
Expand Down Expand Up @@ -1244,11 +1242,9 @@ static int omap_gpio_runtime_suspend(struct device *dev)
*/
bank->saved_datain = __raw_readl(bank->base +
bank->regs->datain);
l1 = __raw_readl(bank->base + bank->regs->fallingdetect);
l2 = __raw_readl(bank->base + bank->regs->risingdetect);
l1 = bank->context.fallingdetect;
l2 = bank->context.risingdetect;

bank->saved_fallingdetect = l1;
bank->saved_risingdetect = l2;
l1 &= ~bank->enabled_non_wakeup_gpios;
l2 &= ~bank->enabled_non_wakeup_gpios;

Expand Down Expand Up @@ -1307,9 +1303,9 @@ static int omap_gpio_runtime_resume(struct device *dev)
}
}

__raw_writel(bank->saved_fallingdetect,
__raw_writel(bank->context.fallingdetect,
bank->base + bank->regs->fallingdetect);
__raw_writel(bank->saved_risingdetect,
__raw_writel(bank->context.risingdetect,
bank->base + bank->regs->risingdetect);
l = __raw_readl(bank->base + bank->regs->datain);

Expand All @@ -1326,14 +1322,15 @@ static int omap_gpio_runtime_resume(struct device *dev)
* No need to generate IRQs for the rising edge for gpio IRQs
* configured with falling edge only; and vice versa.
*/
gen0 = l & bank->saved_fallingdetect;
gen0 = l & bank->context.fallingdetect;
gen0 &= bank->saved_datain;

gen1 = l & bank->saved_risingdetect;
gen1 = l & bank->context.risingdetect;
gen1 &= ~(bank->saved_datain);

/* FIXME: Consider GPIO IRQs with level detections properly! */
gen = l & (~(bank->saved_fallingdetect) & ~(bank->saved_risingdetect));
gen = l & (~(bank->context.fallingdetect) &
~(bank->context.risingdetect));
/* Consider all GPIO IRQs needed to be updated */
gen |= gen0 | gen1;

Expand Down

0 comments on commit 4b68485

Please sign in to comment.