dlkm: ft8756: Fixed the touch can't works when resume

- Because now we found that when the screen is on, the touch has a low
probability of not working. It seems that the firmware of the touch works
abnormally, so reset the touch when status is abnormal for recover touch
function.

Change-Id: I1f6f80cb06d5e04bb585e6646620f597757655f7
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1457062
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wengjun1 2019-11-18 20:49:44 +08:00 • committed by Jun Weng
commit 40dea5aed3
3 changed files with 16 additions and 2 deletions

View file

@ -120,7 +120,7 @@ int fts_wait_tp_to_valid(void)
do {
ret = fts_read_reg(FTS_REG_CHIP_ID, &reg_value);
if ((ret < 0) || (reg_value != chip_id)) {
FTS_DEBUG("TP Not Ready, ReadData = 0x%x", reg_value);
FTS_INFO("TP Not Ready, ReadData = 0x%x", reg_value);
} else if (reg_value == chip_id) {
FTS_INFO("TP Ready, Device ID = 0x%x", reg_value);
return 0;
@ -1575,6 +1575,10 @@ static int fts_parse_dt(struct device *dev, struct fts_ts_platform_data *pdata)
if (pdata->always_on_vio)
FTS_INFO("TP VIO always on.");
pdata->rst_in_resume = of_property_read_bool(np, "focaltech,rst_in_resume");
if (pdata->rst_in_resume)
FTS_INFO("Reset touch when firmware abnormal in resume.");
pdata->irq_gpio = of_get_named_gpio_flags(np, "focaltech,irq-gpio",
0, &pdata->irq_gpio_flags);
if (pdata->irq_gpio < 0)
@ -2206,6 +2210,7 @@ static int fts_ts_suspend(struct device *dev)
static int _fts_ts_resume(struct device *dev)
{
int ret = 0;
struct fts_ts_data *ts_data = fts_data;
#ifdef FOCALTECH_SENSOR_EN
@ -2236,6 +2241,14 @@ static int _fts_ts_resume(struct device *dev)
}
fts_irq_enable();
if (ts_data->pdata->rst_in_resume) {
ret = fts_wait_tp_to_valid();
if(ret){
FTS_INFO("wait tp to valid abnormal,need reset tp");
fts_reset_proc(200);
}
}
fts_tp_state_recovery(ts_data);
#if FTS_ESDCHECK_EN

View file

@ -136,6 +136,7 @@ struct fts_ts_platform_data {
u32 reset_gpio;
u32 reset_gpio_flags;
bool always_on_vio;
bool rst_in_resume;
bool share_reset_gpio;
bool have_key;
u32 key_number;

View file

@ -275,7 +275,7 @@ int fts_read(u8 *cmd, u32 cmdlen, u8 *data, u32 datalen)
}
break;
} else {
FTS_DEBUG("data read(status=%x),retry=%d,ret=%d",
FTS_INFO("data read(status=%x),retry=%d,ret=%d",
rxbuf[3], i, ret);
ret = -EIO;
udelay(CS_HIGH_DELAY);