commit 4c6fffa347e529672dfb858b07168f49ba4bbe97 Author: Rafi Rubin Date: Tue Feb 23 12:11:41 2010 -0500 Quick and dirty avoidance of erroneous end of contact events. diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3234c72..25ee5a4 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -35,6 +35,9 @@ struct ntrig_data { __u8 mt_footer[4]; __u8 mt_foot_count; + + __u8 deactivate_slack; + __u8 deactivate_state; }; /* @@ -192,6 +195,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, /* Pen activity signal, trigger end of touch. */ if (nd->mt_footer[2]) { nd->confidence = 0; + nd->deactivate_state = 0; break; } @@ -252,14 +256,16 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, BTN_TOOL_QUADTAP, 1); } input_report_key(input, BTN_TOUCH, 1); - } else { + nd->deactivate_state = nd->deactivate_slack; + } else if (! nd->deactivate_state) { input_report_key(input, BTN_TOOL_DOUBLETAP, 0); input_report_key(input, BTN_TOOL_TRIPLETAP, 0); input_report_key(input, BTN_TOOL_QUADTAP, 0); - } + } else + nd->deactivate_state--; break; default: @@ -292,6 +298,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) } nd->reading_mt = 0; + nd->deactivate_slack = 4; + nd->deactivate_state = 0; hid_set_drvdata(hdev, nd); ret = hid_parse(hdev);