diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2017-06-23 14:38:05 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2017-07-06 17:25:12 -0500 |
commit | 8600d9a0058071951e0881037deff77fc03d1601 (patch) | |
tree | 6d1b42e94f22db089ed39534555acaacd337bee9 /control/zone.hpp | |
parent | 0ce99d8b377e68b5286c37e7e644301051972083 (diff) | |
download | phosphor-fan-presence-8600d9a0058071951e0881037deff77fc03d1601.tar.gz phosphor-fan-presence-8600d9a0058071951e0881037deff77fc03d1601.zip |
Timer to decrease fan speeds
Create a repeating timer for decreasing fan speeds where the fan speeds
in the zone are decreased when the timer expires and a decrease speed
request exists with no increase request present or active.
Change-Id: I419592f6f50c0ed524f8bf3ebf183854ab5ef2ea
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.hpp')
-rw-r--r-- | control/zone.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/control/zone.hpp b/control/zone.hpp index f445472..30de150 100644 --- a/control/zone.hpp +++ b/control/zone.hpp @@ -5,6 +5,7 @@ #include <sdbusplus/server.hpp> #include "fan.hpp" #include "types.hpp" +#include "timer.hpp" namespace phosphor { @@ -46,10 +47,12 @@ class Zone * * @param[in] mode - mode of fan control * @param[in] bus - the dbus object + * @param[in] events - sd_event pointer * @param[in] def - the fan zone definition data */ Zone(Mode mode, sdbusplus::bus::bus& bus, + phosphor::fan::event::EventPtr& events, const ZoneDefinition& def); /** @@ -204,6 +207,12 @@ class Zone */ void requestSpeedDecrease(uint64_t targetDelta); + /** + * @brief Callback function for the decrease timer that processes any + * requested speed decreases if allowed + */ + void decTimerExpired(); + private: /** @@ -267,6 +276,11 @@ class Zone uint64_t _decSpeedDelta = 0; /** + * The decrease timer object + */ + phosphor::fan::util::Timer _decTimer; + + /** * The vector of fans in this zone */ std::vector<std::unique_ptr<Fan>> _fans; |