From: Mark Brown Date: Tue, 1 Feb 2011 11:46:13 +0000 (+0000) Subject: mfd: Add fast path for WM831x touchscreen interrupts X-Git-Tag: v2.6.39-rc1~96^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8546bd4af1251d17d16b0ef682d84fd23c8beaca;p=platform%2Fupstream%2Fkernel-adaptation-pc.git mfd: Add fast path for WM831x touchscreen interrupts The WM831x interrupt controller provides reporting of the touchscreen related interrupts in the primary interrupt status register as a performance optimisation - use this to avoid reading the secondary status registers for those interrupts. For code simplicity and to avoid iterating over all interrupts we open code for the two affected interrupt sources. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c index 90ad3fa..03eb61d 100644 --- a/drivers/mfd/wm831x-irq.c +++ b/drivers/mfd/wm831x-irq.c @@ -449,6 +449,18 @@ static irqreturn_t wm831x_irq_thread(int irq, void *data) goto out; } + /* The touch interrupts are visible in the primary register as + * an optimisation; open code this to avoid complicating the + * main handling loop and so we can also skip iterating the + * descriptors. + */ + if (primary & WM831X_TCHPD_INT) + handle_nested_irq(wm831x->irq_base + WM831X_IRQ_TCHPD); + if (primary & WM831X_TCHDATA_INT) + handle_nested_irq(wm831x->irq_base + WM831X_IRQ_TCHDATA); + if (primary & (WM831X_TCHDATA_EINT | WM831X_TCHPD_EINT)) + goto out; + for (i = 0; i < ARRAY_SIZE(wm831x_irqs); i++) { int offset = wm831x_irqs[i].reg - 1;