From bfe0f70f8b05beffe593bce119829a153b703709 Mon Sep 17 00:00:00 2001 From: litong20 Date: Thu, 6 May 2021 18:17:31 +0800 Subject: [PATCH] Report BTN_TOUCH event when the fingers are lifted. 1. No need to set ABS_MT_TRACKING_ID, input_mt_init_slots() already set it. 2. Report BTN_TOUCH event when the fingers are lifted. Change-Id: Ib22a50091745f7b4facea23104f3cdc3a33807c5 Reviewed-on: https://gerrit.mot.com/1940860 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- drivers/input/touchscreen/stmicro_mmi/fts.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/stmicro_mmi/fts.c b/drivers/input/touchscreen/stmicro_mmi/fts.c index 899ff9ad1363..e8ab4db8c7d4 100644 --- a/drivers/input/touchscreen/stmicro_mmi/fts.c +++ b/drivers/input/touchscreen/stmicro_mmi/fts.c @@ -150,7 +150,7 @@ void release_all_touches(struct fts_ts_info *info) #endif input_mt_slot(info->input_dev, i); input_mt_report_slot_state(info->input_dev, type, 0); - input_report_abs(info->input_dev, ABS_MT_TRACKING_ID, -1); + /* input_report_abs(info->input_dev, ABS_MT_TRACKING_ID, -1); */ } input_sync(info->input_dev); info->touch_id = 0; @@ -2226,8 +2226,10 @@ static void fts_leave_pointer_event_handler(struct fts_ts_info *info, unsigned /* logError(0, "%s %s : TouchID = %d, Touchcount = %d\n",tag,__func__, * touchId,touchcount); */ + /* no need to set ABS_MT_TRACKING_ID, input_mt_init_slots() already set it */ + /* input_report_abs(info->input_dev, ABS_MT_TRACKING_ID, -1); */ - input_report_abs(info->input_dev, ABS_MT_TRACKING_ID, -1); + input_report_key(info->input_dev, BTN_TOUCH, 0); /* logError(0, "%s %s : Event 0x%02x - release ID[%d]\n", tag, * __func__, event[0], touchId); */ }