power: update sysfs path for NFC state residency am: 88a5bd2684
Original change: https://googleplex-android-review.googlesource.com/c/device/google/zuma/+/23662311 Change-Id: I126d008f4e6043674761b91d9952fcb30769eac4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
c725bbf729
1 changed files with 10 additions and 1 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
#include <log/log.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
using aidl::android::hardware::power::stats::AdaptiveDvfsStateResidencyDataProvider;
|
||||
using aidl::android::hardware::power::stats::AocStateResidencyDataProvider;
|
||||
|
@ -678,6 +679,14 @@ void addNFC(std::shared_ptr<PowerStats> p) {
|
|||
cfgs.emplace_back(generateGenericStateResidencyConfigs(nfcStateConfig, nfcStateHeaders),
|
||||
"NFC", "NFC subsystem");
|
||||
|
||||
p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
|
||||
"/sys/devices/platform/10c80000.hsi2c/i2c-6/6-0008/power_stats", cfgs));
|
||||
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>(
|
||||
path, cfgs));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue