himax_mmi: fix enter esd revocery after resume

g_zero_event_count not clear after resume.
This will cause ESD recover triggered after resume device several times.

Change-Id: I79d4c0637763ee23544c0eff367a6eeec75cee19
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266511
Tested-by: Jira Key
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2018-11-08 19:51:34 +08:00 • committed by Jianqi Yang
commit 59b557dcbb

View file

@ -1470,9 +1470,15 @@ static int himax_err_ctrl(struct himax_ts_data *ts, uint8_t *buf, int ts_path, i
#endif
ts_status = himax_checksum_cal(ts, buf, ts_path, ts_status);
if (ts_status == HX_CHKSUM_FAIL)
if (ts_status == HX_CHKSUM_FAIL) {
goto CHK_FAIL;
goto END_FUNCTION;
} else {
#ifdef HX_ESD_RECOVERY
/* continuous N times revord, not total N times */
g_zero_event_count = 0;
#endif
goto END_FUNCTION;
}
CHK_FAIL:
#ifdef HX_ESD_RECOVERY
@ -2900,6 +2906,11 @@ int himax_chip_common_resume(struct himax_ts_data *ts)
ts->suspended = false;
}
#ifdef HX_ESD_RECOVERY
/* continuous N times record, not total N times. */
g_zero_event_count = 0;
#endif
atomic_set(&ts->suspend_mode, 0);
if (ts->pdata->powerOff3V3 && ts->pdata->power) {