]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
gpio: lynxpoint: Setup correct IRQ handlers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 18 Nov 2019 18:02:51 +0000 (20:02 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 05:05:10 +0000 (00:05 -0500)
BugLink: https://bugs.launchpad.net/bugs/1860816
[ Upstream commit e272f7ec070d212b9301d5a465bc8952f8dcf908 ]

When commit 75e99bf5ed8f ("gpio: lynxpoint: set default handler to be
handle_bad_irq()") switched default handler to be handle_bad_irq() the
lp_irq_type() function remained untouched. It means that even request_irq()
can't change the handler and we are not able to handle IRQs properly anymore.
Fix it by setting correct handlers in the lp_irq_type() callback.

Fixes: 75e99bf5ed8f ("gpio: lynxpoint: set default handler to be handle_bad_irq()")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20191118180251.31439-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpio/gpio-lynxpoint.c

index 31b4a091ab60aeded67e06607020006e0d49092d..691bff63e7ddb25b5e6c253c65f0120bc638d7ba 100644 (file)
@@ -164,6 +164,12 @@ static int lp_irq_type(struct irq_data *d, unsigned type)
                value |= TRIG_SEL_BIT | INT_INV_BIT;
 
        outl(value, reg);
+
+       if (type & IRQ_TYPE_EDGE_BOTH)
+               irq_set_handler_locked(d, handle_edge_irq);
+       else if (type & IRQ_TYPE_LEVEL_MASK)
+               irq_set_handler_locked(d, handle_level_irq);
+
        spin_unlock_irqrestore(&lg->lock, flags);
 
        return 0;