From 91324a624c1892fa36ded278eeca4bf353241438 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Sat, 9 Jul 2011 16:31:49 -0700 Subject: OMAP4: irq: Make use of IRQCHIP_MASK_ON_SUSPEND flag. With IRQCHIP_MASK_ON_SUSPEND flag set for a irqchip, generic irq code mask all non-wakeup irqs and keep wakeup irqs unmasked in suspend which is desirable. Hence make use of this flag for OMAP4 irqchip. This flag usage makes irq_set_wake() useless, so drop this function. While at this, make the OMAP4 irq code respect irq affinity. Signed-off-by: Santosh Shilimkar --- arch/arm/mach-omap2/omap-wakeupgen.c | 37 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c index 345a55c..472da57 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c @@ -100,9 +100,8 @@ static inline int _wakeupgen_get_irq_info(u32 irq, u32 *bit_posn, u8 *reg_index) return 0; } -static void _wakeupgen_clear(unsigned int irq) +static void _wakeupgen_clear(unsigned int irq, unsigned int cpu) { - unsigned int cpu = smp_processor_id(); u32 val, bit_number; u8 i; @@ -114,9 +113,8 @@ static void _wakeupgen_clear(unsigned int irq) wakeupgen_writel(val, i, cpu); } -static void _wakeupgen_set(unsigned int irq) +static void _wakeupgen_set(unsigned int irq, unsigned int cpu) { - unsigned int cpu = smp_processor_id(); u32 val, bit_number; u8 i; @@ -149,8 +147,11 @@ static void _wakeupgen_restore_masks(unsigned int cpu) */ static void wakeupgen_mask(struct irq_data *d) { + unsigned int cpu; + spin_lock(&wakeupgen_lock); - _wakeupgen_clear(d->irq); + for_each_cpu(cpu, d->affinity) + _wakeupgen_clear(d->irq, cpu); spin_unlock(&wakeupgen_lock); } @@ -159,32 +160,14 @@ static void wakeupgen_mask(struct irq_data *d) */ static void wakeupgen_unmask(struct irq_data *d) { + unsigned int cpu; spin_lock(&wakeupgen_lock); - _wakeupgen_set(d->irq); + for_each_cpu(cpu, d->affinity) + _wakeupgen_set(d->irq, cpu); spin_unlock(&wakeupgen_lock); } -#ifdef CONFIG_PM -/* - * Architecture specific set_wake extension - */ -static int wakeupgen_set_wake(struct irq_data *d, unsigned int on) -{ - spin_lock(&wakeupgen_lock); - if (on) - _wakeupgen_set(d->irq); - else - _wakeupgen_clear(d->irq); - spin_unlock(&wakeupgen_lock); - - return 0; -} - -#else -#define wakeupgen_set_wake NULL -#endif - /** * omap_wakeupgen_irqmask_all() - Mask or unmask interrupts * @cpu - CPU ID @@ -241,7 +224,7 @@ int __init omap_wakeupgen_init(void) */ gic_arch_extn.irq_mask = wakeupgen_mask; gic_arch_extn.irq_unmask = wakeupgen_unmask; - gic_arch_extn.irq_set_wake = wakeupgen_set_wake; + gic_arch_extn.flags = IRQCHIP_MASK_ON_SUSPEND; return 0; } -- cgit v1.1