From 59b557dcbbebca95ccc0946943e983953225764b Mon Sep 17 00:00:00 2001 From: haojl2 Date: Thu, 8 Nov 2018 19:51:34 +0800 Subject: [PATCH] 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 Reviewed-on: https://gerrit.mot.com/1266511 Tested-by: Jira Key SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../input/touchscreen/himax_mmi/himax_common.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/himax_mmi/himax_common.c b/drivers/input/touchscreen/himax_mmi/himax_common.c index 96bc61a85e3e..95476a507189 100644 --- a/drivers/input/touchscreen/himax_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_mmi/himax_common.c @@ -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) {