Skip to content

Commit

Permalink
pinctrl: msm: Correct interrupt code for TLMM v2
Browse files Browse the repository at this point in the history
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: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Bjorn Andersson authored and Linus Walleij committed Apr 14, 2014
1 parent 6888c75 commit 48f15e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/pinctrl/pinctrl-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,10 @@ static void msm_gpio_irq_ack(struct irq_data *d)
spin_lock_irqsave(&pctrl->lock, flags);

val = readl(pctrl->regs + g->intr_status_reg);
val &= ~BIT(g->intr_status_bit);
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);

if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions drivers/pinctrl/pinctrl-msm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 48f15e9

Please sign in to comment.