summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Pfetsch <spfetsch@google.com>2020-10-27 14:49:31 -0700
committerHarrison Lingren <hlingren@google.com>2020-11-03 18:18:07 +0000
commitdaf22f5bf2fc8698c256126df75e75214dd7a552 (patch)
tree2be7439db7f693e30d524ff70b7f951333b30796
parent6f2831fddffb0158b6af92e7c0b5cc369f883530 (diff)
downloadsec_touch-android-msm-bramble-4.19-android11-qpr1.tar.gz
touch_offload slots were left with non-zero pressure and size when (un)locked_release_all_finger was called during suspend. Reset these fields to zero and report pressure=0 as part of releasing touches. Bug: 169785626 Signed-off-by: Steve Pfetsch <spfetsch@google.com> Change-Id: I1dadc52943f738a427fa945f211dcaa2580390fd (cherry picked from commit 4bad9c7d4a382dc119f07f368f5eff4d98745621) (cherry picked from commit 5f3edf20df8b9a93ebe492a9eb2b51fa07dcf388)
-rw-r--r--sec_ts.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/sec_ts.c b/sec_ts.c
index a95606a..3d0b884 100644
--- a/sec_ts.c
+++ b/sec_ts.c
@@ -2682,10 +2682,10 @@ static void sec_ts_offload_report(void *handle,
report->coords[i].major);
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR,
report->coords[i].minor);
-#ifndef SKIP_PRESSURE
- input_report_abs(ts->input_dev, ABS_MT_PRESSURE,
- report->coords[i].pressure);
-#endif
+ if (ts->plat_data->support_mt_pressure)
+ input_report_abs(ts->input_dev,
+ ABS_MT_PRESSURE,
+ report->coords[i].pressure);
} else {
input_mt_slot(ts->input_dev, i);
input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 0);
@@ -4080,6 +4080,8 @@ void sec_ts_unlocked_release_all_finger(struct sec_ts_data *ts)
for (i = 0; i < MAX_SUPPORT_TOUCH_COUNT; i++) {
input_mt_slot(ts->input_dev, i);
+ if (ts->plat_data->support_mt_pressure)
+ input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 0);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER,
false);
@@ -4087,10 +4089,6 @@ void sec_ts_unlocked_release_all_finger(struct sec_ts_data *ts)
(ts->coord[i].action ==
SEC_TS_COORDINATE_ACTION_MOVE)) {
- ts->coord[i].action = SEC_TS_COORDINATE_ACTION_RELEASE;
-#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
- ts->offload.coords[i].status = COORD_STATUS_INACTIVE;
-#endif
input_info(true, &ts->client->dev,
"%s: [RA] tID:%d mc:%d tc:%d v:%02X%02X cal:%02X(%02X) id(%d,%d) p:%d\n",
__func__, i,
@@ -4110,6 +4108,13 @@ void sec_ts_unlocked_release_all_finger(struct sec_ts_data *ts)
ts->time_pressed[i].tv_sec);
}
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
+ ts->offload.coords[i].status = COORD_STATUS_INACTIVE;
+ ts->offload.coords[i].major = 0;
+ ts->offload.coords[i].minor = 0;
+ ts->offload.coords[i].pressure = 0;
+#endif
+ ts->coord[i].action = SEC_TS_COORDINATE_ACTION_RELEASE;
ts->coord[i].mcount = 0;
ts->coord[i].palm_count = 0;
@@ -4151,6 +4156,8 @@ void sec_ts_locked_release_all_finger(struct sec_ts_data *ts)
for (i = 0; i < MAX_SUPPORT_TOUCH_COUNT; i++) {
input_mt_slot(ts->input_dev, i);
+ if (ts->plat_data->support_mt_pressure)
+ input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 0);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER,
false);
@@ -4158,10 +4165,6 @@ void sec_ts_locked_release_all_finger(struct sec_ts_data *ts)
(ts->coord[i].action ==
SEC_TS_COORDINATE_ACTION_MOVE)) {
- ts->coord[i].action = SEC_TS_COORDINATE_ACTION_RELEASE;
-#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
- ts->offload.coords[i].status = COORD_STATUS_INACTIVE;
-#endif
input_info(true, &ts->client->dev,
"%s: [RA] tID:%d mc: %d tc:%d, v:%02X%02X, cal:%X(%X|%X), id(%d,%d), p:%d\n",
__func__, i, ts->coord[i].mcount,
@@ -4182,6 +4185,13 @@ void sec_ts_locked_release_all_finger(struct sec_ts_data *ts)
ts->time_pressed[i].tv_sec);
}
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
+ ts->offload.coords[i].status = COORD_STATUS_INACTIVE;
+ ts->offload.coords[i].major = 0;
+ ts->offload.coords[i].minor = 0;
+ ts->offload.coords[i].pressure = 0;
+#endif
+ ts->coord[i].action = SEC_TS_COORDINATE_ACTION_RELEASE;
ts->coord[i].mcount = 0;
ts->coord[i].palm_count = 0;