summaryrefslogtreecommitdiff
path: root/sec_ts_fw.c
diff options
context:
space:
mode:
authorSuper Liu <supercjliu@google.com>2020-07-20 14:37:20 +0800
committerSuper Liu <supercjliu@google.com>2020-07-30 08:05:13 +0800
commite09e00a8f03392752ce2d81e95670ad8aa44a3f4 (patch)
tree3241b4952e2983237c0b58084ee2fb4376d93365 /sec_ts_fw.c
parentfcb5c0228bd97322a9b6c2f806aabef2302dd55c (diff)
downloadsec_touch-e09e00a8f03392752ce2d81e95670ad8aa44a3f4.tar.gz
sec_touch: refine mis-calibration check
Unify the entry to do the mis-calibration check. This include the sufficient delay to lock the active mode before trigger this check. And, add run_cal_check sysfs for mis-calibration check and debug analysis. Bug: 161424891 Bug: 161890987 Change-Id: Ic64abce28c3861a27086b841617f44af99840eb3 Signed-off-by: Super Liu <supercjliu@google.com>
Diffstat (limited to 'sec_ts_fw.c')
-rw-r--r--sec_ts_fw.c53
1 files changed, 1 insertions, 52 deletions
diff --git a/sec_ts_fw.c b/sec_ts_fw.c
index 8db5b58..b02ab38 100644
--- a/sec_ts_fw.c
+++ b/sec_ts_fw.c
@@ -1005,58 +1005,7 @@ static int sec_ts_firmware_update(struct sec_ts_data *ts, const u8 *data,
#endif
/* check mis-cal */
- if (ts->plat_data->mis_cal_check) {
- u8 buff[2];
- u8 mis_cal_data;
-
- buff[0] = STATE_MANAGE_OFF;
- ret = ts->sec_ts_write(ts,
- SEC_TS_CMD_STATEMANAGE_ON, buff, 1);
- if (ret < 0)
- input_err(true, &ts->client->dev,
- "%s: mis_cal_check error[1] ret: %d\n",
- __func__, ret);
-
- buff[0] = TOUCH_SYSTEM_MODE_TOUCH;
- buff[1] = TOUCH_MODE_STATE_TOUCH;
- ret = ts->sec_ts_write(ts,
- SEC_TS_CMD_CHG_SYSMODE, buff, 2);
- if (ret < 0)
- input_err(true, &ts->client->dev,
- "%s: mis_cal_check error[2] ret: %d\n",
- __func__, ret);
-
- input_info(true, &ts->client->dev,
- "%s: mis_cal check\n", __func__);
- ret = ts->sec_ts_write(ts,
- SEC_TS_CMD_MIS_CAL_CHECK, NULL, 0);
- if (ret < 0)
- input_err(true, &ts->client->dev,
- "%s: mis_cal_check error[3] ret: %d\n",
- __func__, ret);
- sec_ts_delay(200);
-
- ret = ts->sec_ts_read(ts,
- SEC_TS_CMD_MIS_CAL_READ,
- &mis_cal_data, 1);
- if (ret < 0)
- input_err(true, &ts->client->dev,
- "%s: fail!, %d\n",
- __func__, ret);
- else
- input_info(true, &ts->client->dev,
- "%s: mis_cal data : %d\n",
- __func__, mis_cal_data);
-
- buff[0] = STATE_MANAGE_ON;
- ret = ts->sec_ts_write(ts,
- SEC_TS_CMD_STATEMANAGE_ON, buff, 1);
- if (ret < 0)
- input_err(true, &ts->client->dev,
- "%s: mis_cal_check error[4] ret: %d\n",
- __func__, ret);
- }
-
+ sec_ts_run_cal_check(ts);
/* Update calibration report */
sec_ts_read_calibration_report(ts);
} else