kirkwood: tidy up hwmon_fancontrol

Add indent and sort board_name alphabetically.

Sourcing /lib/functions.sh is already handled by /etc/rc.common. Drop the line.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
master
Sungbo Eo 4 years ago committed by Adrian Schmutzler
parent 3124c9afe3
commit 7e9c7e7b2d

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

Loading…
Cancel
Save