Input: elants_i2c - do not check Remark ID on eKTH3900/eKTH5312
commit 4ebfee2bbc1a9c343dd50565ba5ae249fac32267 upstream. The eKTH3900/eKTH5312 series do not support the firmware update rules of Remark ID. Exclude these two series from checking it when updating the firmware in touch controllers. Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com> Link: https://lore.kernel.org/r/1639619603-20616-1-git-send-email-johnny.chuang.emc@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
ee6f34215c
commit
3bb3bf50d6
@@ -109,6 +109,19 @@
|
|||||||
#define ELAN_POWERON_DELAY_USEC 500
|
#define ELAN_POWERON_DELAY_USEC 500
|
||||||
#define ELAN_RESET_DELAY_MSEC 20
|
#define ELAN_RESET_DELAY_MSEC 20
|
||||||
|
|
||||||
|
/* FW boot code version */
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH3900x1_I2C 0x72
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH3900x2_I2C 0x82
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH3900x3_I2C 0x92
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312x1_I2C 0x6D
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312x2_I2C 0x6E
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C 0x77
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C 0x78
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312x1_I2C_USB 0x67
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312x2_I2C_USB 0x68
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C_USB 0x74
|
||||||
|
#define BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C_USB 0x75
|
||||||
|
|
||||||
enum elants_state {
|
enum elants_state {
|
||||||
ELAN_STATE_NORMAL,
|
ELAN_STATE_NORMAL,
|
||||||
ELAN_WAIT_QUEUE_HEADER,
|
ELAN_WAIT_QUEUE_HEADER,
|
||||||
@@ -663,6 +676,37 @@ static int elants_i2c_validate_remark_id(struct elants_data *ts,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool elants_i2c_should_check_remark_id(struct elants_data *ts)
|
||||||
|
{
|
||||||
|
struct i2c_client *client = ts->client;
|
||||||
|
const u8 bootcode_version = ts->iap_version;
|
||||||
|
bool check;
|
||||||
|
|
||||||
|
/* I2C eKTH3900 and eKTH5312 are NOT support Remark ID */
|
||||||
|
if ((bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x1_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x2_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x3_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x1_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x2_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x1_I2C_USB) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x2_I2C_USB) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C_USB) ||
|
||||||
|
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C_USB)) {
|
||||||
|
dev_dbg(&client->dev,
|
||||||
|
"eKTH3900/eKTH5312(0x%02x) are not support remark id\n",
|
||||||
|
bootcode_version);
|
||||||
|
check = false;
|
||||||
|
} else if (bootcode_version >= 0x60) {
|
||||||
|
check = true;
|
||||||
|
} else {
|
||||||
|
check = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return check;
|
||||||
|
}
|
||||||
|
|
||||||
static int elants_i2c_do_update_firmware(struct i2c_client *client,
|
static int elants_i2c_do_update_firmware(struct i2c_client *client,
|
||||||
const struct firmware *fw,
|
const struct firmware *fw,
|
||||||
bool force)
|
bool force)
|
||||||
@@ -676,7 +720,7 @@ static int elants_i2c_do_update_firmware(struct i2c_client *client,
|
|||||||
u16 send_id;
|
u16 send_id;
|
||||||
int page, n_fw_pages;
|
int page, n_fw_pages;
|
||||||
int error;
|
int error;
|
||||||
bool check_remark_id = ts->iap_version >= 0x60;
|
bool check_remark_id = elants_i2c_should_check_remark_id(ts);
|
||||||
|
|
||||||
/* Recovery mode detection! */
|
/* Recovery mode detection! */
|
||||||
if (force) {
|
if (force) {
|
||||||
|
Reference in New Issue
Block a user