007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch 931 B

12345678910111213141516171819202122
  1. From: Sander Vanheule <[email protected]>
  2. Subject: gpio: realtek-otto: fix GPIO line IRQ offset
  3. The irqchip uses one domain for all GPIO lines, so th line offset should be
  4. determined w.r.t. the first line of the first port, not the first line of the
  5. triggered port.
  6. Fixes: 0d82fb1127fb ("gpio: Add Realtek Otto GPIO support")
  7. Signed-off-by: Sander Vanheule <[email protected]>
  8. Link: https://lore.kernel.org/linux-gpio/[email protected]/
  9. --- a/drivers/gpio/gpio-realtek-otto.c
  10. +++ b/drivers/gpio/gpio-realtek-otto.c
  11. @@ -206,7 +206,7 @@ static void realtek_gpio_irq_handler(str
  12. status = realtek_gpio_read_isr(ctrl, lines_done / 8);
  13. port_pin_count = min(gc->ngpio - lines_done, 8U);
  14. for_each_set_bit(offset, &status, port_pin_count) {
  15. - irq = irq_find_mapping(gc->irq.domain, offset);
  16. + irq = irq_find_mapping(gc->irq.domain, offset + lines_done);
  17. generic_handle_irq(irq);
  18. }
  19. }