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

Commit 48f15e94 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Linus Walleij
Browse files

pinctrl: msm: Correct interrupt code for TLMM v2



Acking interrupts are done differently between on v2 and v3, so add an extra
attribute to the pingroup struct to let the platform definitions control this.
Also make sure to start dual edge detection by detecting the rising edge.

Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 6888c75b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -665,6 +665,9 @@ static void msm_gpio_irq_ack(struct irq_data *d)
	spin_lock_irqsave(&pctrl->lock, flags);

	val = readl(pctrl->regs + g->intr_status_reg);
	if (g->intr_ack_high)
		val |= BIT(g->intr_status_bit);
	else
		val &= ~BIT(g->intr_status_bit);
	writel(val, pctrl->regs + g->intr_status_reg);

@@ -744,6 +747,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
			break;
		case IRQ_TYPE_EDGE_BOTH:
			val |= BIT(g->intr_detection_bit);
			val |= BIT(g->intr_polarity_bit);
			break;
		case IRQ_TYPE_LEVEL_LOW:
			break;
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ struct msm_pingroup {

	unsigned intr_enable_bit:5;
	unsigned intr_status_bit:5;
	unsigned intr_ack_high:1;

	unsigned intr_target_bit:5;
	unsigned intr_raw_status_bit:5;