Commit 05b8ce82 authored by Kevin Cernekee's avatar Kevin Cernekee Committed by Jason Cooper

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: default avatarKevin Cernekee <cernekee@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lkml.kernel.org/r/1415342669-30640-11-git-send-email-cernekee@gmail.comSigned-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent 0b5cb32c
...@@ -37,7 +37,6 @@ struct bcm7120_l2_intc_data { ...@@ -37,7 +37,6 @@ struct bcm7120_l2_intc_data {
bool can_wake; bool can_wake;
u32 irq_fwd_mask; u32 irq_fwd_mask;
u32 irq_map_mask; u32 irq_map_mask;
u32 saved_mask;
}; };
static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc) 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,14 +61,11 @@ static void bcm7120_l2_intc_suspend(struct irq_data *d)
{ {
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct bcm7120_l2_intc_data *b = gc->private; struct bcm7120_l2_intc_data *b = gc->private;
u32 reg;
irq_gc_lock(gc); irq_gc_lock(gc);
/* Save the current mask and the interrupt forward mask */
b->saved_mask = __raw_readl(b->base + IRQEN) | b->irq_fwd_mask;
if (b->can_wake) { if (b->can_wake) {
reg = b->saved_mask | gc->wake_active; __raw_writel(gc->mask_cache | gc->wake_active,
__raw_writel(reg, b->base + IRQEN); b->base + IRQEN);
} }
irq_gc_unlock(gc); irq_gc_unlock(gc);
} }
...@@ -77,11 +73,10 @@ static void bcm7120_l2_intc_suspend(struct irq_data *d) ...@@ -77,11 +73,10 @@ static void bcm7120_l2_intc_suspend(struct irq_data *d)
static void bcm7120_l2_intc_resume(struct irq_data *d) static void bcm7120_l2_intc_resume(struct irq_data *d)
{ {
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct bcm7120_l2_intc_data *b = gc->private;
/* Restore the saved mask */ /* Restore the saved mask */
irq_gc_lock(gc); irq_gc_lock(gc);
__raw_writel(b->saved_mask, b->base + IRQEN); __raw_writel(gc->mask_cache, b->base + IRQEN);
irq_gc_unlock(gc); irq_gc_unlock(gc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment