[PATCH 1/2] improve-s3c2410_ts-debug-messages.patch

Nelson Castillo nelsoneci at gmail.com
Wed Nov 19 08:22:35 CET 2008


* Print debugging information when you need to send a missing touch event.
* Remove a few warnings in printk (%ld used when %d is enough).

With this patch we can see more information about the touchscreen misbehavior
and a pattern can be spotted: the data that comes right after the missing
touch event that is being sent is always wrong.

Also notice that sometimes the messages labeled "First" are also broken.
All other readings seem to be OK (confirmed with longer tests).
In this example all points pressed were near (X:142, Y:876).

[21474640.735000] T:265659, X:000, Y:000
[21474640.755000] T:283731, X:142, Y:876
[21474640.765000] T:293726, X:142, Y:876
[21474640.775000] T:303772, X:143, Y:876
[21474640.935000] T:463897, X:144, Y:875 First
[21474641.090000] T:618820, X:048, Y:292
[21474641.115000] T:643724, X:142, Y:882
[21474641.255000] T:783774, X:142, Y:878 First
[21474641.385000] T:914297, X:048, Y:293
[21474641.410000] T:938837, X:139, Y:882
[21474641.490000] T:018790, X:139, Y:881 First
[21474641.600000] T:131265, X:047, Y:294
[21474641.625000] T:153913, X:351, Y:650 First
[21474641.810000] T:341736, X:117, Y:217
[21474641.835000] T:363968, X:506, Y:525 First
[21474642.240000] T:773530, X:169, Y:175

Signed-off-by: Nelson Castillo <nelsoneci at gmail.com>
---

 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 8f0afc3..c62494b 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -137,6 +137,16 @@ static void touch_timer_fire(unsigned long data)
 		input_report_abs(ts.dev, ABS_X, ts.coords[0]);
 		input_report_abs(ts.dev, ABS_Y, ts.coords[1]);
 
+#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG
+		{
+			struct timeval tv;
+
+			do_gettimeofday(&tv);
+			printk(DEBUG_LVL "T:%06d, X:%03d, Y:%03d First\n",
+				   (int)tv.tv_usec, ts.coords[0], ts.coords[1]);
+		}
+#endif
+
 		input_report_key(ts.dev, BTN_TOUCH, 1);
 		input_report_abs(ts.dev, ABS_PRESSURE, 1);
 		input_sync(ts.dev);
@@ -153,7 +163,7 @@ static void touch_timer_fire(unsigned long data)
 			struct timeval tv;
 
 			do_gettimeofday(&tv);
-			printk(DEBUG_LVL "T:%06d, X:%03ld, Y:%03ld\n",
+			printk(DEBUG_LVL "T:%06d, X:%03d, Y:%03d\n",
 				   (int)tv.tv_usec, ts.coords[0], ts.coords[1]);
 		}
 #endif




More information about the openmoko-kernel mailing list