xtensa: variant irq set callbacks
authorJohannes Weiner <jw@emlix.com>
Wed, 4 Mar 2009 15:21:31 +0000 (16:21 +0100)
committerChris Zankel <chris@zankel.net>
Fri, 3 Apr 2009 06:43:01 +0000 (23:43 -0700)
Allow the core variant code to provide irq enable/disable callbacks.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/Kconfig
arch/xtensa/include/asm/irq.h
arch/xtensa/kernel/irq.c

index cf2501b5afd43ea6a9f76deff326b1d60f180ef4..705bb71af245c8350eaa95c6a660afd535fe0028 100644 (file)
@@ -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
index 1620d1e0e695a038e8f93535471a9b8ce008a89a..dfac82dc52ad2eaea2945f267379bad17deab2ca 100644 (file)
 #include <platform/hardware.h>
 #include <variant/core.h>
 
+#ifdef CONFIG_VARIANT_IRQ_SWITCH
+#include <variant/irq.h>
+#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
index f3b66fba5b8f71f0f45700601b9117dd865ae9b9..a36c85edd04588b59129f25eb17dd646a5c5b982 100644 (file)
@@ -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,