blob: 238a8497e0556e8358287e8fbc96ce3e693f1e3f [file] [log] [blame]
Jan Kundrátf1406a72017-10-18 17:35:57 +02001[Unit]
2Description=Configure the I2C ADT7463 for two-wire fans
3ConditionKernelCommandLine=|czechlight=CL-ROADMv2
Jan Kundrát3cb9f5a2018-06-01 18:52:07 +02004ConditionKernelCommandLine=|czechlight=sdn-roadm-add-drop
5ConditionKernelCommandLine=|czechlight=sdn-roadm-line
Jan Kundrát51c34e12019-04-04 21:00:19 +02006ConditionKernelCommandLine=|czechlight=sdn-roadm-coherent-a-d
Jan Kundrátf1406a72017-10-18 17:35:57 +02007Before=sysrepod.service
8
9[Service]
10Type=oneshot
Jan Kundrátd37ee802018-06-08 21:34:07 +020011
12# Configuration for two-wire fans (0b1111)
Jan Kundrátf1406a72017-10-18 17:35:57 +020013ExecStart=/sbin/i2cset -y 1 0x2e 0x73 0x0f b
Jan Kundrátd37ee802018-06-08 21:34:07 +020014
15# Set up the AC voltage threshold to:
16# +/- 20mV: 0x00 (default)
17# +/- 40mV: 0x04
18# +/- 80mV: 0x08
19# +/- 130mV: 0x0c
20ExecStart=/sbin/i2cset -y 1 0x2e 0x7d 0x0c b
21
22# Pulses per revolution:
23# 1: 0x00
24# 2: 0x55 (default)
25# 3: 0xaa
26# 4: 0xff
27#ExecStart=/sbin/i2cset -y 1 0x2e 0x7b 0x55 b
28
29# Faster (250ms) period for TACH monitoring
30ExecStart=/sbin/i2cset -y 1 0x2e 0x78 0x08 b
31
Jan Kundrátf1406a72017-10-18 17:35:57 +020032# ADT7463: Register as an I2C device
33ExecStart=/bin/sh -c 'echo adt7463 0x2e > /sys/bus/i2c/devices/i2c-1/new_device'
34
35[Install]
36WantedBy=multi-user.target