diff options
author | Sivasankari <Sivasankari.muthusamy@st.com> | 2020-03-06 14:15:11 +0800 |
---|---|---|
committer | davidycchen <davidycchen@google.com> | 2020-03-25 18:31:16 +0800 |
commit | 94fd53a3eb58068ca5ff5cde623c0b2db5d46635 (patch) | |
tree | ba73c34ad23088f5b70ee0259a7d489d80cc3a4f | |
parent | de3d00b3e3829689c1d7051810dd85c1c0f1d276 (diff) | |
download | fts_touch-94fd53a3eb58068ca5ff5cde623c0b2db5d46635.tar.gz |
input: touchscreen: stm: Driver Version 5.2.16.14
Adding a dummy I2C Write transaction before any FW Write Command
Bug: 151900042
Signed-off-by: Sivasankari <Sivasankari.muthusamy@st.com>
Change-Id: I811fe52a27fdb153922ce715fadd7478178f42a2
-rw-r--r-- | fts.h | 4 | ||||
-rw-r--r-- | fts_lib/ftsCore.c | 23 |
2 files changed, 20 insertions, 7 deletions
@@ -57,9 +57,9 @@ */ /* **** CODE CONFIGURATION **** */ #define FTS_TS_DRV_NAME "fts" /* driver name */ -#define FTS_TS_DRV_VERSION "5.2.16.13" /* driver version string +#define FTS_TS_DRV_VERSION "5.2.16.14" /* driver version string * */ -#define FTS_TS_DRV_VER 0x0502100D /* driver version u32 format */ +#define FTS_TS_DRV_VER 0x0502100E /* driver version u32 format */ /* #define DEBUG */ /* /< define to print more logs in the kernel log * and better follow the code flow */ diff --git a/fts_lib/ftsCore.c b/fts_lib/ftsCore.c index 68eda84..fea0941 100644 --- a/fts_lib/ftsCore.c +++ b/fts_lib/ftsCore.c @@ -364,13 +364,16 @@ int checkEcho(u8 *cmd, int size) int setScanMode(u8 mode, u8 settings) { u8 cmd[3] = { FTS_CMD_SCAN_MODE, mode, settings }; + u8 cmd1[7] = {0xFA, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; int ret, size = 3; pr_debug("%s: Setting scan mode: mode = %02X settings = %02X !\n", __func__, mode, settings); if (mode == SCAN_MODE_LOW_POWER) size = 2; - ret = fts_write(cmd, size); + ret = fts_write(cmd1, 7); + if(ret >= OK) + ret = fts_write(cmd, size); /* use write instead of writeFw because can be called while the * interrupt are enabled */ if (ret < OK) { @@ -405,6 +408,7 @@ int setFeatures(u8 feat, u8 *settings, int size) char *buff; int buff_len = ((2 + 1) * size + 1) * sizeof(char); int index = 0; + u8 cmd1[7] = {0xFA, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; cmd = kzalloc((2 + size) * sizeof(u8), GFP_KERNEL); buff = kzalloc(buff_len, GFP_KERNEL); @@ -423,7 +427,9 @@ int setFeatures(u8 feat, u8 *settings, int size) "%02X ", settings[i]); } pr_info("%s: Settings = %s\n", __func__, buff); - ret = fts_write(cmd, 2 + size); + ret = fts_write(cmd1, 7); + if(ret >= OK) + ret = fts_write(cmd, 2 + size); /* use write instead of writeFw because can be called while the * interrupts are enabled */ if (ret < OK) { @@ -459,6 +465,7 @@ int writeSysCmd(u8 sys_cmd, u8 *sett, int size) char *buff; int buff_len = ((2 + 1) * size + 1) * sizeof(char); int index = 0; + u8 cmd1[7] = {0xFA, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; cmd = kzalloc((2 + size) * sizeof(u8), GFP_KERNEL); buff = kzalloc(buff_len, GFP_KERNEL); @@ -479,8 +486,11 @@ int writeSysCmd(u8 sys_cmd, u8 *sett, int size) pr_info("%s: Command = %02X %02X %s\n", __func__, cmd[0], cmd[1], buff); pr_info("%s: Writing Sys command...\n", __func__); - if (sys_cmd != SYS_CMD_LOAD_DATA) - ret = fts_writeFwCmd(cmd, 2 + size); + if (sys_cmd != SYS_CMD_LOAD_DATA) { + ret = fts_write(cmd1, 7); + if(ret >= OK) + ret = fts_writeFwCmd(cmd, 2 + size); + } else { if (size >= 1) ret = requestSyncFrame(sett[0]); @@ -981,6 +991,7 @@ int requestSyncFrame(u8 type) u8 readData[DATA_HEADER] = { 0 }; int ret, retry = 0, retry2 = 0, time_to_count; int count, new_count; + u8 cmd[7] = {0xFA, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; pr_info("%s: Starting to get a sync frame...\n", __func__); @@ -1008,7 +1019,9 @@ int requestSyncFrame(u8 type) pr_info("%s: Requesting frame %02X attempt = %d\n", __func__, type, retry2 + 1); - ret = fts_write(request, ARRAY_SIZE(request)); + ret = fts_write(cmd, 7); + if(ret >= OK) + ret = fts_write(request, ARRAY_SIZE(request)); if (ret >= OK) { pr_info("%s: Polling for new count...\n", __func__); time_to_count = TIMEOUT_REQU_DATA / TIMEOUT_RESOLUTION; |