input: touchscreen: sec_ts: Report edge and palm touches
Map edge, palm, and cancel touches to MT_TOOL_PALM, effectively allowing
them to be treated as cancel events.
Signed-off-by: Steve Pfetsch <[email protected]>
Change-Id: I7fb1fa49942f5166da50a2e61753d6b0634b909a
diff --git a/sec_ts.c b/sec_ts.c
index b652480..5d05f73 100644
--- a/sec_ts.c
+++ b/sec_ts.c
@@ -2657,13 +2657,21 @@
input_set_timestamp(ts->input_dev, report->timestamp);
for (i = 0; i < MAX_COORDS; i++) {
- if (report->coords[i].status == COORD_STATUS_FINGER) {
+ if (report->coords[i].status != COORD_STATUS_INACTIVE) {
+ int mt_tool = MT_TOOL_FINGER;
+
input_mt_slot(ts->input_dev, i);
touch_down = 1;
input_report_key(ts->input_dev, BTN_TOUCH,
touch_down);
+
+ if (report->coords[i].status == COORD_STATUS_EDGE ||
+ report->coords[i].status == COORD_STATUS_PALM ||
+ report->coords[i].status == COORD_STATUS_CANCEL)
+ mt_tool = MT_TOOL_PALM;
+
input_mt_report_slot_state(ts->input_dev,
- MT_TOOL_FINGER, 1);
+ mt_tool, 1);
input_report_abs(ts->input_dev, ABS_MT_POSITION_X,
report->coords[i].x);
input_report_abs(ts->input_dev, ABS_MT_POSITION_Y,