kernel: update 3.14 to 3.14.18
[openwrt/openwrt.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 --- a/drivers/pinctrl/pinctrl-msm.c
26 +++ b/drivers/pinctrl/pinctrl-msm.c
27 @@ -50,7 +50,6 @@
28 * @enabled_irqs: Bitmap of currently enabled irqs.
29 * @dual_edge_irqs: Bitmap of irqs that need sw emulated dual edge
30 * detection.
31 - * @wake_irqs: Bitmap of irqs with requested as wakeup source.
32 * @soc; Reference to soc_data of platform specific data.
33 * @regs: Base address for the TLMM register map.
34 */
35 @@ -65,7 +64,6 @@ struct msm_pinctrl {
36
37 DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO);
38 DECLARE_BITMAP(enabled_irqs, MAX_NR_GPIO);
39 - DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO);
40
41 const struct msm_pinctrl_soc_data *soc;
42 void __iomem *regs;
43 @@ -783,22 +781,12 @@ static int msm_gpio_irq_set_wake(struct
44 {
45 struct msm_pinctrl *pctrl;
46 unsigned long flags;
47 - unsigned ngpio;
48
49 pctrl = irq_data_get_irq_chip_data(d);
50 - ngpio = pctrl->chip.ngpio;
51
52 spin_lock_irqsave(&pctrl->lock, flags);
53
54 - if (on) {
55 - if (bitmap_empty(pctrl->wake_irqs, ngpio))
56 - enable_irq_wake(pctrl->irq);
57 - set_bit(d->hwirq, pctrl->wake_irqs);
58 - } else {
59 - clear_bit(d->hwirq, pctrl->wake_irqs);
60 - if (bitmap_empty(pctrl->wake_irqs, ngpio))
61 - disable_irq_wake(pctrl->irq);
62 - }
63 + irq_set_irq_wake(pctrl->irq, on);
64
65 spin_unlock_irqrestore(&pctrl->lock, flags);
66