From 6b5ef7a5537f83fc38caebca0b69c778669cf603 Mon Sep 17 00:00:00 2001 From: Bingzhe Cai Date: Mon, 4 Nov 2013 15:03:53 +0800 Subject: 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 --- drivers/input/touchscreen/ft5x06_ts.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ft5x06_ts.c b/drivers/input/touchscreen/ft5x06_ts.c index 1ee983e62509..0b435886897e 100644 --- a/drivers/input/touchscreen/ft5x06_ts.c +++ b/drivers/input/touchscreen/ft5x06_ts.c @@ -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, -- cgit v1.2.3