nsa310_fancontrol 683 B

1234567891011121314151617181920
  1. #!/bin/sh /etc/rc.common
  2. START=98
  3. boot() {
  4. . /lib/functions.sh
  5. #configuring lm85 onboard temp/fan controller to run the fan on its own
  6. #for more information, please read https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
  7. path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0'
  8. case $(board_name) in
  9. nsa310b)
  10. echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1
  11. echo 1 > "$path_to_hwmon/pwm1_auto_channels" # temp1 is the only one that changes
  12. echo 23000 > "$path_to_hwmon/temp1_auto_temp_min"
  13. echo 43000 > "$path_to_hwmon/temp1_auto_temp_max" # next step is 49600 millicelsius, or 50 celsius, 43 celsius is better
  14. ;;
  15. esac
  16. }