summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuper Liu <supercjliu@google.com>2022-08-11 14:07:39 +0800
committerSuper Liu <supercjliu@google.com>2022-08-12 10:12:22 +0800
commit85ae4c5abbef1598603ee64e8d6d36e36a179edd (patch)
tree6e8febb72b06bc470e4135f7639179a14bed3892
parented6f1478cc09f73cb2df0e295309f3b5bec09c74 (diff)
downloadsec_touch-android-gs-raviole-5.10-android13-qpr1-beta-3.tar.gz
Bug: 228079210 Test: basic touch operation for STTW, DTTW and lift to wakeup. Signed-off-by: Super Liu <supercjliu@google.com> Change-Id: I186cb14722308c645841332d32460a31ec5a25dd
-rw-r--r--sec_ts.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/sec_ts.c b/sec_ts.c
index 6e7e1ab..009b80c 100644
--- a/sec_ts.c
+++ b/sec_ts.c
@@ -5723,17 +5723,32 @@ static void sec_ts_suspend_work(struct work_struct *work)
__func__, sec_ts_ptflib_get_grip_prescreen_frames(ts));
}
- mutex_lock(&ts->device_mutex);
-
- reinit_completion(&ts->bus_resumed);
-
if (ts->power_status == SEC_TS_STATE_SUSPEND) {
input_err(true, &ts->client->dev, "%s: already suspended.\n",
__func__);
- mutex_unlock(&ts->device_mutex);
return;
}
+ mutex_lock(&ts->device_mutex);
+ /*
+ * Do the system reset to initialize the FW to the default state
+ * before handing over to AOC. And, recover the charger mode to
+ * have the AFE setting as the original one.
+ */
+ sec_ts_system_reset(ts, RESET_MODE_AUTO, true, false);
+ ret = ts->sec_ts_write(ts, SET_TS_CMD_SET_CHARGER_MODE,
+ &ts->charger_mode, 1);
+ if (ret < 0) {
+ input_err(true, &ts->client->dev,
+ "%s: write reg %#x %#x failed, returned %i\n",
+ __func__, SET_TS_CMD_SET_CHARGER_MODE, ts->charger_mode,
+ ret);
+ } else {
+ input_info(true, &ts->client->dev, "%s: set charger mode %#x\n",
+ __func__, ts->charger_mode);
+ }
+
+ reinit_completion(&ts->bus_resumed);
sec_ts_enable_fw_grip(ts, true);
/* Stop T-IC */