From 1ca92842569a2ee04dd200175a645ac4d21b5ad2 Mon Sep 17 00:00:00 2001 From: Labib Date: Tue, 26 Apr 2022 20:37:26 +0800 Subject: [PATCH 1/3] Change sysfs file group to allow write from RadioExt Bug: 212601547 Test: Manual Change-Id: Ie1638265072cc395e7292570dae2a7aadb4d20bb --- conf/init.gs201.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/init.gs201.rc b/conf/init.gs201.rc index 1d4916fc..36df70e2 100644 --- a/conf/init.gs201.rc +++ b/conf/init.gs201.rc @@ -371,7 +371,13 @@ on post-fs-data # Modem replay folder mkdir /mnt/vendor/modem_userdata/replay 0775 radio system - # Write display MIPI frequency from Modem + # Write display frequency config from RadioExt HAL + + # OSC frequency files + chown system system /sys/devices/platform/1c2c0000.drmdsim/1c2c0000.drmdsim.0/osc2_clk_khz + chmod 0664 /sys/devices/platform/1c2c0000.drmdsim/1c2c0000.drmdsim.0/osc2_clk_khz + + # MIPI frequency files chown system system /sys/devices/platform/1c2c0000.drmdsim/hs_clock chown system system /sys/devices/platform/1c2d0000.drmdsim/hs_clock chmod 0664 /sys/devices/platform/1c2c0000.drmdsim/hs_clock From 60ccbd668e63d46675924c1ba146cba7cd7503bb Mon Sep 17 00:00:00 2001 From: Jenny Ho Date: Wed, 27 Apr 2022 13:58:34 +0800 Subject: [PATCH 2/3] dumpstate: add max77759_chg/max77729_pmic register dump Bug: 230360103 Signed-off-by: Jenny Ho Change-Id: I93257674bf96f4e6bb6d9009c5a90571e251198a --- dumpstate/Dumpstate.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index 3f95f6a2..59556e17 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -401,6 +401,8 @@ void Dumpstate::dumpPowerSection(int fd) { if (!PropertiesHelper::IsUserBuild()) { DumpFileToFd(fd, "DC_registers dump", "/sys/class/power_supply/pca94xx-mains/device/registers_dump"); + DumpFileToFd(fd, "max77759_chg registers dump", "/d/max77759_chg/registers"); + DumpFileToFd(fd, "max77729_pmic registers dump", "/d/max77729_pmic/registers"); RunCommandToFd(fd, "fg_model", {"/vendor/bin/sh", "-c", "for f in /d/maxfg* ; do " From 313fe7709cc3a1902cc3f8ac47148808da5aace5 Mon Sep 17 00:00:00 2001 From: Darren Hsu Date: Wed, 27 Apr 2022 01:24:42 +0800 Subject: [PATCH 3/3] powerstats: re-enable AoC power stats reporting with timeout Bug: 219630658 Test: dumpsys android.hardware.power.stats.IPowerStats/default Change-Id: Icb1433bed3438ed4525816e3d3be28b4e0261e89 Signed-off-by: Darren Hsu --- powerstats/Gs201CommonDataProviders.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/powerstats/Gs201CommonDataProviders.cpp b/powerstats/Gs201CommonDataProviders.cpp index 6232a6e0..4ce104fb 100644 --- a/powerstats/Gs201CommonDataProviders.cpp +++ b/powerstats/Gs201CommonDataProviders.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -32,7 +32,7 @@ #include #include -using aidl::android::hardware::power::stats::AocStateResidencyDataProvider; +using aidl::android::hardware::power::stats::AocTimedStateResidencyDataProvider; using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider; using aidl::android::hardware::power::stats::DvfsStateResidencyDataProvider; using aidl::android::hardware::power::stats::UfsStateResidencyDataProvider; @@ -102,6 +102,8 @@ void addPlaceholderEnergyConsumers(std::shared_ptr p) { } void addAoC(std::shared_ptr p) { + // When the given timeout is 0, the timeout will be replaced with "120ms * statesCount". + static const uint64_t TIMEOUT_MILLIS = 0; std::string prefix = "/sys/devices/platform/19000000.aoc/control/"; // Add AoC cores (a32, ff1, hf0, and hf1) @@ -113,8 +115,8 @@ void addAoC(std::shared_ptr p) { }; std::vector> coreStates = { {"DWN", "off"}, {"RET", "retention"}, {"WFI", "wfi"}}; - p->addStateResidencyDataProvider(std::make_unique(coreIds, - coreStates)); + p->addStateResidencyDataProvider(std::make_unique(coreIds, + coreStates, TIMEOUT_MILLIS)); // Add AoC voltage stats std::vector> voltageIds = { @@ -125,7 +127,8 @@ void addAoC(std::shared_ptr p) { {"UUD", "ultra_underdrive"}, {"UD", "underdrive"}}; p->addStateResidencyDataProvider( - std::make_unique(voltageIds, voltageStates)); + std::make_unique(voltageIds, voltageStates, + TIMEOUT_MILLIS)); // Add AoC monitor mode std::vector> monitorIds = { @@ -135,7 +138,8 @@ void addAoC(std::shared_ptr p) { {"MON", "mode"}, }; p->addStateResidencyDataProvider( - std::make_unique(monitorIds, monitorStates)); + std::make_unique(monitorIds, monitorStates, + TIMEOUT_MILLIS)); // Add AoC restart count const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = { @@ -642,9 +646,7 @@ void addGs201CommonDataProviders(std::shared_ptr p) { setEnergyMeter(p); addPixelStateResidencyDataProvider(p); - // TODO(b/220032540): Re-enable AoC reporting when AoC long latency issue is fixed or - // the timeout mechanism is merged. - //addAoC(p); + addAoC(p); addDvfsStats(p); addSoC(p); addCPUclusters(p);