0036-pinctrl-msm-Correct-interrupt-code-for-TLMM-v2.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 32787a9bba5a1ebeea891fd7aab954e6d344892a Mon Sep 17 00:00:00 2001
  2. From: Bjorn Andersson <[email protected]>
  3. Date: Mon, 31 Mar 2014 14:49:54 -0700
  4. Subject: [PATCH 036/182] pinctrl: msm: Correct interrupt code for TLMM v2
  5. Acking interrupts are done differently between on v2 and v3, so add an extra
  6. attribute to the pingroup struct to let the platform definitions control this.
  7. Also make sure to start dual edge detection by detecting the rising edge.
  8. Signed-off-by: Bjorn Andersson <[email protected]>
  9. Signed-off-by: Linus Walleij <[email protected]>
  10. ---
  11. drivers/pinctrl/pinctrl-msm.c | 6 +++++-
  12. drivers/pinctrl/pinctrl-msm.h | 1 +
  13. 2 files changed, 6 insertions(+), 1 deletion(-)
  14. --- a/drivers/pinctrl/pinctrl-msm.c
  15. +++ b/drivers/pinctrl/pinctrl-msm.c
  16. @@ -665,7 +665,10 @@ static void msm_gpio_irq_ack(struct irq_
  17. spin_lock_irqsave(&pctrl->lock, flags);
  18. val = readl(pctrl->regs + g->intr_status_reg);
  19. - val &= ~BIT(g->intr_status_bit);
  20. + if (g->intr_ack_high)
  21. + val |= BIT(g->intr_status_bit);
  22. + else
  23. + val &= ~BIT(g->intr_status_bit);
  24. writel(val, pctrl->regs + g->intr_status_reg);
  25. if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
  26. @@ -744,6 +747,7 @@ static int msm_gpio_irq_set_type(struct
  27. break;
  28. case IRQ_TYPE_EDGE_BOTH:
  29. val |= BIT(g->intr_detection_bit);
  30. + val |= BIT(g->intr_polarity_bit);
  31. break;
  32. case IRQ_TYPE_LEVEL_LOW:
  33. break;
  34. --- a/drivers/pinctrl/pinctrl-msm.h
  35. +++ b/drivers/pinctrl/pinctrl-msm.h
  36. @@ -84,6 +84,7 @@ struct msm_pingroup {
  37. unsigned intr_enable_bit:5;
  38. unsigned intr_status_bit:5;
  39. + unsigned intr_ack_high:1;
  40. unsigned intr_target_bit:5;
  41. unsigned intr_raw_status_bit:5;