ipq806x: Add support for IPQ806x chip family
[openwrt/staging/chunkeey.git] / target / linux / ipq806x / patches / 0025-pinctrl-msm-drop-wake_irqs-bitmap.patch
1 From ef8eb0991f291df12c12477648235f955cc388b0 Mon Sep 17 00:00:00 2001
2 From: Josh Cartwright <joshc@codeaurora.org>
3 Date: Wed, 5 Mar 2014 13:33:08 -0600
4 Subject: [PATCH 025/182] pinctrl: msm: drop wake_irqs bitmap
5
6 Currently, the wake_irqs bitmap is used to track whether there are any
7 gpio's which are configured as wake irqs, and uses this to determine
8 whether or not to call enable_irq_wake()/disable_irq_wake() on the
9 summary interrupt.
10
11 However, the genirq core already handles this case, by maintaining a
12 'wake_count' per irq_desc, and only calling into the controlling
13 irq_chip when wake_count transitions 0 <-> 1.
14
15 Drop this bitmap, and unconditionally call irq_set_irq_wake() on the
16 summary interrupt.
17
18 Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
19 Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
20 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
21 ---
22 drivers/pinctrl/pinctrl-msm.c | 14 +-------------
23 1 file changed, 1 insertion(+), 13 deletions(-)
24
25 diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c
26 index ef2bf31..0e43fdd 100644
27 --- a/drivers/pinctrl/pinctrl-msm.c
28 +++ b/drivers/pinctrl/pinctrl-msm.c
29 @@ -50,7 +50,6 @@
30 * @enabled_irqs: Bitmap of currently enabled irqs.
31 * @dual_edge_irqs: Bitmap of irqs that need sw emulated dual edge
32 * detection.
33 - * @wake_irqs: Bitmap of irqs with requested as wakeup source.
34 * @soc; Reference to soc_data of platform specific data.
35 * @regs: Base address for the TLMM register map.
36 */
37 @@ -65,7 +64,6 @@ struct msm_pinctrl {
38
39 DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO);
40 DECLARE_BITMAP(enabled_irqs, MAX_NR_GPIO);
41 - DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO);
42
43 const struct msm_pinctrl_soc_data *soc;
44 void __iomem *regs;
45 @@ -783,22 +781,12 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
46 {
47 struct msm_pinctrl *pctrl;
48 unsigned long flags;
49 - unsigned ngpio;
50
51 pctrl = irq_data_get_irq_chip_data(d);
52 - ngpio = pctrl->chip.ngpio;
53
54 spin_lock_irqsave(&pctrl->lock, flags);
55
56 - if (on) {
57 - if (bitmap_empty(pctrl->wake_irqs, ngpio))
58 - enable_irq_wake(pctrl->irq);
59 - set_bit(d->hwirq, pctrl->wake_irqs);
60 - } else {
61 - clear_bit(d->hwirq, pctrl->wake_irqs);
62 - if (bitmap_empty(pctrl->wake_irqs, ngpio))
63 - disable_irq_wake(pctrl->irq);
64 - }
65 + irq_set_irq_wake(pctrl->irq, on);
66
67 spin_unlock_irqrestore(&pctrl->lock, flags);
68
69 --
70 1.7.10.4
71