diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2011-07-09 16:31:49 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-07-12 20:28:01 -0700 |
commit | 91324a624c1892fa36ded278eeca4bf353241438 (patch) | |
tree | b242e24da9570646c06c2fb38339a7dfa568e63e | |
parent | 0215493c1a6e2f3b7a6c1ebd53cb46d7ae18eee2 (diff) | |
download | kernel_samsung_tuna-91324a624c1892fa36ded278eeca4bf353241438.zip kernel_samsung_tuna-91324a624c1892fa36ded278eeca4bf353241438.tar.gz kernel_samsung_tuna-91324a624c1892fa36ded278eeca4bf353241438.tar.bz2 |
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 <santosh.shilimkar@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/omap-wakeupgen.c | 37 |
1 files 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; } |