summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2011-05-17 10:17:23 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-05-17 10:20:09 +0400
commite223cc7e96ddbcd32c4a0314d42ae56ade8008e5 (patch)
tree9fc6329a887ddd6b638a2c70042b475ec075d3a6 /drivers/input
parentdc5f4f5e9a3434bfe925f05db9db2908fbab771f (diff)
downloadlinux-e223cc7e96ddbcd32c4a0314d42ae56ade8008e5.tar.xz
Input: ad714x - fix threshold and completion interrupt masks
Fix two issues in the threshold 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> Tested-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/ad714x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c
index 2ceb0289a757..0f2db45f730c 100644
--- a/drivers/input/misc/ad714x.c
+++ b/drivers/input/misc/ad714x.c
@@ -158,10 +158,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);
@@ -175,10 +175,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);