diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2014-11-07 01:44:25 -0500 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-11-08 23:02:59 -0500 |
commit | 05b8ce8260b069b0d59516711e2795758f203556 (patch) | |
tree | 01accad688e24b07f038a2aa388dbe5fe46bd210 | |
parent | 0b5cb32ca5aea14bfcfda380e5da67b0abf35b4b (diff) |
irqchip: bcm7120-l2: Use gc->mask_cache to simplify suspend/resume functions
The cached value already incorporates irq_fwd_mask, and was saved the
last time an IRQ was enabled/disabled.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lkml.kernel.org/r/1415342669-30640-11-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r-- | drivers/irqchip/irq-bcm7120-l2.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c index b70679f8bb65..984112112042 100644 --- a/drivers/irqchip/irq-bcm7120-l2.c +++ b/drivers/irqchip/irq-bcm7120-l2.c | |||
@@ -37,7 +37,6 @@ struct bcm7120_l2_intc_data { | |||
37 | bool can_wake; | 37 | bool can_wake; |
38 | u32 irq_fwd_mask; | 38 | u32 irq_fwd_mask; |
39 | u32 irq_map_mask; | 39 | u32 irq_map_mask; |
40 | u32 saved_mask; | ||
41 | }; | 40 | }; |
42 | 41 | ||
43 | static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc) | 42 | static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc) |
@@ -62,14 +61,11 @@ static void bcm7120_l2_intc_suspend(struct irq_data *d) | |||
62 | { | 61 | { |
63 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 62 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
64 | struct bcm7120_l2_intc_data *b = gc->private; | 63 | struct bcm7120_l2_intc_data *b = gc->private; |
65 | u32 reg; | ||
66 | 64 | ||
67 | irq_gc_lock(gc); | 65 | irq_gc_lock(gc); |
68 | /* Save the current mask and the interrupt forward mask */ | ||
69 | b->saved_mask = __raw_readl(b->base + IRQEN) | b->irq_fwd_mask; | ||
70 | if (b->can_wake) { | 66 | if (b->can_wake) { |
71 | reg = b->saved_mask | gc->wake_active; | 67 | __raw_writel(gc->mask_cache | gc->wake_active, |
72 | __raw_writel(reg, b->base + IRQEN); | 68 | b->base + IRQEN); |
73 | } | 69 | } |
74 | irq_gc_unlock(gc); | 70 | irq_gc_unlock(gc); |
75 | } | 71 | } |
@@ -77,11 +73,10 @@ static void bcm7120_l2_intc_suspend(struct irq_data *d) | |||
77 | static void bcm7120_l2_intc_resume(struct irq_data *d) | 73 | static void bcm7120_l2_intc_resume(struct irq_data *d) |
78 | { | 74 | { |
79 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 75 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
80 | struct bcm7120_l2_intc_data *b = gc->private; | ||
81 | 76 | ||
82 | /* Restore the saved mask */ | 77 | /* Restore the saved mask */ |
83 | irq_gc_lock(gc); | 78 | irq_gc_lock(gc); |
84 | __raw_writel(b->saved_mask, b->base + IRQEN); | 79 | __raw_writel(gc->mask_cache, b->base + IRQEN); |
85 | irq_gc_unlock(gc); | 80 | irq_gc_unlock(gc); |
86 | } | 81 | } |
87 | 82 | ||