blob: 89b2d814f9de69adec7c4b4242b10a1edc3a7fe3 [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áteb7e5382019-04-17 12:04:26 +02007ConditionKernelCommandLine=|czechlight=sdn-inline
Jan Kundrátf1406a72017-10-18 17:35:57 +02008Before=sysrepod.service
9
10[Service]
11Type=oneshot
Jan Kundrátd37ee802018-06-08 21:34:07 +020012
13# Configuration for two-wire fans (0b1111)
Jan Kundrátf1406a72017-10-18 17:35:57 +020014ExecStart=/sbin/i2cset -y 1 0x2e 0x73 0x0f b
Jan Kundrátd37ee802018-06-08 21:34:07 +020015
16# Set up the AC voltage threshold to:
17# +/- 20mV: 0x00 (default)
18# +/- 40mV: 0x04
19# +/- 80mV: 0x08
20# +/- 130mV: 0x0c
21ExecStart=/sbin/i2cset -y 1 0x2e 0x7d 0x0c b
22
23# Pulses per revolution:
24# 1: 0x00
25# 2: 0x55 (default)
26# 3: 0xaa
27# 4: 0xff
28#ExecStart=/sbin/i2cset -y 1 0x2e 0x7b 0x55 b
29
30# Faster (250ms) period for TACH monitoring
31ExecStart=/sbin/i2cset -y 1 0x2e 0x78 0x08 b
32
Jan Kundrátf1406a72017-10-18 17:35:57 +020033# ADT7463: Register as an I2C device
34ExecStart=/bin/sh -c 'echo adt7463 0x2e > /sys/bus/i2c/devices/i2c-1/new_device'
35
36[Install]
37WantedBy=multi-user.target