blob: c56b443ea1478d493ca6650f719a7efb853ef6cc [file] [log] [blame]
Jan Kundrátf1406a72017-10-18 17:35:57 +02001[Unit]
2Description=Configure the I2C ADT7463 for two-wire fans
Jan Kundrát3cb9f5a2018-06-01 18:52:07 +02003ConditionKernelCommandLine=|czechlight=sdn-roadm-add-drop
4ConditionKernelCommandLine=|czechlight=sdn-roadm-line
Jan Kundrát51c34e12019-04-04 21:00:19 +02005ConditionKernelCommandLine=|czechlight=sdn-roadm-coherent-a-d
Jan Kundráteb7e5382019-04-17 12:04:26 +02006ConditionKernelCommandLine=|czechlight=sdn-inline
Jan Kundrát2f100fc2020-11-02 22:10:16 +01007Before=netopeer2.service
Jan Kundrátf1406a72017-10-18 17:35:57 +02008
9[Service]
10Type=oneshot
Jan Kundrát89297822021-01-19 21:48:52 +010011RemainAfterExit=yes
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