Input: zforce_ts - fix dual touch recognition

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 <[email protected]>
Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: Dirk Behme <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
Knut Wohlrab 2016-04-25 14:08:25 -07:00 • committed by Dmitry Torokhov
commit 6984ab1ab3

View file

@ -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],