diff options
author | Daniel Geiger <dgadstg@imsa.edu> | 2017-09-06 12:29:30 -0500 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2017-09-06 12:29:30 -0500 |
commit | a206d3b51d6116181f774a279e783df5dfabc9be (patch) | |
tree | 2a3605a91130c01fea1925e148f17f2423bfee22 | |
parent | 5f387dc61b6727b0971ab8bbaa795f275ec2e8c2 (diff) | |
download | ast2050-yocto-openbmc-a206d3b51d6116181f774a279e783df5dfabc9be.zip ast2050-yocto-openbmc-a206d3b51d6116181f774a279e783df5dfabc9be.tar.gz |
Handle monitoring chassis fans having a maximum rpm other than
2000.
Licensed under the GPLv2+.
-rw-r--r-- | common/recipes-core/fan-ctrl/fan-ctrl/fand.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/recipes-core/fan-ctrl/fan-ctrl/fand.cpp b/common/recipes-core/fan-ctrl/fan-ctrl/fand.cpp index 55fa5ca..7faec4c 100644 --- a/common/recipes-core/fan-ctrl/fan-ctrl/fand.cpp +++ b/common/recipes-core/fan-ctrl/fan-ctrl/fand.cpp @@ -289,6 +289,7 @@ int fan_to_pwm_map[] = {0, 1}; #define REAR_FAN_OFFSET 1 #elif defined(CONFIG_ASUS) +float fan_scale_speed_map[] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; // Chassis fans may have a different max rpm than 2000; scale the stock profile accordingly. int fan_population_map[] = {1, 1, 1, 1, 1, 1, 1, 1}; // 1 == fan populated, 0 == fan disconnected int fan_to_rpm_map[] = {1, 2, 3, 4, 5, 6, 7, 8}; int fan_to_pwm_map[] = {1, 1, 2, 2, 2, 2, 2, 2}; // 1 == 4 pin fans, 2 == 3 pin fans @@ -818,7 +819,8 @@ int fan_speed_okay(const int fan, const int speed, const int slop) { front_pct = fan_rpm_to_pct(rpm_front_map, FRONT_MAP_SIZE, real_fan_speed); } else { - front_pct = fan_rpm_to_pct(rpm_rear_map, REAR_MAP_SIZE, real_fan_speed); + float scale = fan_scale_speed_map[fan]; + front_pct = fan_rpm_to_pct(rpm_rear_map, REAR_MAP_SIZE, (int)(((float)real_fan_speed) / scale)); } front_fan = real_fan_speed; #else |