summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorJoão H. Spies <jhlspies@gmail.com>2022-08-08 02:51:20 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-23 14:15:47 +0200
commitca2b798e53d46efa45ea1ba80856fe369fa34402 (patch)
tree69fd905cdd8f4bd1f64d38e2758b6ff17d103ab8 /drivers/gpio
parent30fccb4fe449edc04c22e9600d69649eb4eebe22 (diff)
downloadlinux-stable-ca2b798e53d46efa45ea1ba80856fe369fa34402.tar.gz
linux-stable-ca2b798e53d46efa45ea1ba80856fe369fa34402.tar.bz2
linux-stable-ca2b798e53d46efa45ea1ba80856fe369fa34402.zip
pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH
[ Upstream commit b871656aa4f54e04207f62bdd0d7572be1d86b36 ] 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: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio") Signed-off-by: João H. Spies <jhlspies@gmail.com> Link: https://lore.kernel.org/r/20220808025121.110223-1-jhlspies@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-rockchip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index 22b8f0aa80f1..f31b0947eaaa 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -418,11 +418,11 @@ static int rockchip_irq_set_type(struct irq_data *d, unsigned int type)
goto out;
} else {
bank->toggle_edge_mode |= mask;
- level |= mask;
+ level &= ~mask;
/*
* Determine gpio state. If 1 next interrupt should be
- * falling otherwise rising.
+ * low otherwise high.
*/
data = readl(bank->reg_base + bank->gpio_regs->ext_port);
if (data & mask)