From 0ab90ca75b825db8e2427ea62ea3ee212c9accbb Mon Sep 17 00:00:00 2001 From: Lei YU Date: Thu, 13 Jul 2017 17:02:23 +0800 Subject: 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 --- occ_device.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'occ_device.hpp') diff --git a/occ_device.hpp b/occ_device.hpp index 6538597..a2b4e85 100644 --- a/occ_device.hpp +++ b/occ_device.hpp @@ -5,6 +5,8 @@ #include "occ_events.hpp" #include "occ_errors.hpp" #include "config.h" + + namespace open_power { namespace occ @@ -34,7 +36,11 @@ class Device Device(EventPtr& event, const std::string& name, std::function callBack = nullptr) : +#ifdef I2C_OCC + config(name), +#else config(name + '-' + "dev0"), +#endif errorFile(fs::path(config) / "occ_error"), error(event, errorFile, callBack) { -- cgit v1.2.1