From bc0b859f04fca852c55606a5e4012d896aa65544 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 8 Sep 2008 09:52:55 +0000 Subject: [PATCH] Fix MINSTOP and MINSTART test functions. PWM must be enabled for the duration of the test, and disabled again afterwards. Bug reported by Philippe Roubach. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5319 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/pwm/pwmconfig | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 15474a0f..ab7d5f2d 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ SVN-HEAD Module i2c-i801: Remove verbose debugging messages (2.6 backport) Properly report bus arbitration lost (2.6 backport) Module i2c-piix4: Minor cleanups (2.6 backport) + Program pwmconfig: Fix MINSTOP and MINSTART test functions Program sensors-detect: Add VIA VT1212 support Add SMSC EMC2700LPC support Add ITE IT8720 support diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 65498da4..8f3806aa 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -1,6 +1,6 @@ #!/bin/bash # -# pwmconfig v0.9 +# pwmconfig v0.10 # Tests the pwm outputs of sensors and configures fancontrol # # Warning!!! This program will stop your fans, one at a time, @@ -9,7 +9,7 @@ # Verify that all fans are running at normal speed after this # program has exited!!! # -# Copyright (C) 2007 Jean Delvare +# Copyright (C) 2007, 2008 Jean Delvare # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -567,19 +567,22 @@ function TestMinStart { echo 'We will use this value +20 as the starting speed.' let fanok=0 let fanval=0 + + pwmenable $pwms until [ "$fanok" = "1" ] do let fanval=fanval+10 if [ $fanval -gt 240 ] ; then let fanval=$MAX ; let fanok=1 ; fi echo -n "Setting $pwms to $fanval..." - echo $fanval > $pwms + pwmset $pwms $fanval read FANTEST if [ "$FANTEST" != "" ] ; then let fanok=1 ; fi done + pwmdisable $pwms + let fanval=fanval+20 if [ $fanval -gt 240 ] ; then let fanval=$MAX ; fi echo "OK, using $fanval" - echo $MAX > $pwms } function TestMinStop { @@ -590,19 +593,22 @@ function TestMinStop { echo 'We will use this value +20 as the minimum speed.' let fanok=0 let fanval=$MAX + + pwmenable $pwms until [ "$fanok" = "1" ] do let fanval=fanval-10 if [ $fanval -lt 0 ] ; then let fanval=0 ; let fanok=1 ; fi echo -n "Setting $pwms to $fanval..." - echo $fanval > $pwms + pwmset $pwms $fanval read FANTEST if [ "$FANTEST" != "" ] ; then let fanok=1 ; fi done + pwmdisable $pwms + let fanval=fanval+20 if [ $fanval -gt $MAX ] ; then let fanval=$MAX ; fi echo "OK, using $fanval" - echo $MAX > $pwms } function SaveConfig {