]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
gpio: realtek-otto: fix GPIO line IRQ offset
authorSander Vanheule <sander@svanheule.net>
Thu, 28 Oct 2021 08:52:43 +0000 (10:52 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:33:33 +0000 (07:33 +0100)
BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit 585a07079909ba9061ddd88214c36653e1aef71a ]

The irqchip uses one domain for all GPIO lines, so the 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@svanheule.net>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/gpio/gpio-realtek-otto.c

index eeeb39bc171dcba288a0aaa88b4a38a07c609915..bd75401b549d1a00977be5cf5af0172b834af65b 100644 (file)
@@ -205,7 +205,7 @@ static void realtek_gpio_irq_handler(struct irq_desc *desc)
                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)
-                       generic_handle_domain_irq(gc->irq.domain, offset);
+                       generic_handle_domain_irq(gc->irq.domain, offset + lines_done);
        }
 
        chained_irq_exit(irq_chip, desc);