From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Bresticker Subject: [PATCH v2 08/16] irqchip: mips-gic: Implement generic irq_ack/irq_eoi callbacks Date: Fri, 5 Sep 2014 10:30:10 -0700 Message-ID: <1409938218-9026-9-git-send-email-abrestic@chromium.org> References: <1409938218-9026-1-git-send-email-abrestic@chromium.org> Return-path: In-Reply-To: <1409938218-9026-1-git-send-email-abrestic@chromium.org> Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Ralf Baechle , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Jason Cooper Cc: Andrew Bresticker , Jeffrey Deans , Markos Chandras , Paul Burton , Arnd Bergmann , John Crispin , David Daney , linux-mips@linux-mips.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: devicetree@vger.kernel.org Implement a default gic_irq_ack() and gic_finish_irq(). These are suitable for handling IPIs on Malta and the upcoming Danube board. Signed-off-by: Andrew Bresticker --- No changes from v1. --- drivers/irqchip/irq-mips-gic.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index f29bb4e..0549768 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -239,6 +239,20 @@ static void gic_unmask_irq(struct irq_data *d) GIC_SET_INTR_MASK(d->irq - gic_irq_base); } +void __weak gic_irq_ack(struct irq_data *d) +{ + GIC_CLR_INTR_MASK(d->irq - gic_irq_base); + + /* Clear edge detector */ + if (gic_irq_flags[d->irq - gic_irq_base] & GIC_TRIG_EDGE) + GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), d->irq - gic_irq_base); +} + +void __weak gic_finish_irq(struct irq_data *d) +{ + GIC_SET_INTR_MASK(d->irq - gic_irq_base); +} + static int gic_set_type(struct irq_data *d, unsigned int type) { unsigned int irq = d->irq - gic_irq_base; -- 2.1.0.rc2.206.gedb03e5