Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9227d8f9 authored by Maulik Shah's avatar Maulik Shah
Browse files

drivers: pinctrl: pinctrl-msm: clear pending irq before enabling



Clear the pending irq at GIC before enabling.

This will help in clearing any erroneous interrupts that would
have gotten latched when the GPIO interrupt is not in use.

Change-Id: Id1d6b8d5305bdc06d8f55b510a7d0d2d296a28e3
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent c3b229b5
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -746,8 +746,19 @@ static void msm_gpio_irq_enable(struct irq_data *d)
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);

	if (d->parent_data)
	if (d->parent_data) {
		/*
		 * Clear the interrupt that may be pending before we enable
		 * the line.
		 * This is especially a problem with the GPIOs routed to the
		 * PDC. These GPIOs are direct-connect interrupts to the GIC.
		 * Disabling the interrupt line at the PDC does not prevent
		 * the interrupt from being latched at the GIC. The state at
		 * GIC needs to be cleared before enabling.
		 */
		irq_chip_set_parent_state(d, IRQCHIP_STATE_PENDING, 0);
		irq_chip_enable_parent(d);
	}

	if (test_bit(d->hwirq, pctrl->wakeup_masked_irqs))
		return;