Add PSU PWM sensor to support FSC
Add PSU PWM sensor to allow FSC control PSU fan pwm.
Tested:
Change property Target to 100 in dbus interface xyz.openbmc_project.Control.FanPwm
path /xyz/openbmc_project/control/fanpwm/Pwm_PSU1_Fan_1, the value in
/sys/class/hwmon/hwmonx/fan1_target also become 100, and value property in interface
/xyz/openbmc_project/sensors/fan_pwm/Pwm_PSU1_Fan_1 become 39.2157
Run ipmitool sensor list, bellow sensors will show like:
Pwm PSU1 Fan 1 | 39.200 | unspecified | ok | na | na | na | na | na | na
Pwm PSU2 Fan 1 | 0.000 | unspecified | ok | na | na | na | na | na | na
Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com>
Change-Id: I6a4d50912a190297dbcf4a4e5c511607f71cb0c0
diff --git a/include/PSUSensor.hpp b/include/PSUSensor.hpp
index 0c4edb1..afc748b 100644
--- a/include/PSUSensor.hpp
+++ b/include/PSUSensor.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include <PwmSensor.hpp>
#include <Thresholds.hpp>
#include <sdbusplus/asio/object_server.hpp>
#include <sensor.hpp>
diff --git a/include/PwmSensor.hpp b/include/PwmSensor.hpp
index 67aff56..973d695 100644
--- a/include/PwmSensor.hpp
+++ b/include/PwmSensor.hpp
@@ -5,7 +5,7 @@
class PwmSensor
{
public:
- PwmSensor(const std::string& sysPath,
+ PwmSensor(const std::string& name, const std::string& sysPath,
sdbusplus::asio::object_server& objectServer,
const std::string& sensorConfiguration);
~PwmSensor();