diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2017-06-22 15:07:29 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2017-07-06 17:25:01 -0500 |
commit | 0ce99d8b377e68b5286c37e7e644301051972083 (patch) | |
tree | f2d6fbafaf744dbc2cbe960e9609c5872f703cae /control/zone.hpp | |
parent | 240397b9b80437db77d8d01db2b187d02ef415f7 (diff) | |
download | phosphor-fan-presence-0ce99d8b377e68b5286c37e7e644301051972083.tar.gz phosphor-fan-presence-0ce99d8b377e68b5286c37e7e644301051972083.zip |
Support speed decrease events
A net decrease speed action determines the net decrease delta from each
group member's property value and requests a speed decrease of that
delta from the current target speed.
From all the requests for a speed decrease on a zone, only the lowest
net decrease is used from all the groups subscribed to decrease a zone's
speed. The new target speed is only decreased when no increase requests
exist and the resulting target is above the zone's floor speed,
otherwise the floor speed is set as the new target.
Resolves openbmc/openbmc#1626
Change-Id: Iaefa7b25c3f44691dd3ca4084bfddd3c1a504de9
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.hpp')
-rw-r--r-- | control/zone.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/control/zone.hpp b/control/zone.hpp index cc05959..f445472 100644 --- a/control/zone.hpp +++ b/control/zone.hpp @@ -179,6 +179,16 @@ class Zone }; /** + * @brief Get the decrease speed delta + * + * @return - The current decrease speed delta + */ + inline auto& getDecSpeedDelta() const + { + return _decSpeedDelta; + }; + + /** * @brief Calculate the requested target speed from the given delta * and increase the fan speeds, not going above the ceiling. * @@ -186,6 +196,14 @@ class Zone */ void requestSpeedIncrease(uint64_t targetDelta); + /** + * @brief Calculate the requested target speed from the given delta + * and increase the fan speeds, not going above the ceiling. + * + * @param[in] targetDelta - The delta to increase the target speed by + */ + void requestSpeedDecrease(uint64_t targetDelta); + private: /** @@ -244,6 +262,11 @@ class Zone uint64_t _incSpeedDelta = 0; /** + * Speed decrease delta + */ + uint64_t _decSpeedDelta = 0; + + /** * The vector of fans in this zone */ std::vector<std::unique_ptr<Fan>> _fans; |