Commit 92c8e496 authored by Arnd Bergmann's avatar Arnd Bergmann

irqchip: exynos: localize irq lookup for ATAGS

The IRQ_SPI() macro is not available in the driver when building with sparse
IRQs or multiplatform, so let's move all users of this into one function
that we can leave out when building DT-only.
Signed-off-by: default avatarArnd Bergmann <arnd@arnd.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
parent d34f03d4
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#ifdef CONFIG_EXYNOS_ATAGS
#include <plat/cpu.h> #include <plat/cpu.h>
#endif
#include "irqchip.h" #include "irqchip.h"
...@@ -182,8 +184,12 @@ static struct irq_domain_ops combiner_irq_domain_ops = { ...@@ -182,8 +184,12 @@ static struct irq_domain_ops combiner_irq_domain_ops = {
.map = combiner_irq_domain_map, .map = combiner_irq_domain_map,
}; };
static unsigned int exynos4x12_combiner_extra_irq(int group) static unsigned int combiner_lookup_irq(int group)
{ {
#ifdef CONFIG_EXYNOS_ATAGS
if (group < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
return IRQ_SPI(group);
switch (group) { switch (group) {
case 16: case 16:
return IRQ_SPI(107); return IRQ_SPI(107);
...@@ -193,9 +199,9 @@ static unsigned int exynos4x12_combiner_extra_irq(int group) ...@@ -193,9 +199,9 @@ static unsigned int exynos4x12_combiner_extra_irq(int group)
return IRQ_SPI(48); return IRQ_SPI(48);
case 19: case 19:
return IRQ_SPI(42); return IRQ_SPI(42);
default:
return 0;
} }
#endif
return 0;
} }
void __init combiner_init(void __iomem *combiner_base, void __init combiner_init(void __iomem *combiner_base,
...@@ -228,14 +234,13 @@ void __init combiner_init(void __iomem *combiner_base, ...@@ -228,14 +234,13 @@ void __init combiner_init(void __iomem *combiner_base,
} }
for (i = 0; i < max_nr; i++) { for (i = 0; i < max_nr; i++) {
if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
irq = IRQ_SPI(i);
else
irq = exynos4x12_combiner_extra_irq(i);
#ifdef CONFIG_OF #ifdef CONFIG_OF
if (np) if (np)
irq = irq_of_parse_and_map(np, i); irq = irq_of_parse_and_map(np, i);
else
#endif #endif
irq = combiner_lookup_irq(i);
combiner_init_one(&combiner_data[i], i, combiner_init_one(&combiner_data[i], i,
combiner_base + (i >> 2) * 0x10, irq); combiner_base + (i >> 2) * 0x10, irq);
combiner_cascade_irq(&combiner_data[i], irq); combiner_cascade_irq(&combiner_data[i], irq);
......
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