Update i2c device paths
Update i2c device paths with static bus numbers.
Also remove some redundant paths.
Bug: 323447554
Test: Boot to home
Change-Id: Ibe1f5060daa45a7d19be08bd60c3f3a615427632
Signed-off-by: Jacky Liu <qsliu@google.com>
diff --git a/powerstats/raven/service.cpp b/powerstats/raven/service.cpp
index d8494e2..56fc6fd 100644
--- a/powerstats/raven/service.cpp
+++ b/powerstats/raven/service.cpp
@@ -136,18 +136,8 @@
addGs101CommonDataProviders(p);
addDisplay(p);
- if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats", &buffer)) {
- addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats");
- } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats", &buffer)) {
- addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats");
- } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats", &buffer)) {
- addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats");
- } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats", &buffer)) {
- addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats");
- } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats", &buffer)) {
- addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats");
- } else {
- addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-8/i2c-st21nfc/power_stats");
+ if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-7/7-0008/power_stats", &buffer)) {
+ addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-7/7-0008/power_stats");
}
const std::string instance = std::string() + PowerStats::descriptor + "/default";
binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str());