From 4c0d214144bcedc0b3582c88d6313055949755b5 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Wed, 4 Mar 2009 16:21:31 +0100 Subject: xtensa: variant irq set callbacks Allow the core variant code to provide irq enable/disable callbacks. Signed-off-by: Johannes Weiner Signed-off-by: Chris Zankel --- arch/xtensa/Kconfig | 3 +++ arch/xtensa/include/asm/irq.h | 7 +++++++ arch/xtensa/kernel/irq.c | 14 ++++++++++++++ 3 files changed, 24 insertions(+) (limited to 'arch') diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index cf2501b5afd4..705bb71af245 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -51,6 +51,9 @@ source "kernel/Kconfig.freezer" config MMU def_bool n +config VARIANT_IRQ_SWITCH + def_bool n + menu "Processor type and features" choice diff --git a/arch/xtensa/include/asm/irq.h b/arch/xtensa/include/asm/irq.h index 1620d1e0e695..dfac82dc52ad 100644 --- a/arch/xtensa/include/asm/irq.h +++ b/arch/xtensa/include/asm/irq.h @@ -14,6 +14,13 @@ #include #include +#ifdef CONFIG_VARIANT_IRQ_SWITCH +#include +#else +static inline void variant_irq_enable(unsigned int irq) { } +static inline void variant_irq_disable(unsigned int irq) { } +#endif + #ifndef PLATFORM_NR_IRQS # define PLATFORM_NR_IRQS 0 #endif diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index f3b66fba5b8f..a36c85edd045 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c @@ -132,6 +132,18 @@ static void xtensa_irq_unmask(unsigned int irq) set_sr (cached_irq_mask, INTENABLE); } +static void xtensa_irq_enable(unsigned int irq) +{ + variant_irq_enable(irq); + xtensa_irq_unmask(irq); +} + +static void xtensa_irq_disable(unsigned int irq) +{ + xtensa_irq_mask(irq); + variant_irq_disable(irq); +} + static void xtensa_irq_ack(unsigned int irq) { set_sr(1 << irq, INTCLEAR); @@ -146,6 +158,8 @@ static int xtensa_irq_retrigger(unsigned int irq) static struct irq_chip xtensa_irq_chip = { .name = "xtensa", + .enable = xtensa_irq_enable, + .disable = xtensa_irq_disable, .mask = xtensa_irq_mask, .unmask = xtensa_irq_unmask, .ack = xtensa_irq_ack, -- cgit v1.2.3