blob: f9a9576aac09d7a288c9175d40766520e47bfb11 [file] [log] [blame]
[Unit]
Description=Enable fans
ConditionKernelCommandLine=|czechlight=sdn-inline-g2
ConditionKernelCommandLine=|czechlight=sdn-roadm-add-drop-g2
ConditionKernelCommandLine=|czechlight=sdn-roadm-coherent-a-d-g2
ConditionKernelCommandLine=|czechlight=sdn-roadm-hires-add-drop-g2
ConditionKernelCommandLine=|czechlight=sdn-roadm-line-g2
ConditionKernelCommandLine=|czechlight=sdn-roadm-hires-add-drop-g2
[Service]
Type=oneshot
RemainAfterExit=yes
# The driver only supports enabling RPM input when setting RPM mode. It also does not reset the RPM input when switching back to PWM mode.
# So, we first enable RPM mode (2), this sets the TACH_ENABLE bit and then set PWM mode, because RPM mode doesn't work anyway.
ExecStart=/bin/bash -c 'for FAN in /sys/bus/i2c/devices/1-0020/hwmon/hwmon*/pwm{1,2,3,4}_enable; do echo 2 > "$FAN"; echo 1 > "$FAN"; done'