From patchwork Tue Nov 20 22:00:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1776271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0ECBF3FCAE for ; Tue, 20 Nov 2012 22:05:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tavtn-00039C-S3; Tue, 20 Nov 2012 22:02:32 +0000 Received: from mail.free-electrons.com ([88.190.12.23]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tavsp-0002i2-H8 for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2012 22:01:35 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 16637261; Tue, 20 Nov 2012 23:01:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham version=3.3.1 Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id DBFB418D; Tue, 20 Nov 2012 23:01:05 +0100 (CET) From: Thomas Petazzoni To: linux-arm-kernel@lists.infradead.org, Rob Herring , Arnd Bergmann , Olof Johansson Subject: [PATCH 03/16] arm: bcm2835: convert to the irqchip infrastructure Date: Tue, 20 Nov 2012 23:00:54 +0100 Message-Id: <1353448867-15008-4-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353448867-15008-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1353448867-15008-1-git-send-email-thomas.petazzoni@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121120_170132_294222_F48CC40B X-CRM114-Status: GOOD ( 25.28 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Andrew Lunn , Russell King , Jason Cooper , Stephen Warren , Linus Walleij , Viresh Kumar , Gregory Clement , Jamie Iles , Thomas Gleixner X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Register the irq controller driver in the main drivers/irqchip/irqchip.c file, and make sure that the initialization function of the driver sets handle_arch_irq() appropriately. This requires a bit of movement in the driver since the bcm2835_handle_irq() must move before the armctrl_of_init() function to avoid a forward declaration. On the arch/arm side, use irqchip_init() as the ->init_irq() callback, and remove the definition of ->handle_irq() since this is now done by the irq controller driver. Signed-off-by: Thomas Petazzoni Acked-by: Stephen Warren Reviewed-by: Rob Herring --- arch/arm/mach-bcm2835/bcm2835.c | 5 ++--- drivers/irqchip/irq-bcm2835.c | 27 ++++++++++++++------------- include/linux/irqchip/bcm2835.h | 29 ----------------------------- 3 files changed, 16 insertions(+), 45 deletions(-) delete mode 100644 include/linux/irqchip/bcm2835.h diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c index f6fea49..ab1bccd 100644 --- a/arch/arm/mach-bcm2835/bcm2835.c +++ b/arch/arm/mach-bcm2835/bcm2835.c @@ -13,10 +13,10 @@ */ #include -#include #include #include #include +#include #include #include @@ -56,8 +56,7 @@ static const char * const bcm2835_compat[] = { DT_MACHINE_START(BCM2835, "BCM2835") .map_io = bcm2835_map_io, - .init_irq = bcm2835_init_irq, - .handle_irq = bcm2835_handle_irq, + .init_irq = irqchip_init, .init_machine = bcm2835_init, .timer = &bcm2835_timer, .dt_compat = bcm2835_compat diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c index dc670cc..c2ca9b0 100644 --- a/drivers/irqchip/irq-bcm2835.c +++ b/drivers/irqchip/irq-bcm2835.c @@ -49,9 +49,11 @@ #include #include #include -#include #include +#include + +#include "irqchip.h" /* Put the bank and irq (32 bits) into the hwirq */ #define MAKE_HWIRQ(b, n) ((b << 5) | (n)) @@ -135,8 +137,10 @@ static struct irq_domain_ops armctrl_ops = { .xlate = armctrl_xlate }; -static int __init armctrl_of_init(struct device_node *node, - struct device_node *parent) +static asmlinkage void bcm2835_handle_irq(struct pt_regs *regs); + +static int __init bcm2835_irqchip_init(struct device_node *node, + struct device_node *parent) { void __iomem *base; int irq, b, i; @@ -164,16 +168,10 @@ static int __init armctrl_of_init(struct device_node *node, set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } } - return 0; -} -static struct of_device_id irq_of_match[] __initconst = { - { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init } -}; + set_handle_irq(bcm2835_handle_irq); -void __init bcm2835_init_irq(void) -{ - of_irq_init(irq_of_match); + return 0; } /* @@ -199,8 +197,8 @@ static void armctrl_handle_shortcut(int bank, struct pt_regs *regs, handle_IRQ(irq_linear_revmap(intc.domain, irq), regs); } -asmlinkage void __exception_irq_entry bcm2835_handle_irq( - struct pt_regs *regs) +static asmlinkage void __exception_irq_entry +bcm2835_handle_irq(struct pt_regs *regs) { u32 stat, irq; @@ -221,3 +219,6 @@ asmlinkage void __exception_irq_entry bcm2835_handle_irq( } } } + +IRQCHIP_DECLARE(bcm2835_armctrl_ic, "brcm,bcm2835-armctrl-ic", + bcm2835_irqchip_init); diff --git a/include/linux/irqchip/bcm2835.h b/include/linux/irqchip/bcm2835.h deleted file mode 100644 index 48a859b..0000000 --- a/include/linux/irqchip/bcm2835.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2010 Broadcom - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LINUX_IRQCHIP_BCM2835_H_ -#define __LINUX_IRQCHIP_BCM2835_H_ - -#include - -extern void bcm2835_init_irq(void); - -extern asmlinkage void __exception_irq_entry bcm2835_handle_irq( - struct pt_regs *regs); - -#endif