All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	Chanho Park <chanho61.park@samsung.com>,
	Tushar Behera <tushar.behera@linaro.org>,
	Tomasz Figa <t.figa@samsung.com>,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Arnd Bergmann <arnd@arndb.de>, Arnd Bergmann <arnd@arnd.de>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 6/7] irqchip: exynos: localize irq lookup for ATAGS
Date: Fri, 12 Apr 2013 16:03:24 +0200	[thread overview]
Message-ID: <1365775405-115297-7-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1365775405-115297-1-git-send-email-arnd@arndb.de>

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: Arnd Bergmann <arnd@arnd.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/exynos-combiner.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c
index 7fcdeee..acb9c74 100644
--- a/drivers/irqchip/exynos-combiner.c
+++ b/drivers/irqchip/exynos-combiner.c
@@ -18,7 +18,9 @@
 #include <linux/of_irq.h>
 #include <asm/mach/irq.h>
 
+#ifdef CONFIG_EXYNOS_ATAGS
 #include <plat/cpu.h>
+#endif
 
 #include "irqchip.h"
 
@@ -182,8 +184,12 @@ static struct irq_domain_ops combiner_irq_domain_ops = {
 	.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) {
 	case 16:
 		return IRQ_SPI(107);
@@ -193,9 +199,9 @@ static unsigned int exynos4x12_combiner_extra_irq(int group)
 		return IRQ_SPI(48);
 	case 19:
 		return IRQ_SPI(42);
-	default:
-		return 0;
 	}
+#endif
+	return 0;
 }
 
 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++) {
-		if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
-			irq = IRQ_SPI(i);
-		else
-			irq = exynos4x12_combiner_extra_irq(i);
 #ifdef CONFIG_OF
 		if (np)
 			irq = irq_of_parse_and_map(np, i);
+		else
 #endif
+			irq = combiner_lookup_irq(i);
+
 		combiner_init_one(&combiner_data[i], i,
 				  combiner_base + (i >> 2) * 0x10, irq);
 		combiner_cascade_irq(&combiner_data[i], irq);
-- 
1.8.1.2

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7] irqchip: exynos: localize irq lookup for ATAGS
Date: Fri, 12 Apr 2013 16:03:24 +0200	[thread overview]
Message-ID: <1365775405-115297-7-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1365775405-115297-1-git-send-email-arnd@arndb.de>

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: Arnd Bergmann <arnd@arnd.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/exynos-combiner.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c
index 7fcdeee..acb9c74 100644
--- a/drivers/irqchip/exynos-combiner.c
+++ b/drivers/irqchip/exynos-combiner.c
@@ -18,7 +18,9 @@
 #include <linux/of_irq.h>
 #include <asm/mach/irq.h>
 
+#ifdef CONFIG_EXYNOS_ATAGS
 #include <plat/cpu.h>
+#endif
 
 #include "irqchip.h"
 
@@ -182,8 +184,12 @@ static struct irq_domain_ops combiner_irq_domain_ops = {
 	.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) {
 	case 16:
 		return IRQ_SPI(107);
@@ -193,9 +199,9 @@ static unsigned int exynos4x12_combiner_extra_irq(int group)
 		return IRQ_SPI(48);
 	case 19:
 		return IRQ_SPI(42);
-	default:
-		return 0;
 	}
+#endif
+	return 0;
 }
 
 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++) {
-		if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
-			irq = IRQ_SPI(i);
-		else
-			irq = exynos4x12_combiner_extra_irq(i);
 #ifdef CONFIG_OF
 		if (np)
 			irq = irq_of_parse_and_map(np, i);
+		else
 #endif
+			irq = combiner_lookup_irq(i);
+
 		combiner_init_one(&combiner_data[i], i,
 				  combiner_base + (i >> 2) * 0x10, irq);
 		combiner_cascade_irq(&combiner_data[i], irq);
-- 
1.8.1.2

  parent reply	other threads:[~2013-04-12 14:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 14:03 [PATCH 0/7] exynos multiplatform support, part 2 Arnd Bergmann
2013-04-12 14:03 ` Arnd Bergmann
2013-04-12 14:03 ` [PATCH 1/7] clk: exynos: prepare for multiplatform Arnd Bergmann
2013-04-12 14:03   ` Arnd Bergmann
2013-04-15  6:31   ` Thomas Abraham
2013-04-15  6:31     ` Thomas Abraham
2013-04-15  8:35     ` Arnd Bergmann
2013-04-15  8:35       ` Arnd Bergmann
2013-04-15 17:20       ` Sylwester Nawrocki
2013-04-15 17:20         ` Sylwester Nawrocki
2013-04-12 14:03 ` [PATCH 2/7] clocksource: exynos_mct: remove platform header dependency Arnd Bergmann
2013-04-12 14:03   ` Arnd Bergmann
2013-04-12 14:03 ` [PATCH 3/7] ARM: exynos: add missing properties for combiner IRQs Arnd Bergmann
2013-04-12 14:03   ` Arnd Bergmann
2013-04-15  6:27   ` Thomas Abraham
2013-04-15  6:27     ` Thomas Abraham
2013-04-15  8:36     ` Arnd Bergmann
2013-04-15  8:36       ` Arnd Bergmann
2013-04-15  6:43   ` Sachin Kamat
2013-04-15  6:43     ` Sachin Kamat
2013-04-15  8:41     ` Arnd Bergmann
2013-04-15  8:41       ` Arnd Bergmann
2013-04-15 11:32       ` Sachin Kamat
2013-04-15 11:32         ` Sachin Kamat
2013-04-15 12:20         ` Arnd Bergmann
2013-04-15 12:20           ` Arnd Bergmann
2013-04-15 12:45           ` Sachin Kamat
2013-04-15 12:45             ` Sachin Kamat
2013-04-12 14:03 ` [PATCH 4/7] irqchip: exynos: pass max combiner number to combiner_init Arnd Bergmann
2013-04-12 14:03   ` Arnd Bergmann
2013-04-12 14:03 ` [PATCH 5/7] irqchip: exynos: allocate combiner_data dynamically Arnd Bergmann
2013-04-12 14:03   ` Arnd Bergmann
2013-04-12 14:03 ` Arnd Bergmann [this message]
2013-04-12 14:03   ` [PATCH 6/7] irqchip: exynos: localize irq lookup for ATAGS Arnd Bergmann
2013-04-12 14:03 ` [PATCH 7/7] irqchip: exynos: pass irq_base from platform Arnd Bergmann
2013-04-12 14:03   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365775405-115297-7-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=arnd@arnd.de \
    --cc=chanho61.park@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=t.figa@samsung.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.abraham@linaro.org \
    --cc=tushar.behera@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.