Title: [9242] trunk/drivers/input/touchscreen/ad7877.c: Input: touchscreen: ad7877 filter events where pressure is beyond the maximum
Revision
9242
Author
hennerich
Date
2010-10-18 03:58:42 -0400 (Mon, 18 Oct 2010)

Log Message

Input: touchscreen: 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.

Modified Paths

Diff

Modified: trunk/drivers/input/touchscreen/ad7877.c (9241 => 9242)


--- trunk/drivers/input/touchscreen/ad7877.c	2010-10-18 06:28:41 UTC (rev 9241)
+++ trunk/drivers/input/touchscreen/ad7877.c	2010-10-18 07:58:42 UTC (rev 9242)
@@ -360,6 +360,13 @@
 		Rt /= z1;
 		Rt = (Rt + 2047) >> 12;
 
+		/*
+		 * Sample found inconsistent, pressure is beyond
+		 * the maximum. Don't report it to user space.
+		 */
+		if (Rt > ts->pressure_max)
+			return -EINVAL;
+
 		if (!timer_pending(&ts->timer))
 			input_report_key(input_dev, BTN_TOUCH, 1);
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to