input: touchscreen: ft5x06: fix firmware force update issue
Force firmware update cannot work when touchscreen controller cannot report correct family ID. If touchscreen is does not work in correct state and it reports wrong family ID, it cannot be recovered by force update, this change use family ID from device tree instead of read from controller register to fix this issue. This patch is propagated from 3.18 kernel 'commit a85789530620 ("input: touchscreen: ft5x06: fix firmware force update issue")' Change-Id: I85d24bfc68a7777053c15f28a84027260c68cebd Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
This commit is contained in:
parent
f51bd56922
commit
6b5ef7a553
1 changed files with 8 additions and 2 deletions
|
@ -717,7 +717,9 @@ static int ft5x06_fw_upgrade_start(struct i2c_client *client,
|
|||
|
||||
if (r_buf[0] != info.upgrade_id_1
|
||||
|| r_buf[1] != info.upgrade_id_2) {
|
||||
dev_err(&client->dev, "Upgrade ID mismatch(%d)\n", i);
|
||||
dev_err(&client->dev, "Upgrade ID mismatch(%d), IC=0x%x 0x%x, info=0x%x 0x%x\n",
|
||||
i, r_buf[0], r_buf[1],
|
||||
info.upgrade_id_1, info.upgrade_id_2);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
|
@ -743,6 +745,10 @@ static int ft5x06_fw_upgrade_start(struct i2c_client *client,
|
|||
else
|
||||
is_5336_new_bootloader = FT_BLOADER_VERSION_LZ4;
|
||||
|
||||
dev_dbg(&client->dev, "bootloader type=%d, r_buf=0x%x, family_id=0x%x\n",
|
||||
is_5336_new_bootloader, r_buf[0], ts_data->family_id);
|
||||
/* is_5336_new_bootloader = FT_BLOADER_VERSION_GZF; */
|
||||
|
||||
/* erase app and panel paramenter area */
|
||||
w_buf[0] = FT_ERASE_APP_REG;
|
||||
ft5x06_i2c_write(client, w_buf, 1);
|
||||
|
@ -1533,7 +1539,7 @@ static int ft5x06_ts_probe(struct i2c_client *client,
|
|||
goto free_reset_gpio;
|
||||
}
|
||||
|
||||
data->family_id = reg_value;
|
||||
data->family_id = pdata->family_id;
|
||||
|
||||
err = request_threaded_irq(client->irq, NULL,
|
||||
ft5x06_ts_interrupt, pdata->irqflags,
|
||||
|
|
Loading…
Add table
Reference in a new issue