From c5f72bce3360dc6261ec32846c2150a7ff7de18e Mon Sep 17 00:00:00 2001 From: Steve Pfetsch Date: Wed, 2 Sep 2020 18:02:52 -0700 Subject: 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 Change-Id: I7fb1fa49942f5166da50a2e61753d6b0634b909a --- sec_ts.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 @@ static void sec_ts_offload_report(void *handle, 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, -- cgit v1.2.3