summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2019-05-10 09:57:42 +0000
committerRaptor Engineering Development Team <support@raptorengineering.com>2019-05-10 10:03:22 +0000
commit6647f1399f68bbf47a1d6a016e1c17bd74b39aec (patch)
tree216c450d2b5df769ad6c039362ed06a880704c05
parent94cf82cce47d5257cf4cf9c02e2ce0565260008e (diff)
downloadphosphor-hwmon-6647f1399f68bbf47a1d6a016e1c17bd74b39aec.tar.gz
phosphor-hwmon-6647f1399f68bbf47a1d6a016e1c17bd74b39aec.zip
Add PWM device node override option in RPM mode04-16-2019
-rw-r--r--targets.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/targets.hpp b/targets.hpp
index 540338c..49e02ec 100644
--- a/targets.hpp
+++ b/targets.hpp
@@ -84,6 +84,18 @@ std::shared_ptr<T> addTarget(const SensorSet::key_type& sensor,
const std::string pwm = "pwm"s;
const std::string empty = ""s;
+ if (InterfaceType::FAN_SPEED == type)
+ {
+ // If RPM_TARGET is set, use the specified pwm id
+ auto id = env::getEnv("RPM_TARGET", sensor);
+ if (!id.empty())
+ {
+ targetName = pwm;
+ targetId = id;
+ }
+ entry = empty;
+ }
+
if (InterfaceType::FAN_PWM == type)
{
targetName = pwm;
OpenPOWER on IntegriCloud