LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 2/2] mfd: Add fast path for WM831x touchscreen interrupts
Date: Tue,  1 Feb 2011 11:46:13 +0000	[thread overview]
Message-ID: <1296560773-14918-2-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1296560773-14918-1-git-send-email-broonie@opensource.wolfsonmicro.com>

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 <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm831x-irq.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

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;
 
-- 
1.7.2.3


  reply	other threads:[~2011-02-01 11:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 11:46 [PATCH 1/2] mfd: Convert WM831x SPI to use dev_pm_ops Mark Brown
2011-02-01 11:46 ` Mark Brown [this message]
2011-02-03  0:16   ` [PATCH 2/2] mfd: Add fast path for WM831x touchscreen interrupts Samuel Ortiz
2011-02-03  0:15 ` [PATCH 1/2] mfd: Convert WM831x SPI to use dev_pm_ops Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296560773-14918-2-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=sameo@linux.intel.com \
    --subject='Re: [PATCH 2/2] mfd: Add fast path for WM831x touchscreen interrupts' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).