mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
genirq: Generic chip: Cache per irq bit mask
Cache the per irq bit mask instead of recalculating it over and over. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Thomas Petazzoni <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Russell King - ARM Linux <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Jean-Francois Moine <[email protected]> Cc: [email protected] Cc: Rob Herring <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Gregory Clement <[email protected]> Cc: Gerlando Falauto <[email protected]> Cc: Rob Landley <[email protected]> Acked-by: Grant Likely <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Ezequiel Garcia <[email protected]> Cc: [email protected] Cc: Sebastian Hesselbarth <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
af80b0fed6
commit
966dc736b8
2 changed files with 18 additions and 9 deletions
|
|
@ -35,7 +35,7 @@ void irq_gc_mask_disable_reg(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
irq_reg_writel(mask, gc->reg_base + ct->regs.disable);
|
||||
|
|
@ -54,7 +54,7 @@ void irq_gc_mask_set_bit(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
*ct->mask_cache |= mask;
|
||||
|
|
@ -73,7 +73,7 @@ void irq_gc_mask_clr_bit(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
*ct->mask_cache &= ~mask;
|
||||
|
|
@ -92,7 +92,7 @@ void irq_gc_unmask_enable_reg(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
irq_reg_writel(mask, gc->reg_base + ct->regs.enable);
|
||||
|
|
@ -108,7 +108,7 @@ void irq_gc_ack_set_bit(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
irq_reg_writel(mask, gc->reg_base + ct->regs.ack);
|
||||
|
|
@ -123,7 +123,7 @@ void irq_gc_ack_clr_bit(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = ~(1 << (d->irq - gc->irq_base));
|
||||
u32 mask = ~d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
irq_reg_writel(mask, gc->reg_base + ct->regs.ack);
|
||||
|
|
@ -138,7 +138,7 @@ void irq_gc_mask_disable_reg_and_ack(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
irq_reg_writel(mask, gc->reg_base + ct->regs.mask);
|
||||
|
|
@ -154,7 +154,7 @@ void irq_gc_eoi(struct irq_data *d)
|
|||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
struct irq_chip_type *ct = irq_data_get_chip_type(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
irq_gc_lock(gc);
|
||||
irq_reg_writel(mask, gc->reg_base + ct->regs.eoi);
|
||||
|
|
@ -172,7 +172,7 @@ void irq_gc_eoi(struct irq_data *d)
|
|||
int irq_gc_set_wake(struct irq_data *d, unsigned int on)
|
||||
{
|
||||
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
|
||||
u32 mask = 1 << (d->irq - gc->irq_base);
|
||||
u32 mask = d->mask;
|
||||
|
||||
if (!(mask & gc->wake_enabled))
|
||||
return -EINVAL;
|
||||
|
|
@ -264,6 +264,11 @@ void irq_setup_generic_chip(struct irq_chip_generic *gc, u32 msk,
|
|||
if (flags & IRQ_GC_INIT_NESTED_LOCK)
|
||||
irq_set_lockdep_class(i, &irq_nested_lock_class);
|
||||
|
||||
if (!(flags & IRQ_GC_NO_MASK)) {
|
||||
struct irq_data *d = irq_get_irq_data(i);
|
||||
|
||||
d->mask = 1 << (i - gc->irq_base);
|
||||
}
|
||||
irq_set_chip_and_handler(i, &ct->chip, ct->handler);
|
||||
irq_set_chip_data(i, gc);
|
||||
irq_modify_status(i, clr, set);
|
||||
|
|
|
|||
Loading…
Reference in a new issue