Write pwmX_enable for fans that have a fanX_target
For fans that have a fanX_target hwmon sysfs attribute,
write the pwmX_enable on startup to put that fan into
RPM mode, which is safe to do because this application
requires that the target is written in RPMs. The write
will only occur if the pwm_enable file exists.
In the future, if fans with a target need to run in pwm
mode, this code will need to be updated to convert between
RPM and pwm anyway and the pwm_enable value can then
be different based on that.
Resolves openbmc/openbmc#1584
Change-Id: I4f6f3ac8d6651314367aaf5c51ac176220f1fba6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/fan_speed.hpp b/fan_speed.hpp
index 7c7da3a..eb9882c 100644
--- a/fan_speed.hpp
+++ b/fan_speed.hpp
@@ -45,6 +45,11 @@
*/
uint64_t target(uint64_t value) override;
+ /**
+ * @brief Writes the pwm_enable sysfs entry.
+ */
+ void enable();
+
private:
/** @brief hwmon class root */
std::string sysfsRoot;