Commit b1a402e7 authored by Dixit Parmar's avatar Dixit Parmar Committed by Dmitry Torokhov

Input: st1232 - fix reporting multitouch coordinates

For Sitronix st1633 multi-touch controller driver the coordinates reported
for multiple fingers were wrong, as it was always taking LSB of coordinates
from the first contact data.
Signed-off-by: default avatarDixit Parmar <dixitparmar19@gmail.com>
Reviewed-by: default avatarMartin Kepplinger <martink@posteo.de>
Cc: stable@vger.kernel.org
Fixes: 351e0592 ("Input: st1232 - add support for st1633")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204561
Link: https://lore.kernel.org/r/1566209314-21767-1-git-send-email-dixitparmar19@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent c324345c
...@@ -81,8 +81,10 @@ static int st1232_ts_read_data(struct st1232_ts_data *ts) ...@@ -81,8 +81,10 @@ static int st1232_ts_read_data(struct st1232_ts_data *ts)
for (i = 0, y = 0; i < ts->chip_info->max_fingers; i++, y += 3) { for (i = 0, y = 0; i < ts->chip_info->max_fingers; i++, y += 3) {
finger[i].is_valid = buf[i + y] >> 7; finger[i].is_valid = buf[i + y] >> 7;
if (finger[i].is_valid) { if (finger[i].is_valid) {
finger[i].x = ((buf[i + y] & 0x0070) << 4) | buf[i + 1]; finger[i].x = ((buf[i + y] & 0x0070) << 4) |
finger[i].y = ((buf[i + y] & 0x0007) << 8) | buf[i + 2]; buf[i + y + 1];
finger[i].y = ((buf[i + y] & 0x0007) << 8) |
buf[i + y + 2];
/* st1232 includes a z-axis / touch strength */ /* st1232 includes a z-axis / touch strength */
if (ts->chip_info->have_z) if (ts->chip_info->have_z)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment