Powercap: add p8 support
P8 uses i2c-occ and powercap is not created.
Add P8 support by creating powercap object with i2c device name.
Fixes openbmc/openbmc#2688
Change-Id: Ia63070d63f4392cc4b084ab628cdbdcf4206c883
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/powercap.cpp b/powercap.cpp
index 0aca3e4..f2ae331 100644
--- a/powercap.cpp
+++ b/powercap.cpp
@@ -118,7 +118,7 @@
// Create path out to master occ hwmon entry
std::unique_ptr<fs::path> fileName =
std::make_unique<fs::path>(OCC_HWMON_PATH);
- *fileName /= OCC_MASTER_NAME;
+ *fileName /= occMasterName;
*fileName /= "/hwmon/";
// Need to get the hwmonXX directory name, there better only be 1 dir