Input: s6sy761 - fix coordinate read bit shift
authorCaleb Connolly <caleb@connolly.tech>
Sun, 7 Mar 2021 23:12:22 +0000 (15:12 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 7 Mar 2021 23:14:25 +0000 (15:14 -0800)
commit30b3f68715595dee7fe4d9bd91a2252c3becdf0a
treed1adeb853c8c92e7ae28a2826437b40c1ac592af
parent1bff77f41a805b16b5355497c217656711601282
Input: s6sy761 - fix coordinate read bit shift

The touch coordinate register contains the following:

        byte 3             byte 2             byte 1
+--------+--------+ +-----------------+ +-----------------+
|        |        | |                 | |                 |
| X[3:0] | Y[3:0] | |     Y[11:4]     | |     X[11:4]     |
|        |        | |                 | |                 |
+--------+--------+ +-----------------+ +-----------------+

Bytes 2 and 1 need to be shifted left by 4 bits, the least significant
nibble of each is stored in byte 3. Currently they are only
being shifted by 3 causing the reported coordinates to be incorrect.

This matches downstream examples, and has been confirmed on my
device (OnePlus 7 Pro).

Fixes: 0145a7141e59 ("Input: add support for the Samsung S6SY761 touchscreen")
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
Reviewed-by: Andi Shyti <andi@etezian.org>
Link: https://lore.kernel.org/r/20210305185710.225168-1-caleb@connolly.tech
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/s6sy761.c