-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
The touch coordinates are read by shifting a value left by 3,
this is incorrect and effectively causes the coordinates to
be half of the correct value.
Shift by 4 bits instead to report the correct value.
This matches downstream examples, and has been confirmed on my
device (OnePlus 7 Pro).
Signed-off-by: Caleb Connolly <redacted>
---
drivers/input/touchscreen/s6sy761.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The touch coordinates are read by shifting a value left by 3,
this is incorrect and effectively causes the coordinates to
be half of the correct value.
Shift by 4 bits instead to report the correct value.
This matches downstream examples, and has been confirmed on my
device (OnePlus 7 Pro).
The real reason is that from the register we get:
byte 3 byte 2 byte 1
+--------+--------+ +-----------------+ +-----------------+
| | | | | | |
| X[3:0] | Y[3:0] | | Y[11:4] | | X[11:4] |
| | | | | | |
+--------+--------+ +-----------------+ +-----------------+
and the 12 bit values have to fit in a 16bit variable.
The upper 8 bits (in event[2] and event[1] need to be shifted
left by '4' and not by '3' in order to leave space to the lower
4 bits (in event[3]).
Hi Andi,
On 05/03/2021 11:55 am, Andi Shyti wrote:
Hi Caleb,
quoted
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Please clean up the commit message.
oops! Sorry
quoted
The touch coordinates are read by shifting a value left by 3,
this is incorrect and effectively causes the coordinates to
be half of the correct value.
Shift by 4 bits instead to report the correct value.
This matches downstream examples, and has been confirmed on my
device (OnePlus 7 Pro).
The real reason is that from the register we get:
byte 3 byte 2 byte 1
+--------+--------+ +-----------------+ +-----------------+
| | | | | | |
| X[3:0] | Y[3:0] | | Y[11:4] | | X[11:4] |
| | | | | | |
+--------+--------+ +-----------------+ +-----------------+
and the 12 bit values have to fit in a 16bit variable.
The upper 8 bits (in event[2] and event[1] need to be shifted
left by '4' and not by '3' in order to leave space to the lower
4 bits (in event[3]).
Thanks for clarifying, sorry for my rather naive commit message.