summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-dwapb.c
diff options
context:
space:
mode:
authorXiaoguang Chen <xgchenshy@gmail.com>2017-06-02 07:27:15 +0800
committerLinus Walleij <linus.walleij@linaro.org>2017-06-21 09:36:46 +0200
commitedadced2bc7012108b05b47c0649c257ad28f03c (patch)
treeadf998a6f1ac6f2c2d6d4eb6db89305a7819e314 /drivers/gpio/gpio-dwapb.c
parenteb2ec49b0d64475be6ada37bcd70a4230f07ae70 (diff)
gpio: dwapb: fix missing first irq for edgeboth irq type
dwapb_irq_set_type overwrites polarity register value for IRQ_TYPE_EDGE_BOTH case. If the polarity of one gpio is 0 by default, then it will set falling edge irq trigger. and the gpio may requires rising edge irq for the first time, and it will be missed. Do not overwrite polarity register for IRQ_TYPE_EDGE_BOTH case can solve this issue. Signed-off-by: Xiaoguang Chen <xgchenshy@gmail.com> Tested-by: Jisheng Zhang <jszhang@marvell.com> [Fix some really weird text encoding problem] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-dwapb.c')
-rw-r--r--drivers/gpio/gpio-dwapb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index f051c4552af5..c07ada9c7af6 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -288,7 +288,8 @@ static int dwapb_irq_set_type(struct irq_data *d, u32 type)
irq_setup_alt_chip(d, type);
dwapb_write(gpio, GPIO_INTTYPE_LEVEL, level);
- dwapb_write(gpio, GPIO_INT_POLARITY, polarity);
+ if (type != IRQ_TYPE_EDGE_BOTH)
+ dwapb_write(gpio, GPIO_INT_POLARITY, polarity);
spin_unlock_irqrestore(&gc->bgpio_lock, flags);
return 0;