Merge "powerstats: update NFC sysfs path" into udc-dev
This commit is contained in:
commit
1aef63a513
1 changed files with 14 additions and 1 deletions
|
@ -28,6 +28,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::DevfreqStateResidencyDataProvider;
|
||||
using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider;
|
||||
|
@ -140,6 +141,18 @@ void addGPU(std::shared_ptr<PowerStats> p) {
|
|||
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() {
|
||||
LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting.";
|
||||
|
||||
|
@ -160,7 +173,7 @@ int main() {
|
|||
addWifi(p);
|
||||
addTPU(p);
|
||||
addUfs(p);
|
||||
addNFC(p, "/sys/devices/platform/10970000.hsi2c/i2c-4/i2c-st21nfc/power_stats");
|
||||
addNFC(p, getNfcPath());
|
||||
addUwb(p);
|
||||
addPowerDomains(p);
|
||||
addDevfreq(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue