From a6120d06251b7c3ce58f17586a21612d7be9111a Mon Sep 17 00:00:00 2001 From: Mason Wang Date: Fri, 9 Dec 2022 17:02:55 +0800 Subject: [PATCH 1/3] Dumpstate: Add golden mutual raw data for FST2 touch. [DO NOT MERGE] Bug: 254201934 Test: The BR has the data of "Golden Mutual Raw Data. Signed-off-by: Mason Wang Change-Id: I017462d0cd6f2ed3032f0f775d078ef3f5790193 --- dumpstate/Dumpstate.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index 66354fd3..0296991f 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -530,6 +530,8 @@ void Dumpstate::dumpTouchSection(int fd) { "/proc/fts/driver_test", "/sys/class/spi_master/spi6/spi6.0", "/proc/fts_ext/driver_test"}; + const char fst2_cmd_path[2][50] = {"/sys/class/spi_master/spi0/spi0.0", + "/proc/fts/driver_test"}; 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"; @@ -537,6 +539,8 @@ void Dumpstate::dumpTouchSection(int fd) { char cmd[256]; if (!access(focaltech_cmd_path, R_OK)) { + ::android::base::WriteStringToFd("\n<<<<<< FOCALTECH >>>>>>\n\n", fd); + // Enable: force touch active snprintf(cmd, sizeof(cmd), "echo 21 > %s/force_active", focaltech_cmd_path); RunCommandToFd(fd, "Enable Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); @@ -591,6 +595,8 @@ void Dumpstate::dumpTouchSection(int fd) { } if (!access(syna_cmd_path, R_OK)) { + ::android::base::WriteStringToFd("\n<<<<<< SYNA >>>>>>\n\n", fd); + // Enable: force touch active snprintf(cmd, sizeof(cmd), "echo 21 > %s/force_active", syna_cmd_path); RunCommandToFd(fd, "Enable Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); @@ -623,6 +629,8 @@ void Dumpstate::dumpTouchSection(int fd) { snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i]); if (access(cmd, R_OK)) continue; + ::android::base::WriteStringToFd("\n<<<<<< FTM5 >>>>>>\n\n", fd); + snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i + 1]); if (!access(cmd, R_OK)) { snprintf(cmd, sizeof(cmd), "echo A0 01 01 > %s", stm_cmd_path[i + 1]); @@ -742,7 +750,36 @@ void Dumpstate::dumpTouchSection(int fd) { } } + for (int i = 0; i < 2; i += 2) { // fst2 + snprintf(cmd, sizeof(cmd), "%s", fst2_cmd_path[i]); + if (!access(cmd, R_OK)) { + ::android::base::WriteStringToFd("\n<<<<<< FST2 >>>>>>\n\n", fd); + + snprintf(cmd, sizeof(cmd), "%s", fst2_cmd_path[i + 1]); + if (!access(cmd, R_OK)) { + // Enable: force touch active + snprintf(cmd, sizeof(cmd), "echo 21 01 > %s", fst2_cmd_path[i + 1]); + RunCommandToFd(fd, "Force Set AP as Bus Owner with Bugreport Flag", + {"/vendor/bin/sh", "-c", cmd}); + + // Golden Mutual Raw Data + snprintf(cmd, sizeof(cmd), "echo 0B 00 23 40 > %s;" + "echo 02 B7 00 10 04 E0 01 > %s ; cat %s;" + "echo 02 B7 04 F0 04 E0 01 > %s ; cat %s;", + fst2_cmd_path[i + 1], fst2_cmd_path[i + 1], fst2_cmd_path[i + 1], + fst2_cmd_path[i + 1], fst2_cmd_path[i + 1]); + RunCommandToFd(fd, "Golden Mutual Raw Data", {"/vendor/bin/sh", "-c", cmd}); + + // Restore Bus Owner + snprintf(cmd, sizeof(cmd), "echo 21 00 > %s", fst2_cmd_path[i + 1]); + RunCommandToFd(fd, "Restore Bus Owner", {"/vendor/bin/sh", "-c", cmd}); + } + } + } + if (!access(lsi_spi_path, R_OK)) { + ::android::base::WriteStringToFd("\n<<<<<< LSI >>>>>>\n\n", fd); + // Enable: force touch active snprintf(cmd, sizeof(cmd), "echo %s > %s/cmd && cat %s/cmd_result", @@ -830,6 +867,8 @@ void Dumpstate::dumpTouchSection(int fd) { } if (!access(gti0_cmd_path, R_OK)) { + ::android::base::WriteStringToFd("\n<<<<<< GTI0 >>>>>>\n\n", fd); + // 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}); From 3df17f30b39f3dd84dbda05358be4d31442eef82 Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Thu, 8 Dec 2022 11:27:43 +0800 Subject: [PATCH 2/3] move dump cpu to gs-common Bug: 240530709 Test: adb bugreport Change-Id: I05d533c8a4ccb085e9ffbfa53b0262ae38461b9b --- dumpstate/Dumpstate.cpp | 21 --------------------- dumpstate/Dumpstate.h | 1 - 2 files changed, 22 deletions(-) diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index ea613ccc..34cf23f1 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -227,7 +227,6 @@ Dumpstate::Dumpstate() { "wlan", [this](int fd) { dumpWlanSection(fd); } }, { "memory", [this](int fd) { dumpMemorySection(fd); } }, { "Devfreq", [this](int fd) { dumpDevfreqSection(fd); } }, - { "cpu", [this](int fd) { dumpCpuSection(fd); } }, { "power", [this](int fd) { dumpPowerSection(fd); } }, { "display", [this](int fd) { dumpDisplaySection(fd); } }, { "misc", [this](int fd) { dumpMiscSection(fd); } }, @@ -507,26 +506,6 @@ void Dumpstate::dumpPowerSection(int fd) { } -// Dump items related to CPUs -void Dumpstate::dumpCpuSection(int fd) { - DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present"); - DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online"); - RunCommandToFd(fd, "CPU time-in-state", {"/vendor/bin/sh", "-c", - "for cpu in /sys/devices/system/cpu/cpu*; do " - "f=$cpu/cpufreq/stats/time_in_state; " - "if [ ! -f $f ]; then continue; fi; " - "echo $f:; cat $f; " - "done"}); - RunCommandToFd(fd, "CPU cpuidle", {"/vendor/bin/sh", "-c", - "for cpu in /sys/devices/system/cpu/cpu*; do " - "for d in $cpu/cpuidle/state*; do " - "if [ ! -d $d ]; then continue; fi; " - "echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; " - "done; " - "done"}); - DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts"); -} - // Dump items related to Devfreq & BTS void Dumpstate::dumpDevfreqSection(int fd) { DumpFileToFd(fd, "MIF DVFS", diff --git a/dumpstate/Dumpstate.h b/dumpstate/Dumpstate.h index c624df90..f615a452 100644 --- a/dumpstate/Dumpstate.h +++ b/dumpstate/Dumpstate.h @@ -54,7 +54,6 @@ class Dumpstate : public BnDumpstateDevice { // addition to being included in full dumps void dumpWlanSection(int fd); void dumpPowerSection(int fd); - void dumpCpuSection(int fd); void dumpDevfreqSection(int fd); void dumpMemorySection(int fd); void dumpDisplaySection(int fd); From 592ff18146e85ec4599226c5997f03ab4ae1fe75 Mon Sep 17 00:00:00 2001 From: Bruce Po Date: Tue, 13 Dec 2022 18:09:42 +0000 Subject: [PATCH 3/3] Set acd-audio_rtp_tx permissions for vowifi The nodes /dev/acd-audio_rtp_rx and /dev/acd-audio_rtp_tx permissions should be set system:audio so that ImsMedia can use them, for VoWIFI. BUG: 259874554 Change-Id: I245bd3f2539ba30cb557525eaf95b300efff5d37 Signed-off-by: brucepo@google.com --- conf/ueventd.gs201.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/ueventd.gs201.rc b/conf/ueventd.gs201.rc index a7ff48c3..f9fd1d8f 100644 --- a/conf/ueventd.gs201.rc +++ b/conf/ueventd.gs201.rc @@ -95,6 +95,7 @@ /dev/acd-audio_tap* 0660 system audio /dev/acd-audio_dcdoff_ref 0660 system audio /dev/amcs 0660 system audio +/dev/acd-audio_rtp_* 0660 system audio # Secure MEM driver /dev/s5p-smem 0660 drm drmrpc