From d3e2787491a1c5d93e3ce8943c0ed568b9b9dfdb Mon Sep 17 00:00:00 2001 From: Super Liu Date: Tue, 3 Aug 2021 08:34:59 +0000 Subject: [PATCH] dumpstate: support CM2 data dump for touch. This also change the sequence of run_rawcap_read_all and run_self_rawcap_read_all to last. Because these two commands need to run selftest first to read data, this will make ambient update to make other raw data with differen baseline. Bug: 195111369 Test: check touch data in bugreport. Signed-off-by: Super Liu Change-Id: I4693b099fbc98d80fbe166525773e3ab803c98d8 --- dumpstate/DumpstateDevice.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 68474e99..93e175a1 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -648,20 +648,6 @@ void DumpstateDevice::dumpTouchSection(int fd) { lsi_spi_path, lsi_spi_path); RunCommandToFd(fd, "Self Strength", {"/vendor/bin/sh", "-c", cmd}); - // Raw cap - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawcap_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Mutual Raw Cap", {"/vendor/bin/sh", "-c", cmd}); - - // Self raw cap - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_self_rawcap_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Self Raw Cap", {"/vendor/bin/sh", "-c", cmd}); - // TYPE_AMBIENT_DATA snprintf(cmd, sizeof(cmd), "echo %s > %s/cmd && cat %s/cmd_result", @@ -697,6 +683,27 @@ void DumpstateDevice::dumpTouchSection(int fd) { lsi_spi_path, lsi_spi_path); RunCommandToFd(fd, "TYPE_NOI_P2P_MAX", {"/vendor/bin/sh", "-c", cmd}); + // Raw cap + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawcap_read_all", + lsi_spi_path, lsi_spi_path); + RunCommandToFd(fd, "Mutual Raw Cap", {"/vendor/bin/sh", "-c", cmd}); + + // Self raw cap + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_self_rawcap_read_all", + lsi_spi_path, lsi_spi_path); + RunCommandToFd(fd, "Self Raw Cap", {"/vendor/bin/sh", "-c", cmd}); + + // CM2 + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawcap_high_freq_read_all", + lsi_spi_path, lsi_spi_path); + RunCommandToFd(fd, "CM2", {"/vendor/bin/sh", "-c", cmd}); + // Disable: force touch active snprintf(cmd, sizeof(cmd), "echo %s > %s/cmd && cat %s/cmd_result",