linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <michael.hennerich@analog.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, jeff.dagenais@gmail.com,
	drivers@analog.com, device-drivers-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>
Subject: [PATCH 3/5] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions
Date: Tue, 10 May 2011 13:35:07 +0200	[thread overview]
Message-ID: <1305027309-17637-3-git-send-email-michael.hennerich@analog.com> (raw)
In-Reply-To: <1305027309-17637-1-git-send-email-michael.hennerich@analog.com>

From: Michael Hennerich <michael.hennerich@analog.com>

Fix two issues in the thresh and completion interrupt mask and unmask functions.
According to the AD714x datasheets the highest stage completion
interrupt should be enabled.
Fix mask computation.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/misc/ad714x.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index 9d95397..89554eb 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -160,10 +160,10 @@ static void ad714x_use_com_int(struct ad714x_chip *ad714x,
 	unsigned short data;
 	unsigned short mask;
 
-	mask = ((1 << (end_stage + 1)) - 1) - (1 << start_stage);
+	mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1);
 
 	ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data);
-	data |= 1 << start_stage;
+	data |= 1 << end_stage;
 	ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data);
 
 	ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data);
@@ -177,10 +177,10 @@ static void ad714x_use_thr_int(struct ad714x_chip *ad714x,
 	unsigned short data;
 	unsigned short mask;
 
-	mask = ((1 << (end_stage + 1)) - 1) - (1 << start_stage);
+	mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1);
 
 	ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data);
-	data &= ~(1 << start_stage);
+	data &= ~(1 << end_stage);
 	ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data);
 
 	ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data);
-- 
1.6.0.2



  parent reply	other threads:[~2011-05-10 11:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 11:35 [PATCH 1/5] input: misc: AD714x: The interrupt status registers should be read in row michael.hennerich
2011-05-10 11:35 ` [PATCH 2/5] input: misc: AD714x: Fix up input configuration michael.hennerich
2011-05-11 21:19   ` Dmitry Torokhov
2011-05-10 11:35 ` michael.hennerich [this message]
2011-05-10 11:35 ` [PATCH 4/5] input: misc: AD714x: Add option to specify irqflags michael.hennerich
2011-05-11 21:20   ` Dmitry Torokhov
2011-05-10 11:35 ` [PATCH 5/5] input: misc: AD714x: Fix captouch wheel option algorithm michael.hennerich
2011-05-11 18:30   ` Jean-Francois Dagenais
2011-05-11 21:15 ` [PATCH 1/5] input: misc: AD714x: The interrupt status registers should be read in row Dmitry Torokhov
2011-05-12  8:39   ` Hennerich, Michael

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=1305027309-17637-3-git-send-email-michael.hennerich@analog.com \
    --to=michael.hennerich@analog.com \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=drivers@analog.com \
    --cc=jeff.dagenais@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).