Merge "powerstats: update NFC sysfs path" into udc-dev am: 1aef63a513
am: de441d90ea
Original change: https://googleplex-android-review.googlesource.com/c/device/google/felix/+/23012899 Change-Id: Ie4a9d66a25b0b956f872dc8327bbc0d5011c1157 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
b7c68b7818
1 changed files with 14 additions and 1 deletions
|
@ -28,6 +28,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::DevfreqStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider;
|
||||||
|
@ -140,6 +141,18 @@ void addGPU(std::shared_ptr<PowerStats> p) {
|
||||||
stateCoeffs));
|
stateCoeffs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string getNfcPath() {
|
||||||
|
struct stat buffer;
|
||||||
|
int size = 128;
|
||||||
|
char path[size];
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
std::snprintf(path, size,
|
||||||
|
"/sys/devices/platform/10970000.hsi2c/i2c-%d/i2c-st21nfc/power_stats", i);
|
||||||
|
if (!stat(path, &buffer)) break;
|
||||||
|
}
|
||||||
|
return std::string(path);
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting.";
|
LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting.";
|
||||||
|
|
||||||
|
@ -160,7 +173,7 @@ int main() {
|
||||||
addWifi(p);
|
addWifi(p);
|
||||||
addTPU(p);
|
addTPU(p);
|
||||||
addUfs(p);
|
addUfs(p);
|
||||||
addNFC(p, "/sys/devices/platform/10970000.hsi2c/i2c-4/i2c-st21nfc/power_stats");
|
addNFC(p, getNfcPath());
|
||||||
addUwb(p);
|
addUwb(p);
|
||||||
addPowerDomains(p);
|
addPowerDomains(p);
|
||||||
addDevfreq(p);
|
addDevfreq(p);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue