DLKM: Improve focaltech touch driver

- Prevent potential risk that the touch has been updated
successful but display initial code isn't written fully which
will cause display can't work on ft8006u.

Change-Id: I0dd8232a79fb1ced88deb748f656a195d97908ac
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1232123
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wengjun1 2018-08-23 17:05:52 +08:00 • committed by Jun Weng
commit afe045cddc
3 changed files with 24 additions and 1 deletions

View file

@ -1565,7 +1565,7 @@ static int fts_lic_get_vid_in_host(u16 *vid)
return 0;
}
static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver)
int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver)
{
int ret = 0;

View file

@ -224,6 +224,7 @@ int fts_pram_ecc_cal(struct i2c_client *client, u32 saddr, u32 len);
int fts_pram_start(struct i2c_client *client);
int fts_fwupg_do_upgrade(const char *fwname);
int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver);
int fts_extra_init(struct i2c_client *client, struct input_dev *input_dev, struct ft_ts_platform_data *pdata);
int fts_extra_exit(void);

View file

@ -876,6 +876,13 @@ static void ft_update_fw_id(struct ft_ts_data *data)
data->fw_id[0], data->fw_id[1]);
}
static void ft_clear_fw_id(struct ft_ts_data *data)
{
data->fw_id[0] = 0;
data->fw_id[1] = 0;
data->fw_ver[0] = 0;
}
static void ft_ud_fix_mismatch(struct ft_ts_data *data)
{
int i;
@ -3330,6 +3337,7 @@ static int ft_ts_probe(struct i2c_client *client,
struct dentry *temp;
u8 reg_value = 0;
u8 reg_addr;
u8 lic_ver = 0;
int err, retval, attr_count;
if (client->dev.of_node) {
@ -3624,6 +3632,20 @@ static int ft_ts_probe(struct i2c_client *client,
ft_update_fw_vendor_id(data);
ft_update_fw_id(data);
if (pdata->family_id == FT8006U_ID) {
fts_lic_get_ver_in_tp(client, &lic_ver);
/*
* If display initial code isn't written fully, then this value should be
* a negative value with signed(e.g. 0xFF), therefore need to clear the buildid
* info then this will cause script update the touch firmware again.
*/
dev_info(&client->dev, "Display init code ver:%d\n",
(s8)lic_ver);
if ((s8)lic_ver < 0) {
ft_clear_fw_id(data);
}
}
#if defined(CONFIG_FB)
INIT_WORK(&data->fb_notify_work, fb_notify_resume_work);
data->fb_notif.notifier_call = fb_notifier_callback;