Commit 4c0d2141 authored by Johannes Weiner's avatar Johannes Weiner Committed by Chris Zankel

xtensa: variant irq set callbacks

Allow the core variant code to provide irq enable/disable callbacks.
Signed-off-by: default avatarJohannes Weiner <jw@emlix.com>
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 72197b18
...@@ -51,6 +51,9 @@ source "kernel/Kconfig.freezer" ...@@ -51,6 +51,9 @@ source "kernel/Kconfig.freezer"
config MMU config MMU
def_bool n def_bool n
config VARIANT_IRQ_SWITCH
def_bool n
menu "Processor type and features" menu "Processor type and features"
choice choice
......
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
#include <platform/hardware.h> #include <platform/hardware.h>
#include <variant/core.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 #ifndef PLATFORM_NR_IRQS
# define PLATFORM_NR_IRQS 0 # define PLATFORM_NR_IRQS 0
#endif #endif
......
...@@ -132,6 +132,18 @@ static void xtensa_irq_unmask(unsigned int irq) ...@@ -132,6 +132,18 @@ static void xtensa_irq_unmask(unsigned int irq)
set_sr (cached_irq_mask, INTENABLE); 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) static void xtensa_irq_ack(unsigned int irq)
{ {
set_sr(1 << irq, INTCLEAR); set_sr(1 << irq, INTCLEAR);
...@@ -146,6 +158,8 @@ static int xtensa_irq_retrigger(unsigned int irq) ...@@ -146,6 +158,8 @@ static int xtensa_irq_retrigger(unsigned int irq)
static struct irq_chip xtensa_irq_chip = { static struct irq_chip xtensa_irq_chip = {
.name = "xtensa", .name = "xtensa",
.enable = xtensa_irq_enable,
.disable = xtensa_irq_disable,
.mask = xtensa_irq_mask, .mask = xtensa_irq_mask,
.unmask = xtensa_irq_unmask, .unmask = xtensa_irq_unmask,
.ack = xtensa_irq_ack, .ack = xtensa_irq_ack,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment