diff options
author | Wendly Li <wendlyli@google.com> | 2022-07-29 11:23:57 +0000 |
---|---|---|
committer | Wendly Li <wendlyli@google.com> | 2022-08-19 08:23:35 +0000 |
commit | 08c526a578df78a7956453a02c03802216394ed6 (patch) | |
tree | bb4106d884736588a470b597f524a5ee2637504f /dumpstate/Dumpstate.cpp | |
parent | 0f2d1bd801f9acfbbc10b8c72bf386ff18e8d10e (diff) | |
download | gs201-08c526a578df78a7956453a02c03802216394ed6.tar.gz |
dumpstate: Dump GTI touch information.
Dump the touch information and rawdata when bugreport is triggered.
Bug: 214118904
Test: adb bugreport
Change-Id: I08834cf0176be69359264189b703486e33925f2b
Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'dumpstate/Dumpstate.cpp')
-rw-r--r-- | dumpstate/Dumpstate.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index cbdfb2c..ddd2942 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -528,6 +528,7 @@ void Dumpstate::dumpTouchSection(int fd) { const char lsi_spi_path[] = "/sys/devices/virtual/sec/tsp"; const char syna_cmd_path[] = "/sys/class/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs"; const char focaltech_cmd_path[] = "/proc/focaltech_touch"; + const char gti0_cmd_path[] = "/sys/devices/virtual/goog_touch_interface/gti.0"; char cmd[256]; if (!access(focaltech_cmd_path, R_OK)) { @@ -819,6 +820,48 @@ void Dumpstate::dumpTouchSection(int fd) { lsi_spi_path, lsi_spi_path); RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); } + + if (!access(gti0_cmd_path, R_OK)) { + // Enable: force touch active + snprintf(cmd, sizeof(cmd), "echo 1 > %s/force_active", gti0_cmd_path); + RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); + + // Touch Firmware Version + snprintf(cmd, sizeof(cmd), "%s/fw_ver", gti0_cmd_path); + DumpFileToFd(fd, "Touch Firmware Version", cmd); + + // Get Mutual Sensing Data - Baseline + snprintf(cmd, sizeof(cmd), "cat %s/ms_base", gti0_cmd_path); + RunCommandToFd(fd, "Get Mutual Sensing Data - Baseline", {"/vendor/bin/sh", "-c", cmd}); + + // Get Mutual Sensing Data - Delta + snprintf(cmd, sizeof(cmd), "cat %s/ms_diff", gti0_cmd_path); + RunCommandToFd(fd, "Get Mutual Sensing Data - Delta", {"/vendor/bin/sh", "-c", cmd}); + + // Get Mutual Sensing Data - Raw + snprintf(cmd, sizeof(cmd), "cat %s/ms_raw", gti0_cmd_path); + RunCommandToFd(fd, "Get Mutual Sensing Data - Raw", {"/vendor/bin/sh", "-c", cmd}); + + // Get Self Sensing Data - Baseline + snprintf(cmd, sizeof(cmd), "cat %s/ss_base", gti0_cmd_path); + RunCommandToFd(fd, "Get Self Sensing Data - Baseline", {"/vendor/bin/sh", "-c", cmd}); + + // Get Self Sensing Data - Delta + snprintf(cmd, sizeof(cmd), "cat %s/ss_diff", gti0_cmd_path); + RunCommandToFd(fd, "Get Self Sensing Data - Delta", {"/vendor/bin/sh", "-c", cmd}); + + // Get Self Sensing Data - Raw + snprintf(cmd, sizeof(cmd), "cat %s/ss_raw", gti0_cmd_path); + RunCommandToFd(fd, "Get Self Sensing Data - Raw", {"/vendor/bin/sh", "-c", cmd}); + + // Self Test + snprintf(cmd, sizeof(cmd), "cat %s/self_test", gti0_cmd_path); + RunCommandToFd(fd, "Self Test", {"/vendor/bin/sh", "-c", cmd}); + + // Disable: force touch active + snprintf(cmd, sizeof(cmd), "echo 0 > %s/force_active", gti0_cmd_path); + RunCommandToFd(fd, "Disable Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); + } } // Dump items related to SoC |