From 0a9fe160d600ece0c5797741042d0e6f975ab101 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Fri, 26 Jan 2018 12:53:15 -0600 Subject: Set tach sensor to functional on start With the addition of a functional state for each fan rotor tach sensor, these should be set to functional on each power on. This is done during fan monitor init mode when no monitor is done and then again once monitoring mode begins. Change-Id: I3c73c1be5f912c7cee8499f47cc799ac3c20983b Signed-off-by: Matthew Barth --- monitor/tach_sensor.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'monitor/tach_sensor.hpp') diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp index 4e57ef5..dd89bbf 100644 --- a/monitor/tach_sensor.hpp +++ b/monitor/tach_sensor.hpp @@ -17,6 +17,17 @@ class Fan; constexpr auto FAN_SENSOR_PATH = "/xyz/openbmc_project/sensors/fan_tach/"; +/** + * The mode fan monitor will run in: + * - init - only do the initialization steps + * - monitor - run normal monitoring algorithm + */ +enum class Mode +{ + init, + monitor +}; + /** * @class TachSensor * @@ -45,6 +56,7 @@ class TachSensor /** * @brief Constructor * + * @param[in] mode - mode of fan monitor * @param[in] bus - the dbus object * @param[in] fan - the parent fan object * @param[in] id - the id of the sensor @@ -53,7 +65,8 @@ class TachSensor * @param[in] timeout - Normal timeout value to use * @param[in] events - sd_event pointer */ - TachSensor(sdbusplus::bus::bus& bus, + TachSensor(Mode mode, + sdbusplus::bus::bus& bus, Fan& fan, const std::string& id, bool hasTarget, -- cgit v1.2.1