From 1f1d2f190dc5a2f8c2d4041fe8a9338f466e28f3 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 27 Apr 2007 13:37:07 +0000 Subject: [PATCH] pwmconfig: Use smaller steps for low PWM values. Inspired from a patch from the openSuse sensors package. This is a good idea because the PWM/speed relation isn't linear, and it is frequent that the speed changes are concentrated in the low PWM range. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4380 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/pwm/pwmconfig | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9f0c73b8..23b3a78d 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ SVN HEAD Add dme1737 support Man page sensors.conf.5: Update the chip statement section Program isadump: Detect when address bit 7 is a busy flag + Program pwmconfig: Use smaller steps for low PWM values Program rrd: Support non-i2c devices (hwmon class) Add missing shell declarations Update URI diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 6217d594..c9140713 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -248,6 +248,10 @@ echo PLOTTER=gnuplot STEP=15 PDELAY=2 +# Use a smaller step for low PWM values as this is typically where the +# more important fan speed changes are happening. +STEP2=2 +STEP2_BELOW=31 function pwmdetail() { @@ -315,7 +319,12 @@ function pwmdetail() fi break fi - let pwm=$pwm-$STEP + if [ $pwm -lt $STEP2_BELOW ] + then + let pwm=$pwm-$STEP2 + else + let pwm=$pwm-$STEP + fi done pwmdisable $P if [ "$PLOT" = "y" ]