diff options
author | Lei YU <mine260309@gmail.com> | 2017-11-30 16:03:50 +0800 |
---|---|---|
committer | Lei YU <mine260309@gmail.com> | 2017-12-12 17:09:02 +0800 |
commit | 41470e56e5dce5d9d138fd2a136f0010571bc613 (patch) | |
tree | e414217104ad36ec1000dfe8a6fb7e6dd107c438 /occ_manager.cpp | |
parent | 482e31ff8e43e0fefbd697b1985795c4d35eec74 (diff) | |
download | openpower-occ-control-41470e56e5dce5d9d138fd2a136f0010571bc613.tar.gz openpower-occ-control-41470e56e5dce5d9d138fd2a136f0010571bc613.zip |
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>
Diffstat (limited to 'occ_manager.cpp')
-rw-r--r-- | occ_manager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/occ_manager.cpp b/occ_manager.cpp index 42b6390..67e96a6 100644 --- a/occ_manager.cpp +++ b/occ_manager.cpp @@ -108,6 +108,7 @@ void Manager::initStatusObjects() static_assert(sizeof(DEV_PATH) != 0); auto deviceNames = i2c_occ::getOccHwmonDevices(DEV_PATH); + auto occMasterName = deviceNames.front(); for (auto& name : deviceNames) { i2c_occ::i2cToDbus(name); @@ -120,6 +121,11 @@ void Manager::initStatusObjects() path.c_str(), *this)); } + // The first device is master occ + pcap = std::make_unique<open_power::occ::powercap::PowerCap>( + bus, + *statusObjects.front(), + occMasterName); } #endif |