Update hwmon fan target sysfs entries
Override the default FanSpeed.Target set implementation so when a target
value is written to the FanSpeed interface it is also updated in the
related fan target sysfs file. This sets a particular fan to the given
target speed.
Resolves openbmc/openbmc#962
Resolves openbmc/phosphor-hwmon#1
Change-Id: I867811737269b3f42d2a0dc15b37782a74f147b8
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/sysfs.hpp b/sysfs.hpp
index a74baaf..cc36ef4 100644
--- a/sysfs.hpp
+++ b/sysfs.hpp
@@ -44,4 +44,24 @@
const std::string& id,
const std::string& sensor);
+ /** @brief Write a hwmon sysfs value
+ *
+ * Calls exit(3) with bad status on failure
+ *
+ * @param[in] value - The value to be written
+ * @param[in] root - The hwmon class root.
+ * @param[in] instance - The hwmon instance (ex. hwmon1).
+ * @param[in] type - The hwmon type (ex. fan).
+ * @param[in] id - The hwmon id (ex. 1).
+ * @param[in] sensor - The hwmon sensor (ex. target).
+ *
+ * @returns - The value written
+ */
+uint64_t writeSysfsWithCallout(const uint64_t& value,
+ const std::string& root,
+ const std::string& instance,
+ const std::string& type,
+ const std::string& id,
+ const std::string& sensor);
+
// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4