summaryrefslogtreecommitdiffstats
path: root/control/zone.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-06-13 16:29:09 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-06-28 15:59:11 +0000
commite0ca13eb5b2feba044505e3234c8381d3ab03187 (patch)
tree01002dfa5a34d991477e3f3347b8c1e05457c5e8 /control/zone.cpp
parent618027abcf491b0b58f71bfe2b48c55dfb86462e (diff)
downloadphosphor-fan-presence-e0ca13eb5b2feba044505e3234c8381d3ab03187.tar.gz
phosphor-fan-presence-e0ca13eb5b2feba044505e3234c8381d3ab03187.zip
Enable setting/adjusting fan ceiling speed
Set the default ceiling to be what's given as full speed and adjust the ceiling speed based on an average of a given set of sensor values. The ceiling is chosen from a given map's key transition values. The map consists of key, value pairs where each key is the sensor value transition point and the value is the ceiling speed for when that transition occurs. The previous key value is needed to determine the direction in which to chose the appropriate ceiling speed allowing a buffer zone between ceiling changes if defined to. Resolves openbmc/openbmc#1628 Change-Id: I7c9c553b5d0c3219c51b563aec7dd5d5f090916b Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.cpp')
-rw-r--r--control/zone.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index 67e22d9..d569aa8 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -37,7 +37,8 @@ Zone::Zone(Mode mode,
_bus(bus),
_fullSpeed(std::get<fullSpeedPos>(def)),
_zoneNum(std::get<zoneNumPos>(def)),
- _defFloorSpeed(std::get<floorSpeedPos>(def))
+ _defFloorSpeed(std::get<floorSpeedPos>(def)),
+ _defCeilingSpeed(std::get<fullSpeedPos>(def))
{
auto& fanDefs = std::get<fanListPos>(def);
@@ -109,6 +110,11 @@ void Zone::setSpeed(uint64_t speed)
{
speed = _floorSpeed;
}
+ //TODO openbmc/openbmc#1626 Move to control algorithm function
+ if (speed > _ceilingSpeed)
+ {
+ speed = _ceilingSpeed;
+ }
fan->setSpeed(speed);
}
}
OpenPOWER on IntegriCloud