aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-07-04 12:31:36 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-11-07 04:37:37 -0500
commit5702941eec32cfd7b8cf9e36a0936e48170011a4 (patch)
treef9a04d0c3b9683de5d02af31366dd8acbc0bb972
parentb8d490c3de797c88cfcc3364c6e04d8900121cf9 (diff)
irqchip: bcm2835: Convert to use IRQCHIP_DECLARE macro
This patch converts irq-bcm2835 driver to use the new IRQCHIP_DECLARE and irqchip_init. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Cc: Simon Arlott <simon@fire.lp0.eu> Cc: Olof Johansson <olof@lixom.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/arm/mach-bcm2835/bcm2835.c5
-rw-r--r--drivers/irqchip/irq-bcm2835.c22
-rw-r--r--include/linux/irqchip/bcm2835.h29
3 files changed, 12 insertions, 44 deletions
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c
index 40686d7ef500..a4abd851905a 100644
--- a/arch/arm/mach-bcm2835/bcm2835.c
+++ b/arch/arm/mach-bcm2835/bcm2835.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/irqchip/bcm2835.h> 17#include <linux/irqchip.h>
18#include <linux/of_address.h> 18#include <linux/of_address.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/clk/bcm2835.h> 20#include <linux/clk/bcm2835.h>
@@ -131,8 +131,7 @@ static const char * const bcm2835_compat[] = {
131 131
132DT_MACHINE_START(BCM2835, "BCM2835") 132DT_MACHINE_START(BCM2835, "BCM2835")
133 .map_io = bcm2835_map_io, 133 .map_io = bcm2835_map_io,
134 .init_irq = bcm2835_init_irq, 134 .init_irq = irqchip_init,
135 .handle_irq = bcm2835_handle_irq,
136 .init_machine = bcm2835_init, 135 .init_machine = bcm2835_init,
137 .init_time = clocksource_of_init, 136 .init_time = clocksource_of_init,
138 .restart = bcm2835_restart, 137 .restart = bcm2835_restart,
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c
index 16c78f1c5ef2..1693b8e7f26a 100644
--- a/drivers/irqchip/irq-bcm2835.c
+++ b/drivers/irqchip/irq-bcm2835.c
@@ -49,9 +49,11 @@
49#include <linux/of_address.h> 49#include <linux/of_address.h>
50#include <linux/of_irq.h> 50#include <linux/of_irq.h>
51#include <linux/irqdomain.h> 51#include <linux/irqdomain.h>
52#include <linux/irqchip/bcm2835.h>
53 52
54#include <asm/exception.h> 53#include <asm/exception.h>
54#include <asm/mach/irq.h>
55
56#include "irqchip.h"
55 57
56/* Put the bank and irq (32 bits) into the hwirq */ 58/* Put the bank and irq (32 bits) into the hwirq */
57#define MAKE_HWIRQ(b, n) ((b << 5) | (n)) 59#define MAKE_HWIRQ(b, n) ((b << 5) | (n))
@@ -93,6 +95,8 @@ struct armctrl_ic {
93}; 95};
94 96
95static struct armctrl_ic intc __read_mostly; 97static struct armctrl_ic intc __read_mostly;
98static asmlinkage void __exception_irq_entry bcm2835_handle_irq(
99 struct pt_regs *regs);
96 100
97static void armctrl_mask_irq(struct irq_data *d) 101static void armctrl_mask_irq(struct irq_data *d)
98{ 102{
@@ -164,17 +168,9 @@ static int __init armctrl_of_init(struct device_node *node,
164 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 168 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
165 } 169 }
166 } 170 }
167 return 0;
168}
169
170static struct of_device_id irq_of_match[] __initconst = {
171 { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init },
172 { }
173};
174 171
175void __init bcm2835_init_irq(void) 172 set_handle_irq(bcm2835_handle_irq);
176{ 173 return 0;
177 of_irq_init(irq_of_match);
178} 174}
179 175
180/* 176/*
@@ -200,7 +196,7 @@ static void armctrl_handle_shortcut(int bank, struct pt_regs *regs,
200 handle_IRQ(irq_linear_revmap(intc.domain, irq), regs); 196 handle_IRQ(irq_linear_revmap(intc.domain, irq), regs);
201} 197}
202 198
203asmlinkage void __exception_irq_entry bcm2835_handle_irq( 199static asmlinkage void __exception_irq_entry bcm2835_handle_irq(
204 struct pt_regs *regs) 200 struct pt_regs *regs)
205{ 201{
206 u32 stat, irq; 202 u32 stat, irq;
@@ -222,3 +218,5 @@ asmlinkage void __exception_irq_entry bcm2835_handle_irq(
222 } 218 }
223 } 219 }
224} 220}
221
222IRQCHIP_DECLARE(bcm2835_armctrl_ic, "brcm,bcm2835-armctrl-ic", armctrl_of_init);
diff --git a/include/linux/irqchip/bcm2835.h b/include/linux/irqchip/bcm2835.h
deleted file mode 100644
index 48a859bc9dca..000000000000
--- a/include/linux/irqchip/bcm2835.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * Copyright (C) 2010 Broadcom
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __LINUX_IRQCHIP_BCM2835_H_
20#define __LINUX_IRQCHIP_BCM2835_H_
21
22#include <asm/exception.h>
23
24extern void bcm2835_init_irq(void);
25
26extern asmlinkage void __exception_irq_entry bcm2835_handle_irq(
27 struct pt_regs *regs);
28
29#endif