blob: f9a9576aac09d7a288c9175d40766520e47bfb11 [file] [log] [blame]
Václav Kubernát771b8232021-04-23 14:16:07 +02001[Unit]
2Description=Enable fans
3ConditionKernelCommandLine=|czechlight=sdn-inline-g2
4ConditionKernelCommandLine=|czechlight=sdn-roadm-add-drop-g2
5ConditionKernelCommandLine=|czechlight=sdn-roadm-coherent-a-d-g2
6ConditionKernelCommandLine=|czechlight=sdn-roadm-hires-add-drop-g2
7ConditionKernelCommandLine=|czechlight=sdn-roadm-line-g2
8ConditionKernelCommandLine=|czechlight=sdn-roadm-hires-add-drop-g2
9
10[Service]
11Type=oneshot
12RemainAfterExit=yes
Jan Kundráta12acd92022-01-13 12:53:30 +010013# 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.
14# 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.
15ExecStart=/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'