summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Wang <masonwang@google.com>2022-05-25 15:58:12 +0800
committerMason Wang <masonwang@google.com>2022-06-10 11:56:38 +0800
commit2fd4db2bcde3d88bb10d542ec8bb11a046f02008 (patch)
tree165f75efa16d981e4b61d6da79bb1dd380c65a79
parent4e3b65e345091dba53b31dd15d63b7234b245b93 (diff)
downloadfocaltech_touch-2fd4db2bcde3d88bb10d542ec8bb11a046f02008.tar.gz
touch/focaltech: report up event if down touch records are not matched.
Bug: 235441233 Test: Basic touch operation works well. Change-Id: I5bcf6f015e9471e96c3df614a095aa92efd7217e
-rw-r--r--ft3658/focaltech_core.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/ft3658/focaltech_core.c b/ft3658/focaltech_core.c
index 21b3d6a..3c90ef2 100644
--- a/ft3658/focaltech_core.c
+++ b/ft3658/focaltech_core.c
@@ -568,11 +568,11 @@ static int fts_input_report_b(struct fts_ts_data *data)
input_report_abs(data->input_dev, ABS_MT_POSITION_X, events[i].x);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, events[i].y);
- touchs |= BIT(events[i].id);
- data->touchs |= BIT(events[i].id);
#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
}
#endif
+ touchs |= BIT(events[i].id);
+ data->touchs |= BIT(events[i].id);
if ((data->log_level >= 2) ||
((1 == data->log_level) && (FTS_TOUCH_DOWN == events[i].flag))) {
FTS_DEBUG("[B]P%d(%d, %d)[ma:%d,mi:%d,p:%d] DOWN!",
@@ -590,18 +590,16 @@ static int fts_input_report_b(struct fts_ts_data *data)
#endif
input_mt_slot(data->input_dev, events[i].id);
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER, false);
- data->touchs &= ~BIT(events[i].id);
#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
}
#endif
+ data->touchs &= ~BIT(events[i].id);
if (data->log_level >= 1) {
FTS_DEBUG("[B1]P%d UP!", events[i].id);
}
}
}
-#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
- if (!data->offload.offload_running) {
-#endif
+
if (unlikely(data->touchs ^ touchs)) {
for (i = 0; i < max_touch_num; i++) {
if (BIT(i) & (data->touchs ^ touchs)) {
@@ -609,13 +607,23 @@ static int fts_input_report_b(struct fts_ts_data *data)
FTS_DEBUG("[B2]P%d UP!", i);
}
va_reported = true;
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
+ data->offload.coords[i].status = COORD_STATUS_INACTIVE;
+ if (!data->offload.offload_running) {
+#endif
input_mt_slot(data->input_dev, i);
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER, false);
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
+ }
+#endif
}
}
}
data->touchs = touchs;
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
+ if (!data->offload.offload_running) {
+#endif
if (va_reported) {
/* touchs==0, there's no point but key */
if (EVENT_NO_DOWN(data) || (!touchs)) {