From patchwork Sat Dec 1 07:33:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 1828861 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 C27483FCF6 for ; Sat, 1 Dec 2012 07:37:33 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Teha6-00032y-Np; Sat, 01 Dec 2012 07:33:47 +0000 Received: from smtp5.mail.ru ([94.100.176.132]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Teha2-00032f-4N for linux-arm-kernel@lists.infradead.org; Sat, 01 Dec 2012 07:33:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Message-Id:Date:Subject:Cc:To:From; bh=cpE2AaAy10wrh4S+Q9U41IfD9cQSiL2nLx4xfHuq3i4=; b=F+yJyVIcjnAt7w+4YY8VeNUpLfdukn8+Y9t1Gp5aLJ1nE8IAC87aEvG/zOpXZX/tLe18MB+SOq8wsc0ZWT8SmiJWqQu+kfc8wnjvQz9aeVszk9/r48Omp1EBA66TsO1S; Received: from [188.134.40.128] (port=25421 helo=shc.zet) by smtp5.mail.ru with esmtpa (envelope-from ) id 1TehZy-0005hi-8D; Sat, 01 Dec 2012 11:33:38 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: ixp4xx: Add "ask" handler for timer interrupts Date: Sat, 1 Dec 2012 11:33:33 +0400 Message-Id: <1354347213-22237-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.7.8.6 X-Spam: Not detected X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121201_023342_720748_A03DA6CB X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [94.100.176.132 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Russell King , Alexander Shiyan , Arnd Bergmann , Dmitry Torokhov , Olof Johansson , Imre Kaloz , Krzysztof Halasa 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 Rather than modify the EOI flags directly in the timer interrupt, let's deal with these flags in the "ask" procedure. Signed-off-by: Alexander Shiyan --- arch/arm/mach-ixp4xx/common.c | 34 +++++++++++++++++++++++++--------- drivers/input/misc/ixp4xx-beeper.c | 3 --- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 8c0c0e2..27046ec 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c @@ -202,10 +202,28 @@ static void ixp4xx_irq_mask(struct irq_data *d) static void ixp4xx_irq_ack(struct irq_data *d) { - int line = (d->irq < 32) ? irq2gpio[d->irq] : -1; + int line; - if (line >= 0) - *IXP4XX_GPIO_GPISR = (1 << line); + switch (d->irq) { + case IRQ_IXP4XX_TIMER1: + *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; + break; + case IRQ_IXP4XX_TIMER2: + *IXP4XX_OSST = IXP4XX_OSST_TIMER_2_PEND; + break; + case IRQ_IXP4XX_TIMESTAMP: + *IXP4XX_OSST = IXP4XX_OSST_TIMER_TS_PEND; + break; + case IRQ_IXP4XX_WDOG: + *IXP4XX_OSST = IXP4XX_OSST_TIMER_WDOG_PEND; + break; + default: + line = (d->irq < 32) ? irq2gpio[d->irq] : -1; + + if (line >= 0) + *IXP4XX_GPIO_GPISR = (1 << line); + break; + } } /* @@ -247,6 +265,10 @@ void __init ixp4xx_init_irq(void) /* Disable all interrupt */ *IXP4XX_ICMR = 0x0; + /* Clear Timer Pending Interrupts */ + *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND | IXP4XX_OSST_TIMER_2_PEND | + IXP4XX_OSST_TIMER_TS_PEND | IXP4XX_OSST_TIMER_WDOG_PEND; + if (cpu_is_ixp46x() || cpu_is_ixp43x()) { /* Route upper 32 sources to IRQ instead of FIQ */ *IXP4XX_ICLR2 = 0x00; @@ -274,9 +296,6 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) { struct clock_event_device *evt = dev_id; - /* Clear Pending Interrupt by writing '1' to it */ - *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; - evt->event_handler(evt); return IRQ_HANDLED; @@ -294,9 +313,6 @@ void __init ixp4xx_timer_init(void) /* Reset/disable counter */ *IXP4XX_OSRT1 = 0; - /* Clear Pending Interrupt by writing '1' to it */ - *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; - /* Reset time-stamp counter */ *IXP4XX_OSTS = 0; diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index 6ab3dec..2923e47 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c @@ -78,9 +78,6 @@ static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned static irqreturn_t ixp4xx_spkr_interrupt(int irq, void *dev_id) { - /* clear interrupt */ - *IXP4XX_OSST = IXP4XX_OSST_TIMER_2_PEND; - /* flip the beeper output */ *IXP4XX_GPIO_GPOUTR ^= (1 << (unsigned int) dev_id);