Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69a3ecf0 authored by Bingzhe Cai's avatar Bingzhe Cai
Browse files

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.

Change-Id: I85d24bfc68a7777053c15f28a84027260c68cebd
Signed-off-by: default avatarBingzhe Cai <bingzhec@codeaurora.org>
parent d394c7e8
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -721,7 +721,9 @@ static int ft5x06_fw_upgrade_start(struct i2c_client *client,


		if (r_buf[0] != info.upgrade_id_1
		if (r_buf[0] != info.upgrade_id_1
			|| r_buf[1] != info.upgrade_id_2) {
			|| 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
		} else
			break;
			break;
	}
	}
@@ -747,6 +749,10 @@ static int ft5x06_fw_upgrade_start(struct i2c_client *client,
	else
	else
		is_5336_new_bootloader = FT_BLOADER_VERSION_LZ4;
		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 */
	/* erase app and panel paramenter area */
	w_buf[0] = FT_ERASE_APP_REG;
	w_buf[0] = FT_ERASE_APP_REG;
	ft5x06_i2c_write(client, w_buf, 1);
	ft5x06_i2c_write(client, w_buf, 1);
@@ -1541,7 +1547,7 @@ static int ft5x06_ts_probe(struct i2c_client *client,
		goto free_reset_gpio;
		goto free_reset_gpio;
	}
	}


	data->family_id = reg_value;
	data->family_id = pdata->family_id;


	err = request_threaded_irq(client->irq, NULL,
	err = request_threaded_irq(client->irq, NULL,
				   ft5x06_ts_interrupt, pdata->irqflags,
				   ft5x06_ts_interrupt, pdata->irqflags,