Skip to content

Commit b871656

Browse files
JohnnyonFlamelinusw
authored andcommitted
pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH
Switching between falling/rising edges for IRQ_TYPE_EDGE_BOTH on pins that require debounce can cause the device to lose events due to a desync between pin state and irq type. This problem is resolved by switching between IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH instead. Fixes: 936ee26 ("gpio/rockchip: add driver for rockchip gpio") Signed-off-by: João H. Spies <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 48ec733 commit b871656

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-rockchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,11 @@ static int rockchip_irq_set_type(struct irq_data *d, unsigned int type)
419419
goto out;
420420
} else {
421421
bank->toggle_edge_mode |= mask;
422-
level |= mask;
422+
level &= ~mask;
423423

424424
/*
425425
* Determine gpio state. If 1 next interrupt should be
426-
* falling otherwise rising.
426+
* low otherwise high.
427427
*/
428428
data = readl(bank->reg_base + bank->gpio_regs->ext_port);
429429
if (data & mask)

0 commit comments

Comments
 (0)