From patchwork Tue Nov 12 13:48:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3172421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DD6829F39E for ; Tue, 12 Nov 2013 13:50:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0FDA20490 for ; Tue, 12 Nov 2013 13:50:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D51CD20429 for ; Tue, 12 Nov 2013 13:50:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEL7-0005Js-IK; Tue, 12 Nov 2013 13:49:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEKp-0005oz-Fi; Tue, 12 Nov 2013 13:48:51 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEKe-0005kI-Eo for linux-arm-kernel@lists.infradead.org; Tue, 12 Nov 2013 13:48:41 +0000 Received: by mail-wi0-f171.google.com with SMTP id hn6so789413wib.4 for ; Tue, 12 Nov 2013 05:48:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FkvQPMMkNk0PU9KqA/Jf1of40W5OS/25kUYQt9bvN48=; b=TGZsVo41tVLk9bAD2o/ONKMx0fdbieZ0e6K3BnG7B6clIyj/ULE4opi3LHURW3Zm1y 06iNXhzdmzw8ylL2N3XsLyThewrAUjfmWbFT22VmcGUQ2Fc6M34YlK71mraauxwe5+gV Cgr9Mz5WTjr0b72QXoKkXnOO5mTLkA9qnVwXke1FLismRVIQmR58ZM6YOVKxHG1MtLsU RFUTAAqaeh7XZdsFzfKETmQIqPNI4wZNn529PtDPcs0OPG+R5NChtMnMZ9C0xUVJxFEB WCkDOrijE2fs1mSpzrG3PhJSUx39CmhNC1D1huP9mR9wY9EXjlslLSwVmJKlZ97Fs0YS 4GZQ== X-Gm-Message-State: ALoCoQklnvoryZFNwFB+ihEHPn6Sx8s9kTccKTvNK+itvfL2MBXzRxKV3lJWHJdaWkoZPrUryt9p X-Received: by 10.194.239.40 with SMTP id vp8mr2015768wjc.45.1384264097210; Tue, 12 Nov 2013 05:48:17 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id i8sm44726884wiy.6.2013.11.12.05.48.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Nov 2013 05:48:16 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Russell King Subject: [PATCH 3/7] ARM: sa1100: refer to hardware IRQs step 1 Date: Tue, 12 Nov 2013 14:48:13 +0100 Message-Id: <1384264093-6291-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131112_084840_648640_208A7E86 X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -2.6 (--) Cc: Dmitry Eremin-Solenikov , Dmitry Eremin-Solenikov , Dmitry Artamonow , Andrea Adami , Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This switches the references from Linux IRQ numbers to hardware IRQ numbers in the code driving the low GPIOs and the "normal" interrupt lines on the SA1100. Signed-off-by: Linus Walleij --- arch/arm/mach-sa1100/irq.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index ac032c84763c..bf36b9abfaad 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -76,25 +77,25 @@ static int sa1100_gpio_type(struct irq_data *d, unsigned int type) */ static void sa1100_low_gpio_ack(struct irq_data *d) { - GEDR = (1 << d->irq); + GEDR = BIT(d->hwirq); } static void sa1100_low_gpio_mask(struct irq_data *d) { - ICMR &= ~(1 << d->irq); + ICMR &= ~BIT(d->hwirq); } static void sa1100_low_gpio_unmask(struct irq_data *d) { - ICMR |= 1 << d->irq; + ICMR |= BIT(d->hwirq); } static int sa1100_low_gpio_wake(struct irq_data *d, unsigned int on) { if (on) - PWER |= 1 << d->irq; + PWER |= BIT(d->hwirq); else - PWER &= ~(1 << d->irq); + PWER &= ~BIT(d->hwirq); return 0; } @@ -176,12 +177,12 @@ static int sa1100_high_gpio_wake(struct irq_data *d, unsigned int on) */ static void sa1100_mask_irq(struct irq_data *d) { - ICMR &= ~(1 << d->irq); + ICMR &= ~BIT(d->hwirq); } static void sa1100_unmask_irq(struct irq_data *d) { - ICMR |= (1 << d->irq); + ICMR |= BIT(d->hwirq); } /* @@ -189,7 +190,7 @@ static void sa1100_unmask_irq(struct irq_data *d) */ static int sa1100_set_wake(struct irq_data *d, unsigned int on) { - if (d->irq == IRQ_RTCAlrm) { + if (d->hwirq == IRQ_RTCAlrm) { if (on) PWER |= PWER_RTC; else @@ -246,11 +247,11 @@ asmlinkage void __exception_irq_entry sa1100_handle_irq(struct pt_regs *regs) { struct sa1100_sc *sc = &sa1100_sc; u32 status; - int irq; + int hwirq; while ((status = (ICIP & ICMR))) { - irq = ffs(status) - 1; - handle_IRQ(irq_find_mapping(sc->domain, irq), regs); + hwirq = ffs(status) - 1; + handle_IRQ(irq_find_mapping(sc->domain, hwirq), regs); } }