diff options
| author | 2021-11-11 21:58:54 -0800 | |
|---|---|---|
| committer | 2021-11-11 21:58:54 -0800 | |
| commit | efe6f16c6faf724882ddaba2eda8830a87bcc2b2 (patch) | |
| tree | ab5a4ac8c5b917b07af95c866770659f330b7f2b /drivers/input/mouse | |
| parent | Input: touchscreen - avoid bitwise vs logical OR warning (diff) | |
| parent | Input: iforce - fix control-message timeout (diff) | |
| download | linux-dev-efe6f16c6faf724882ddaba2eda8830a87bcc2b2.tar.xz linux-dev-efe6f16c6faf724882ddaba2eda8830a87bcc2b2.zip | |
Merge branch 'next' into for-linus
Prepare input updates for 5.16 merge window.
Diffstat (limited to 'drivers/input/mouse')
| -rw-r--r-- | drivers/input/mouse/elantech.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 2d0bc029619f..956d9cd34796 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -517,6 +517,19 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, case 0x16008020U: case 0x26800010U: case 0x36808000U: + + /* + * This firmware misreport coordinates for trackpoint + * occasionally. Discard packets outside of [-127, 127] range + * to prevent cursor jumps. + */ + if (packet[4] == 0x80 || packet[5] == 0x80 || + packet[1] >> 7 == packet[4] >> 7 || + packet[2] >> 7 == packet[5] >> 7) { + elantech_debug("discarding packet [%6ph]\n", packet); + break; + + } x = packet[4] - (int)((packet[1]^0x80) << 1); y = (int)((packet[2]^0x80) << 1) - packet[5]; |
