:100644 100755 7d9e2bb... 0000000... M drivers/input/touchscreen/tssc_manager.c
diff --git a/drivers/input/touchscreen/tssc_manager.c b/drivers/input/touchscreen/tssc_manager.c
old mode 100644
new mode 100755
index 7d9e2bb..3360261
--- a/drivers/input/touchscreen/tssc_manager.c
+++ b/drivers/input/touchscreen/tssc_manager.c
@@ -122,9 +122,12 @@ struct tssc_manager_data {
#endif
};
+//--- mysterious doubletap thingie
+static int64_t last_up_ns;
+#define DOUBLETAP_THRESHOLD_NSEC 25000000//25ms
//----------------------------------------------
-#define ENABLE_TSSC_AVERAGE
+//#define ENABLE_TSSC_AVERAGE
#define TOUCH_POLLING_NSEC 8400000//9000000//
#define TOUCH_QUEUE_NUMBER 2//3
@@ -220,6 +223,24 @@ static int touch_add_queue(int x, int x16, int y, int y16,int p)
*/
static void touch_input_up(struct input_dev *dev)
{
+ // Here follows eval-'s new doubletap disaster
+ struct timespec timespc;
+ int64_t curr_ns = 0;
+ int64_t t_diff = 0;
+
+ getnstimeofday(×pc);
+ curr_ns = timespec_to_ns(×pc);
+ t_diff = curr_ns-last_up_ns;
+
+ if(debug_tp & DEBUG_TP_ON)
+ printk(KERN_DEBUG "touch_input_up(): t_delta: %lld report count: %ld\n", t_diff, touch_report_count);
+ last_up_ns = curr_ns;
+
+ // I have no (good) idea why this works. eval, 3/13
+ if (t_diff > DOUBLETAP_THRESHOLD_NSEC)
+ return;
+
+ // original:
if (touch_report_count > 0) {
input_report_abs(dev, ABS_PRESSURE, 0);
input_report_abs(dev, ABS_TOOL_WIDTH, 0);
@@ -272,8 +293,11 @@ static void touch_process_queue(struct input_dev *dev)
return;
}
- if (touch_sample_count >= TOUCH_QUEUE_NUMBER)
+ // if TOUCH_QUEUE_NUMBER >2 but sample_count <TOUCH_QUEUE_NUMBER
+ // then where the hell will calibration_translate et al get touch_average_x/y/p??
+ if (touch_sample_count >= TOUCH_QUEUE_NUMBER)
touch_get_average();
+
calibration_translate(touch_average_x, touch_average_y, &x, &y);
if (x >= 0 && y >= 0) {
@@ -498,6 +522,7 @@ static int tssc_manager_input_init(void)
struct tssc_manager_data *ts;
int ret = 0;
int ret_down = 0;
+ struct timespec timespc;
ts = kzalloc(sizeof(*ts), GFP_KERNEL);
if (ts == NULL) {
@@ -586,6 +611,10 @@ static int tssc_manager_input_init(void)
ts->input_dev->name, ts->use_irq ? "interrupt" : "polling");
calibration_init();
+ // do something ugly for doubletap
+ getnstimeofday(×pc);
+ last_up_ns = timespec_to_ns(×pc);
+
return 0;
err_input_register_device_failed: