Add I2C OCC support for P8 systems
P8 system uses I2C OCC and it uses different driver for occ-hwmon.
Add `--enable-i2c-occ` configure option to enable the support.
It searches i2c device names in sysfs to get all occ-hwmon devices and
use the i2c device name to bind/unbind the driver.
The occ control object path for I2C OCC hwmon becomes something like
/org/open_power/control/3_0050, where 3_0050 is the i2c address.
Change-Id: I8b9d8d4429c563528dc88fb2679b265c53d7a2d5
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/occ_status.hpp b/occ_status.hpp
index 2e12806..23b2080 100644
--- a/occ_status.hpp
+++ b/occ_status.hpp
@@ -7,6 +7,8 @@
#include <org/open_power/Control/Host/server.hpp>
#include "occ_events.hpp"
#include "occ_device.hpp"
+#include "i2c_occ.hpp"
+
namespace open_power
{
namespace occ
@@ -59,7 +61,11 @@
callBack(callBack),
instance(((this->path.back() - '0'))),
device(event,
+#ifdef I2C_OCC
+ i2c_occ::getI2cDeviceName(path),
+#else
name + std::to_string(instance + 1),
+#endif
std::bind(&Status::deviceErrorHandler, this)),
hostControlSignal(
bus,