Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ad7877 - filter events where pressure is beyond the maximum

Suppress events where pressure > pressure_max.
These events come typically along with inaccurate X and Y samples.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Michael Hennerich and committed by
Dmitry Torokhov
1d02ad43 47026b25

+7
+7
drivers/input/touchscreen/ad7877.c
··· 360 360 Rt /= z1; 361 361 Rt = (Rt + 2047) >> 12; 362 362 363 + /* 364 + * Sample found inconsistent, pressure is beyond 365 + * the maximum. Don't report it to user space. 366 + */ 367 + if (Rt > ts->pressure_max) 368 + return -EINVAL; 369 + 363 370 if (!timer_pending(&ts->timer)) 364 371 input_report_key(input_dev, BTN_TOUCH, 1); 365 372