power: update sysfs path for NFC state residency
Bug: 270498656 Test: run singleCommand pts -l verbose -m PtsPowerTestCases Change-Id: I491335c052de363c422ede7a3fb49d5a164a0d7c Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
parent
a3a67e0bb8
commit
88a5bd2684
1 changed files with 10 additions and 1 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include <android/binder_manager.h>
|
#include <android/binder_manager.h>
|
||||||
#include <android/binder_process.h>
|
#include <android/binder_process.h>
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
using aidl::android::hardware::power::stats::AdaptiveDvfsStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::AdaptiveDvfsStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::AocStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::AocStateResidencyDataProvider;
|
||||||
|
@ -678,6 +679,14 @@ void addNFC(std::shared_ptr<PowerStats> p) {
|
||||||
cfgs.emplace_back(generateGenericStateResidencyConfigs(nfcStateConfig, nfcStateHeaders),
|
cfgs.emplace_back(generateGenericStateResidencyConfigs(nfcStateConfig, nfcStateHeaders),
|
||||||
"NFC", "NFC subsystem");
|
"NFC", "NFC subsystem");
|
||||||
|
|
||||||
|
std::string path;
|
||||||
|
struct stat buffer;
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
std::string idx = std::to_string(i);
|
||||||
|
path = "/sys/devices/platform/10c80000.hsi2c/i2c-" + idx + "/" + idx + "-0008/power_stats";
|
||||||
|
if (!stat(path.c_str(), &buffer))
|
||||||
|
break;
|
||||||
|
}
|
||||||
p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
|
p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
|
||||||
"/sys/devices/platform/10c80000.hsi2c/i2c-6/6-0008/power_stats", cfgs));
|
path, cfgs));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue