summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/st1232.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-11-13 23:10:52 +0100
committerLinus Walleij <linus.walleij@linaro.org>2019-11-13 23:10:52 +0100
commit1566a6a30bf4d85849bab7e389392d6d3de1530e (patch)
treebbc979f430cb07d41f7b35524027e25e7a4b9fe6 /drivers/input/touchscreen/st1232.c
parent3af50e548019f6ee26d0ed4340f4ab980f884696 (diff)
parentd6d5df1db6e9d7f8f76d2911707f7d5877251b02 (diff)
Merge tag 'v5.4-rc5' into devel
Linux 5.4-rc5
Diffstat (limited to 'drivers/input/touchscreen/st1232.c')
-rw-r--r--drivers/input/touchscreen/st1232.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 34923399ece4..1139714e72e2 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -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) {
finger[i].is_valid = buf[i + y] >> 7;
if (finger[i].is_valid) {
- finger[i].x = ((buf[i + y] & 0x0070) << 4) | buf[i + 1];
- finger[i].y = ((buf[i + y] & 0x0007) << 8) | buf[i + 2];
+ finger[i].x = ((buf[i + y] & 0x0070) << 4) |
+ buf[i + y + 1];
+ finger[i].y = ((buf[i + y] & 0x0007) << 8) |
+ buf[i + y + 2];
/* st1232 includes a z-axis / touch strength */
if (ts->chip_info->have_z)