Skip to content

Commit 4ebfee2

Browse files
ElanDriverdtor
authored andcommitted
Input: elants_i2c - do not check Remark ID on eKTH3900/eKTH5312
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 12f247a commit 4ebfee2

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

drivers/input/touchscreen/elants_i2c.c

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@
117117
#define ELAN_POWERON_DELAY_USEC 500
118118
#define ELAN_RESET_DELAY_MSEC 20
119119

120+
/* FW boot code version */
121+
#define BC_VER_H_BYTE_FOR_EKTH3900x1_I2C 0x72
122+
#define BC_VER_H_BYTE_FOR_EKTH3900x2_I2C 0x82
123+
#define BC_VER_H_BYTE_FOR_EKTH3900x3_I2C 0x92
124+
#define BC_VER_H_BYTE_FOR_EKTH5312x1_I2C 0x6D
125+
#define BC_VER_H_BYTE_FOR_EKTH5312x2_I2C 0x6E
126+
#define BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C 0x77
127+
#define BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C 0x78
128+
#define BC_VER_H_BYTE_FOR_EKTH5312x1_I2C_USB 0x67
129+
#define BC_VER_H_BYTE_FOR_EKTH5312x2_I2C_USB 0x68
130+
#define BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C_USB 0x74
131+
#define BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C_USB 0x75
132+
120133
enum elants_chip_id {
121134
EKTH3500,
122135
EKTF3624,
@@ -736,6 +749,37 @@ static int elants_i2c_validate_remark_id(struct elants_data *ts,
736749
return 0;
737750
}
738751

752+
static bool elants_i2c_should_check_remark_id(struct elants_data *ts)
753+
{
754+
struct i2c_client *client = ts->client;
755+
const u8 bootcode_version = ts->iap_version;
756+
bool check;
757+
758+
/* I2C eKTH3900 and eKTH5312 are NOT support Remark ID */
759+
if ((bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x1_I2C) ||
760+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x2_I2C) ||
761+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x3_I2C) ||
762+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x1_I2C) ||
763+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x2_I2C) ||
764+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C) ||
765+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C) ||
766+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x1_I2C_USB) ||
767+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x2_I2C_USB) ||
768+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C_USB) ||
769+
(bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C_USB)) {
770+
dev_dbg(&client->dev,
771+
"eKTH3900/eKTH5312(0x%02x) are not support remark id\n",
772+
bootcode_version);
773+
check = false;
774+
} else if (bootcode_version >= 0x60) {
775+
check = true;
776+
} else {
777+
check = false;
778+
}
779+
780+
return check;
781+
}
782+
739783
static int elants_i2c_do_update_firmware(struct i2c_client *client,
740784
const struct firmware *fw,
741785
bool force)
@@ -749,7 +793,7 @@ static int elants_i2c_do_update_firmware(struct i2c_client *client,
749793
u16 send_id;
750794
int page, n_fw_pages;
751795
int error;
752-
bool check_remark_id = ts->iap_version >= 0x60;
796+
bool check_remark_id = elants_i2c_should_check_remark_id(ts);
753797

754798
/* Recovery mode detection! */
755799
if (force) {

0 commit comments

Comments
 (0)