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: 21458 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2434F23FBE for ; Tue, 12 Nov 2013 13:48:20 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id lj1sf7065520pab.6 for ; Tue, 12 Nov 2013 05:48:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=FkvQPMMkNk0PU9KqA/Jf1of40W5OS/25kUYQt9bvN48=; b=kNIqI+9RHzoGiOeHLSy5Q2FpB2JrsFfC0xn7gLtH6O4wacnk7MPBloNhMO0ymgg5Co LIafNgcOy95cg1/IIyTfSgDtkJiYORYoOc4WxdVPOixf5/GEH7fyN4nqCx/GiFn60d+U uSV43NA9wK3dxfKdea/9Gun+0/shfOQJ0+q67PtTdPqBb751X24opfaTEPKSz40LE77h N8tISOwFSJUswB4E6jfluDo6kfSKAkD02ycLr7ERzzLbbClpazlAySgn9RO4GXNZ9AnB vEsIaf6UUMgEYagkmmKtH2dk3EERs8WsVh2t1yayr0DL6YOkC3LPUMfM2zMJ7pRSh95J nkWQ== X-Gm-Message-State: ALoCoQknlKLNzksIvLRvnjX5nIrw+uTmas196eyUTYB16+lnvp6sRi4baHOt4yBH4FnkxjJR5wcv X-Received: by 10.66.141.46 with SMTP id rl14mr61920pab.44.1384264099065; Tue, 12 Nov 2013 05:48:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.129.65 with SMTP id nu1ls92379qeb.31.gmail; Tue, 12 Nov 2013 05:48:18 -0800 (PST) X-Received: by 10.58.210.66 with SMTP id ms2mr29427168vec.10.1384264098889; Tue, 12 Nov 2013 05:48:18 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id vh9si12051016vcb.100.2013.11.12.05.48.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 05:48:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jy13so1520113veb.9 for ; Tue, 12 Nov 2013 05:48:18 -0800 (PST) X-Received: by 10.58.54.69 with SMTP id h5mr2955290vep.25.1384264098590; Tue, 12 Nov 2013 05:48:18 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp163916vcz; Tue, 12 Nov 2013 05:48:18 -0800 (PST) X-Received: by 10.194.104.42 with SMTP id gb10mr26997528wjb.16.1384264097638; Tue, 12 Nov 2013 05:48:17 -0800 (PST) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by mx.google.com with ESMTPS id b13si3689393wik.8.2013.11.12.05.48.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 05:48:17 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.43 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=74.125.82.43; Received: by mail-wg0-f43.google.com with SMTP id n12so3129718wgh.10 for ; Tue, 12 Nov 2013 05:48:17 -0800 (PST) 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 Cc: Andrea Adami , Dmitry Eremin-Solenikov , Dmitry Artamonow , Dmitry Eremin-Solenikov , Linus Walleij 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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); } }