focaltech_0flash: Fix USB detection function

TP:
Increase retry count in USB detection set function.
If retry times larger than max retry number, break set function.

Change-Id: Ifa97ac3f8f66b422bd21dc249acfce081a13b35d
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1389717
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2019-07-22 19:19:28 +08:00 • committed by Jialei Hao
commit e3bcdde9df

View file

@ -695,7 +695,7 @@ static void fts_mcu_usb_detect_set(uint8_t usb_connected)
ret = fts_read_reg(FTS_REG_CHARGER_MODE_EN, &read_data);
if (ret < 0)
FTS_ERROR("read 8b register fail, ret=%d", ret);
retry_cnt++;
}while((write_data != read_data) && retry_cnt < FTS_REG_RETRY_TIMES);
}