diff options
author | Mason Wang <masonwang@google.com> | 2021-10-27 08:47:18 +0800 |
---|---|---|
committer | Mason Wang <masonwang@google.com> | 2021-10-27 09:46:52 +0800 |
commit | a093ecb746866f52fdbd40aff2a08cc34e1169dd (patch) | |
tree | fae896125199a7bbee3fe5b0a86ad602e0a3261d /ft3658/focaltech_ex_fun.c | |
parent | 9ef351812200418aed4e6287e4ef5008273acd01 (diff) | |
download | focaltech_touch-a093ecb746866f52fdbd40aff2a08cc34e1169dd.tar.gz |
touch/focaltech: show firmware minor version.
Bug: 203609714
Test: Verify by following tests:
$adb shell cat /sys/class/spi_master/spi0/spi0.0/fts_fw_version
=>V02_D01
$adb shell cat /proc/focaltech_touch/FW_Version
=>FWVER:V02_D01
Signed-off-by: Mason Wang <masonwang@google.com>
Change-Id: I7e4feeca5780762ca7e3836bf197125780ac47bd
Diffstat (limited to 'ft3658/focaltech_ex_fun.c')
-rw-r--r-- | ft3658/focaltech_ex_fun.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/ft3658/focaltech_ex_fun.c b/ft3658/focaltech_ex_fun.c index 51d9f5b..9d7f713 100644 --- a/ft3658/focaltech_ex_fun.c +++ b/ft3658/focaltech_ex_fun.c @@ -734,21 +734,33 @@ static ssize_t fts_tpfwver_show( struct fts_ts_data *ts_data = fts_data; struct input_dev *input_dev = ts_data->input_dev; ssize_t num_read_chars = 0; - u8 fwver = 0; + u8 fw_major_ver = 0; + u8 fw_minor_ver = 0; mutex_lock(&input_dev->mutex); #if FTS_ESDCHECK_EN fts_esdcheck_proc_busy(1); #endif - ret = fts_read_reg(FTS_REG_FW_VER, &fwver); + ret = fts_read_reg(FTS_REG_FW_MAJOR_VER, &fw_major_ver); + if ((ret < 0) || (fw_major_ver == 0xFF) || (fw_major_ver == 0x00)) { + num_read_chars = snprintf(buf, PAGE_SIZE, + "get tp fw major version fail!\n"); + mutex_unlock(&input_dev->mutex); + return num_read_chars; + } + ret = fts_read_reg(FTS_REG_FW_MINOR_VER, &fw_minor_ver); + if (ret < 0) { + num_read_chars = snprintf(buf, PAGE_SIZE, + "get tp fw minor version fail!\n"); + mutex_unlock(&input_dev->mutex); + return num_read_chars; + } #if FTS_ESDCHECK_EN fts_esdcheck_proc_busy(0); #endif - if ((ret < 0) || (fwver == 0xFF) || (fwver == 0x00)) - num_read_chars = snprintf(buf, PAGE_SIZE, "get tp fw version fail!\n"); - else - num_read_chars = snprintf(buf, PAGE_SIZE, "%02x\n", fwver); + num_read_chars = snprintf(buf, PAGE_SIZE, "V%02x_D%02x\n", fw_major_ver, + fw_minor_ver); mutex_unlock(&input_dev->mutex); return num_read_chars; @@ -1121,8 +1133,11 @@ static ssize_t fts_dumpreg_show( fts_read_reg(FTS_REG_POWER_MODE, &val); count += snprintf(buf + count, PAGE_SIZE, "Power Mode:0x%02x\n", val); - fts_read_reg(FTS_REG_FW_VER, &val); - count += snprintf(buf + count, PAGE_SIZE, "FW Ver:0x%02x\n", val); + fts_read_reg(FTS_REG_FW_MAJOR_VER, &val); + count += snprintf(buf + count, PAGE_SIZE, "FW Major Ver:0x%02x\n", val); + + fts_read_reg(FTS_REG_FW_MINOR_VER, &val); + count += snprintf(buf + count, PAGE_SIZE, "FW Minor Ver:0x%02x\n", val); fts_read_reg(FTS_REG_LIC_VER, &val); count += snprintf(buf + count, PAGE_SIZE, "LCD Initcode Ver:0x%02x\n", val); |