]>
code.delx.au - monosys/blob - hw/lenovo-m93p/etc/fancontrol
3 # https://www.kernel.org/doc/html/latest/hwmon/it87.html
4 # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2cbb9c370fe32b5de5243f7338dc6ce8747d495b
10 CT
="$(grep -l coretemp /sys/class/hwmon/hwmon*/name | head -n1 | xargs dirname)/temp1_input"
11 cd "$(grep -l it8792 /sys/class/hwmon/hwmon*/name | head -n1 | xargs dirname)"
15 # automatic fan control - the chip seems to ignore these settings
16 #echo 2 > pwm1_enable # automatic mode
17 #echo 1 > pwm1_auto_channels_temp # temperature channel
18 #echo 127000 > pwm1_auto_point1_temp_hyst # ??
19 #echo 127000 > pwm1_auto_point1_temp # fan off temp
20 #echo 127000 > pwm1_auto_point2_temp # fan start temp
21 #echo 127000 > pwm1_auto_point3_temp # fan max temperature
22 #echo 100 > pwm1_auto_start # start pwm value
23 #echo 0 > pwm1_auto_slope # pwm slope, 1/8th pwm
25 # manual fan control - magic incantation
26 echo 1 > pwm1_enable
# manual mode
27 echo 200000 > pwm1_freq
# quieter fan
28 echo 0 > temp3_type
# disabled unused sensor
29 echo 4 > temp1_type
# switch sensor to thermistor
30 sleep 1 # wait for driver to write to chip
31 echo 0 > temp1_type
# disable the sensor
32 echo 42 > pwm1
# set the fan speed
40 if [ "$TEMPC" -ge 85000 ]; then
42 elif [ "$TEMPC" -ge 80000 ]; then
44 elif [ "$TEMPC" -ge 60000 ]; then
49 if [ "$OLDPWM" -ne "$NEWPWM" ]; then
50 echo "Fan speed change: OLDPWM=$OLDPWM TEMPC=$TEMPC NEWPWM=$NEWPWM"