Commit 4c0d214144bcedc0b3582c88d6313055949755b5
Committed by
Chris Zankel
1 parent
72197b18bc
Exists in
master
and in
7 other branches
xtensa: variant irq set callbacks
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>
Showing 3 changed files with 24 additions and 0 deletions Side-by-side Diff
arch/xtensa/Kconfig
arch/xtensa/include/asm/irq.h
| ... | ... | @@ -14,6 +14,13 @@ |
| 14 | 14 | #include <platform/hardware.h> |
| 15 | 15 | #include <variant/core.h> |
| 16 | 16 | |
| 17 | +#ifdef CONFIG_VARIANT_IRQ_SWITCH | |
| 18 | +#include <variant/irq.h> | |
| 19 | +#else | |
| 20 | +static inline void variant_irq_enable(unsigned int irq) { } | |
| 21 | +static inline void variant_irq_disable(unsigned int irq) { } | |
| 22 | +#endif | |
| 23 | + | |
| 17 | 24 | #ifndef PLATFORM_NR_IRQS |
| 18 | 25 | # define PLATFORM_NR_IRQS 0 |
| 19 | 26 | #endif |
arch/xtensa/kernel/irq.c
| ... | ... | @@ -132,6 +132,18 @@ |
| 132 | 132 | set_sr (cached_irq_mask, INTENABLE); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | +static void xtensa_irq_enable(unsigned int irq) | |
| 136 | +{ | |
| 137 | + variant_irq_enable(irq); | |
| 138 | + xtensa_irq_unmask(irq); | |
| 139 | +} | |
| 140 | + | |
| 141 | +static void xtensa_irq_disable(unsigned int irq) | |
| 142 | +{ | |
| 143 | + xtensa_irq_mask(irq); | |
| 144 | + variant_irq_disable(irq); | |
| 145 | +} | |
| 146 | + | |
| 135 | 147 | static void xtensa_irq_ack(unsigned int irq) |
| 136 | 148 | { |
| 137 | 149 | set_sr(1 << irq, INTCLEAR); |
| ... | ... | @@ -146,6 +158,8 @@ |
| 146 | 158 | |
| 147 | 159 | static struct irq_chip xtensa_irq_chip = { |
| 148 | 160 | .name = "xtensa", |
| 161 | + .enable = xtensa_irq_enable, | |
| 162 | + .disable = xtensa_irq_disable, | |
| 149 | 163 | .mask = xtensa_irq_mask, |
| 150 | 164 | .unmask = xtensa_irq_unmask, |
| 151 | 165 | .ack = xtensa_irq_ack, |