[openwrt/openwrt] realtek: backport GPIO IRQ index fix

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 31 17:21:51 PDT 2021


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c735d2e2187ff13b305fc4b73ba047cc3d43f2d5

commit c735d2e2187ff13b305fc4b73ba047cc3d43f2d5
Author: Sander Vanheule <sander at svanheule.net>
AuthorDate: Sun Oct 31 14:41:54 2021 +0100

    realtek: backport GPIO IRQ index fix
    
    Backport the patch queued upstream for 5.16. The patch differs slightly
    from the upstream patch due to an upstream change that added a
    convenience function.
    
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 ...ltek-realtek-otto-fix-gpio-line-irq-offset.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch b/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch
new file mode 100644
index 0000000000..f1f739d470
--- /dev/null
+++ b/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch
@@ -0,0 +1,21 @@
+gpio: realtek-otto: fix GPIO line IRQ offset
+
+The irqchip uses one domain for all GPIO lines, so th line offset should be
+determined w.r.t. the first line of the first port, not the first line of the
+triggered port.
+
+Fixes: 0d82fb1127fb ("gpio: Add Realtek Otto GPIO support")
+Signed-off-by: Sander Vanheule <sander at svanheule.net>
+Link: https://lore.kernel.org/linux-gpio/20211028085243.34360-1-sander@svanheule.net/
+
+--- a/drivers/gpio/gpio-realtek-otto.c
++++ b/drivers/gpio/gpio-realtek-otto.c
+@@ -206,7 +206,7 @@ static void realtek_gpio_irq_handler(str
+ 		status = realtek_gpio_read_isr(ctrl, lines_done / 8);
+ 		port_pin_count = min(gc->ngpio - lines_done, 8U);
+ 		for_each_set_bit(offset, &status, port_pin_count) {
+-			irq = irq_find_mapping(gc->irq.domain, offset);
++			irq = irq_find_mapping(gc->irq.domain, offset + lines_done);
+ 			generic_handle_irq(irq);
+ 		}
+ 	}



More information about the lede-commits mailing list