diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-11-22 16:50:05 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-12-13 16:48:48 +0200 |
commit | 5931e6edfdd01c97b4cf8354e68f74df97580e49 (patch) | |
tree | f3e93cc86648d5175796c9157686a8d8a72e63f8 /drivers/pinctrl | |
parent | 540bff18daf4aa3d67004e8bb02a0ea5b3818451 (diff) |
pinctrl: lynxpoint: Implement ->irq_ack() callback
Instead of playing tricks with registers in the interrupt handler,
utilize the IRQ chip core for ACKing interrupts properly.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-lynxpoint.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c index ddb201e5d78f..3b0dfe9a51ba 100644 --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c @@ -218,9 +218,6 @@ static void lp_gpio_irq_handler(struct irq_desc *desc) for_each_set_bit(pin, &pending, 32) { unsigned int irq; - /* Clear before handling so we don't lose an edge */ - iowrite32(BIT(pin), reg); - irq = irq_find_mapping(lg->chip.irq.domain, base + pin); generic_handle_irq(irq); } @@ -228,6 +225,19 @@ static void lp_gpio_irq_handler(struct irq_desc *desc) chip->irq_eoi(data); } +static void lp_irq_ack(struct irq_data *d) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct lp_gpio *lg = gpiochip_get_data(gc); + u32 hwirq = irqd_to_hwirq(d); + void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT); + unsigned long flags; + + raw_spin_lock_irqsave(&lg->lock, flags); + iowrite32(BIT(hwirq % 32), reg); + raw_spin_unlock_irqrestore(&lg->lock, flags); +} + static void lp_irq_unmask(struct irq_data *d) { } @@ -313,6 +323,7 @@ static int lp_irq_set_type(struct irq_data *d, unsigned int type) static struct irq_chip lp_irqchip = { .name = "LP-GPIO", + .irq_ack = lp_irq_ack, .irq_mask = lp_irq_mask, .irq_unmask = lp_irq_unmask, .irq_enable = lp_irq_enable, |