diff options
author | Wendly Li <wendlyli@google.com> | 2022-09-05 04:24:53 +0000 |
---|---|---|
committer | Wendly Li <wendlyli@google.com> | 2022-09-06 04:20:27 +0000 |
commit | 15c53c7da7b3e943cd4b39cb1b29000cff4cf661 (patch) | |
tree | d05b7ad03e35d5fbcf465d665d0f4508998bb440 /goodix_ts_proc.c | |
parent | 62a8a01e4afe152d84901ada1c01bd1deeaa4b9c (diff) | |
download | goodix_touch-15c53c7da7b3e943cd4b39cb1b29000cff4cf661.tar.gz |
touch/goodix: Import v1.1.1 driver
Bug: 245028037
Test: Check esd checker will not be enabled when device is suspended
Change-Id: I64268295f8373b95864dd4fa8bdebe0579ffed81
Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'goodix_ts_proc.c')
-rw-r--r-- | goodix_ts_proc.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/goodix_ts_proc.c b/goodix_ts_proc.c index 893aeb2..3f90291 100644 --- a/goodix_ts_proc.c +++ b/goodix_ts_proc.c @@ -47,6 +47,7 @@ #define CMD_SET_HEATMAP "set_heatmap" #define CMD_GET_SELF_COMPEN "get_self_compensation" #define CMD_SET_REPORT_RATE "set_report_rate" +#define CMD_GET_DUMP_LOG "get_dump_log" char *cmd_list[] = { CMD_FW_UPDATE, CMD_AUTO_TEST, CMD_OPEN_TEST, CMD_SELF_OPEN_TEST, CMD_NOISE_TEST, CMD_AUTO_NOISE_TEST, CMD_SHORT_TEST, @@ -61,7 +62,7 @@ char *cmd_list[] = { CMD_FW_UPDATE, CMD_AUTO_TEST, CMD_OPEN_TEST, CMD_GET_FW_STATUS, CMD_SET_HIGHSENSE_MODE, CMD_SET_GRIP_DATA, CMD_SET_GRIP_MODE, CMD_SET_PALM_MODE, CMD_SET_NOISE_MODE, CMD_SET_WATER_MODE, CMD_SET_HEATMAP, CMD_GET_SELF_COMPEN, - CMD_SET_REPORT_RATE, NULL }; + CMD_SET_REPORT_RATE, CMD_GET_DUMP_LOG, NULL }; /* test limits keyword */ #define CSV_TP_SPECIAL_RAW_MIN "special_raw_min" @@ -2911,6 +2912,42 @@ static void goodix_set_report_rate(int rate) cd->hw_ops->send_cmd(cd, &temp_cmd); } +#define DUMP_AREA1_ADDR 0x10194 +#define DUMP_AREA1_LEN 132 +#define DUMP_AREA2_ADDR 0x10400 +#define DUMP_AREA2_LEN 596 +#define DUMP_AREA3_ADDR 0x10308 +#define DUMP_AREA3_LEN 64 +static void goodix_get_dump_log(void) +{ + u8 buf[600]; + int i; + + cd->hw_ops->read(cd, DUMP_AREA1_ADDR, buf, DUMP_AREA1_LEN); + index += sprintf(&rbuf[index], "0x%04x:\n", DUMP_AREA1_ADDR); + for (i = 0; i < DUMP_AREA1_LEN; i++) { + index += sprintf(&rbuf[index], "%02x,", buf[i]); + if ((i + 1) % 32 == 0) + index += sprintf(&rbuf[index], "\n"); + } + + cd->hw_ops->read(cd, DUMP_AREA2_ADDR, buf, DUMP_AREA2_LEN); + index += sprintf(&rbuf[index], "\n0x%04x:\n", DUMP_AREA2_ADDR); + for (i = 0; i < DUMP_AREA2_LEN; i++) { + index += sprintf(&rbuf[index], "%02x,", buf[i]); + if ((i + 1) % 32 == 0) + index += sprintf(&rbuf[index], "\n"); + } + + cd->hw_ops->read(cd, DUMP_AREA3_ADDR, buf, DUMP_AREA3_LEN); + index += sprintf(&rbuf[index], "\n0x%04x:\n", DUMP_AREA3_ADDR); + for (i = 0; i < DUMP_AREA3_LEN; i++) { + index += sprintf(&rbuf[index], "%02x,", buf[i]); + if ((i + 1) % 32 == 0) + index += sprintf(&rbuf[index], "\n"); + } +} + static ssize_t driver_test_write( struct file *file, const char __user *buf, size_t count, loff_t *pos) { @@ -3614,6 +3651,12 @@ static ssize_t driver_test_write( goto exit; } + if (!strncmp(p, CMD_GET_DUMP_LOG, strlen(CMD_GET_DUMP_LOG))) { + rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + goodix_get_dump_log(); + goto exit; + } + rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); index = sprintf(rbuf, "not support cmd %s\n", p); ts_err("not support cmd[%s]", p); |