summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKnut Wohlrab <Knut.Wohlrab@de.bosch.com>2016-04-25 14:08:25 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-11 11:21:00 +0200
commit88ed791c43aad64fc2f3707bc3e82205031a73e3 (patch)
treecbe574f67b1cad44ca06797fce1c0b051a176266 /drivers
parent9cce33a90a71c14cad12c10c167afe6edb602680 (diff)
downloadlwn-88ed791c43aad64fc2f3707bc3e82205031a73e3.tar.gz
lwn-88ed791c43aad64fc2f3707bc3e82205031a73e3.zip
Input: zforce_ts - fix dual touch recognition
commit 6984ab1ab35f422292b7781c65284038bcc0f6a6 upstream. A wrong decoding of the touch coordinate message causes a wrong touch ID. Touch ID for dual touch must be 0 or 1. According to the actual Neonode nine byte touch coordinate coding, the state is transported in the lower nibble and the touch ID in the higher nibble of payload byte five. Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/zforce_ts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 2175f3419002..dd5cc262bb50 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -350,8 +350,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
point.coord_x = point.coord_y = 0;
}
- point.state = payload[9 * i + 5] & 0x03;
- point.id = (payload[9 * i + 5] & 0xfc) >> 2;
+ point.state = payload[9 * i + 5] & 0x0f;
+ point.id = (payload[9 * i + 5] & 0xf0) >> 4;
/* determine touch major, minor and orientation */
point.area_major = max(payload[9 * i + 6],