device_google_gs-common/touch/gti/dump_gti1.sh
Super Liu 8aaaec0793 Refine the GTI dump order
Adjust the order to get the touch snapshot as soon as possible.
This will avoid the following operations to overwrite the touch
statistics for further analysis.

Bug: 356993163
Flag: EXEMPT bugfix
Test: Manual test.
Change-Id: I012544849868ca7b81c11ffa13858eaa209af5c5
Signed-off-by: Super Liu <supercjliu@google.com>
2024-08-09 01:47:32 +00:00

69 lines
1.6 KiB
Bash

#!/vendor/bin/sh
path="/sys/devices/virtual/goog_touch_interface/gti.1"
procfs_path="/proc/goog_touch_interface/gti.1"
if [[ -d "$procfs_path" ]]; then
heatmap_path=$procfs_path
else
heatmap_path=$path
fi
if [[ -f "${procfs_path}/dump" ]]; then
echo "------ Dump ------"
cat ${procfs_path}/dump
fi
echo "------ Force Touch Active ------"
result=$( cat "$path/force_active" 2>&1 )
if [ $? -eq 0 ]; then
state=$( echo "$result" |cut -d " " -f 2 )
if [ "$state" = "locked" ]; then
echo "The force_active is already locked!"
else
echo 1 > $path/force_active
if [ $? -ne 0 ]; then
echo "Failed to active touch device"
exit 1
fi
fi
else
if [[ $result == *Operation\ not\ supported* ]]; then
echo "force_active is not support, skip it"
else
echo "Failed to read the state of force_force"
exit 1
fi
fi
echo "------ Touch Firmware Version ------"
cat $path/fw_ver
echo "------ Panel ID ------"
cat $path/panel_id
echo "------ Offload ID ------"
cat $path/offload_id
echo "------ Get Mutual Sensing Data - Baseline ------"
cat $heatmap_path/ms_base
echo "------ Get Mutual Sensing Data - Delta ------"
cat $heatmap_path/ms_diff
echo "------ Get Mutual Sensing Data - Raw ------"
cat $heatmap_path/ms_raw
echo "------ Get Self Sensing Data - Baseline ------"
cat $heatmap_path/ss_base
echo "------ Get Self Sensing Data - Delta ------"
cat $heatmap_path/ss_diff
echo "------ Get Self Sensing Data - Raw ------"
cat $heatmap_path/ss_raw
echo "------ Self Test ------"
cat $path/self_test
echo "------ Disable Force Touch Active ------"
echo 0 > $path/force_active