Add calibration noise error handler

TP:
 If the noise detection fails after calibration, the touch IC will
 report the "F3 E0" event, and when the event is received,
 the touch driver will send the calibration command again.

Change-Id: Ifd2f4bd287fbdc7861a127d2ffd481f635d963c7
Reviewed-on: https://gerrit.mot.com/2123149
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2021-11-22 16:38:28 +08:00 • committed by litong
commit bad4b4d393
4 changed files with 10 additions and 1 deletions

View file

@ -218,6 +218,10 @@ int errorHandler(u8 *event, int size)
case EVT_TYPE_ERROR_ITO_KEYOPEN:
logError(1, "%s errorHandler: Key Open !\n", tag);
break;
case EVT_TYPE_ERROR_CAL_NOISE:
logError(1, "%s errorHandler: Calibration noise check error !\n", tag);
res = (ERROR_HANDLER_STOP_PROC | res);
break;
default:
logError(1, "%s errorHandler: No Action taken!\n", tag);

View file

@ -363,7 +363,7 @@ int fts_writeFwCmd(u8 *cmd, int cmdLength)
ret2 = checkEcho(cmd, cmdLength);
if (ret < OK || ret2 < OK)
msleep(I2C_WAIT_BEFORE_RETRY);
/* logError(1,"%s fts_writeCmd: attempt %d\n", tag, retry); */
logError(1,"%s fts_writeCmd: attempt %d\n", tag, retry);
}
if (ret < 0) {
logError(1, "%s fts_writeFwCmd: ERROR %08X\n", tag,

View file

@ -443,6 +443,7 @@ typedef enum {
* Subsection Area Header */
#define EVT_TYPE_ERROR_CRC_CX_SUB 0xA6 /* /< CRC error in the CX
* Subsection Area */
#define EVT_TYPE_ERROR_CAL_NOISE 0xE0
#define EVT_TYPE_ERROR_ESD 0xF0 /* /< ESD error */
/** @}*/

View file

@ -533,6 +533,9 @@ static ssize_t fts_mmi_calibrate_store(struct device *dev,
return -EINVAL;
}
/* disable irq to fully control IC*/
fts_disableInterrupt();
if (value == 3) {
u8 cmd[3] = { FTS_CMD_SYSTEM, SYS_CMD_SPECIAL, SPECIAL_FULL_PANEL_INIT };
pr_info("Sending Event [0x%02x 0x%02x 0x%02x]...\n",
@ -549,6 +552,7 @@ static ssize_t fts_mmi_calibrate_store(struct device *dev,
return -EINVAL;
}
fts_enableInterrupt();
return size;
}