[PATCH 1/4] Input: hgpk - detect simple mode overflows

From
Daniel Drake <hidden>
Date
2010-11-13 19:22:03
Based on work by Paul Fox.

Signed-off-by: Daniel Drake <redacted>
---
 drivers/input/mouse/hgpk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index b54f074..7f6cb32 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -431,6 +431,11 @@ static void hgpk_process_simple_packet(struct psmouse *psmouse)
 	int x = packet[1] - ((packet[0] << 4) & 0x100);
 	int y = ((packet[0] << 3) & 0x100) - packet[2];
 
+	if (packet[0] & 0xc0)
+		hgpk_dbg(psmouse,
+			 "overflow -- 0x%02x 0x%02x 0x%02x\n",
+			 packet[0], packet[1], packet[2]);
+
 	if (hgpk_discard_decay_hack(psmouse, x, y)) {
 		if (tpdebug)
 			hgpk_dbg(psmouse, "discarding\n");
-- 
1.7.3.2
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help