Skip to content

Commit

Permalink
Input: zforce_ts - fix dual touch recognition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Knut Wohlrab authored and Dmitry Torokhov committed Apr 25, 2016
1 parent 28a994f commit 6984ab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/touchscreen/zforce_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,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],
Expand Down

0 comments on commit 6984ab1

Please sign in to comment.