summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarpreet "Eli" Sangha <eliptus@google.com>2018-12-21 13:14:52 +0900
committerHarpreet "Eli" Sangha <eliptus@google.com>2019-01-16 13:45:03 +0900
commit4b2d22ced6923f0877e63f1cccb6fb4ea3826665 (patch)
tree6d1b194bbabb570c8a2559212f46dafe11e28218
parent5e58194bb5b96cbe9f031bda2dbc7488480ba999 (diff)
downloadcrosshatch-4b2d22ced6923f0877e63f1cccb6fb4ea3826665.tar.gz
dumpstate: add vibrator
dump the vibrator driver's sysfs nodes Bug: 121306282 Test: dumpstate -z -o dumpstate Change-Id: I9c3ae6681758afed94939eb2360ebe73e5d0b2c1 Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
-rwxr-xr-xdumpstate/DumpstateDevice.cpp25
-rw-r--r--init.hardware.rc5
2 files changed, 30 insertions, 0 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index b595ab55..7ef0e139 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -282,6 +282,29 @@ static void DumpUFS(int fd) {
}
}
+static void DumpVibrator(int fd) {
+ const std::string dir = "/sys/class/leds/vibrator/device/";
+ const std::vector<std::string> files {
+ "comp_enable",
+ "cp_dig_scale",
+ "cp_trigger_index",
+ "cp_trigger_queue",
+ "dig_scale",
+ "f0_stored",
+ "heartbeat",
+ "leds/vibrator/activate",
+ "leds/vibrator/duration",
+ "leds/vibrator/state",
+ "num_waves",
+ "redc_stored",
+ "standby_timeout",
+ };
+
+ for (const auto &file : files) {
+ DumpFileToFd(fd, "Vibrator", dir+file);
+ }
+}
+
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
if (handle == nullptr || handle->numFds < 1) {
@@ -357,6 +380,8 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
RunCommandToFd(fd, "Citadel SELFTEST", {"/vendor/bin/hw/citadel_updater", "--selftest"});
}
+ DumpVibrator(fd);
+
// Dump various events in WiFi data path
DumpFileToFd(fd, "WLAN DP Trace", "/d/wlan/dpt_stats/dump_set_dpt_logs");
diff --git a/init.hardware.rc b/init.hardware.rc
index e5e40860..588d3a93 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -436,11 +436,16 @@ on early-boot
chmod 0660 /dev/vd6281
# Permission for Vibrator
+ chown system system /sys/class/leds/vibrator/device/comp_enable
+ chown system system /sys/class/leds/vibrator/device/cp_dig_scale
chown system system /sys/class/leds/vibrator/device/cp_trigger_index
chown system system /sys/class/leds/vibrator/device/cp_trigger_queue
chown system system /sys/class/leds/vibrator/device/dig_scale
chown system system /sys/class/leds/vibrator/device/f0_stored
+ chown system system /sys/class/leds/vibrator/device/heartbeat
+ chown system system /sys/class/leds/vibrator/device/num_waves
chown system system /sys/class/leds/vibrator/device/redc_stored
+ chown system system /sys/class/leds/vibrator/device/standby_timeout
# Permission for LED driver
chown system system /sys/class/leds/red/on_off_ms