summaryrefslogtreecommitdiffstats
path: root/mainloop.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-03-09 14:36:08 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-03-30 02:47:06 +0000
commit048ac87fa06a2a1c42f51c9f87931271a4f5a401 (patch)
tree380860360e2c3bd4cfa578e5fb09a6ddcc260b33 /mainloop.cpp
parentbf7b7b1d252dd976fb9ea288652603d354b934c1 (diff)
downloadphosphor-hwmon-048ac87fa06a2a1c42f51c9f87931271a4f5a401.tar.gz
phosphor-hwmon-048ac87fa06a2a1c42f51c9f87931271a4f5a401.zip
Update hwmon fan target sysfs entries
Override the default FanSpeed.Target set implementation so when a target value is written to the FanSpeed interface it is also updated in the related fan target sysfs file. This sets a particular fan to the given target speed. Resolves openbmc/openbmc#962 Resolves openbmc/phosphor-hwmon#1 Change-Id: I867811737269b3f42d2a0dc15b37782a74f147b8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'mainloop.cpp')
-rw-r--r--mainloop.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/mainloop.cpp b/mainloop.cpp
index 7af3096..34970b1 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -25,6 +25,7 @@
#include "env.hpp"
#include "thresholds.hpp"
#include "targets.hpp"
+#include "fan_speed.hpp"
// Initialization for Warning Objects
decltype(Thresholds<WarningObject>::setLo) Thresholds<WarningObject>::setLo =
@@ -54,12 +55,6 @@ decltype(Thresholds<CriticalObject>::alarmLo) Thresholds<CriticalObject>::alarmL
decltype(Thresholds<CriticalObject>::alarmHi) Thresholds<CriticalObject>::alarmHi =
&CriticalObject::criticalAlarmHigh;
-// Initialization for Target objects
-decltype(Targets<FanSpeedObject>::setTarget)
- Targets<FanSpeedObject>::setTarget = &FanSpeedObject::target;
-decltype(Targets<FanSpeedObject>::getTarget)
- Targets<FanSpeedObject>::getTarget = &FanSpeedObject::target;
-
using namespace std::literals::chrono_literals;
@@ -247,7 +242,7 @@ void MainLoop::run()
addThreshold<CriticalObject>(i.first, sensorValue, info);
//TODO openbmc/openbmc#1347
// Handle application restarts to set/refresh fan speed values
- addTarget<FanSpeedObject>(i.first, _hwmonRoot, _instance, info);
+ addTarget<hwmon::FanSpeed>(i.first, _hwmonRoot, _instance, info);
// All the interfaces have been created. Go ahead
// and emit InterfacesAdded.
OpenPOWER on IntegriCloud