[PATCH skeleton v6 10/20] Modify the hard-coded hwmon ID for PowerCap

OpenBMC Patches openbmc-patches at stwcx.xyz
Fri Apr 15 17:01:47 AEST 2016


From: johnhcwang <hsienchiang at gmail.com>

After we enable I2C-6 lm75 outlet sensor in device stree, the hwmon ID
of PowerCap won't be 3 anymore. So we have to modify it as real ID.
---
 bin/Sensors.py         | 2 +-
 bin/sensor_manager2.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/Sensors.py b/bin/Sensors.py
index f951eeb..1c6a961 100755
--- a/bin/Sensors.py
+++ b/bin/Sensors.py
@@ -137,7 +137,7 @@ class PowerCap(VirtualSensor):
 	def __init__(self, bus, name):
 		VirtualSensor.__init__(self, bus, name)
 		SensorValue.setValue(self, 0)
-		self.sysfs_attr = "/sys/class/hwmon/hwmon3/user_powercap"
+		self.sysfs_attr = "/sys/class/hwmon/hwmon4/user_powercap"
 	##override setValue method
 	@dbus.service.method(SensorValue.IFACE_NAME,
 		in_signature='v', out_signature='')
diff --git a/bin/sensor_manager2.py b/bin/sensor_manager2.py
index b5aac53..6aaef3e 100755
--- a/bin/sensor_manager2.py
+++ b/bin/sensor_manager2.py
@@ -54,9 +54,9 @@ if __name__ == '__main__':
 
 	obj_path = OBJ_PATH+"/host/PowerCap"
 	sensor_obj = Sensors.PowerCap(bus,obj_path)
-	## hwmon3 is default for master OCC on Barreleye.
+	## hwmon4 is default for master OCC on Barreleye.
 	## should rewrite sensor_manager to remove hardcode
-	sensor_obj.sysfs_attr = "/sys/class/hwmon/hwmon3/user_powercap"
+	sensor_obj.sysfs_attr = "/sys/class/hwmon/hwmon4/user_powercap"
 	root_sensor.add(obj_path,sensor_obj)
 
 	obj_path = OBJ_PATH+"/host/BootProgress"
-- 
2.7.1




More information about the openbmc mailing list