Jan Kundrát | f1406a7 | 2017-10-18 17:35:57 +0200 | [diff] [blame] | 1 | [Unit] |
| 2 | Description=Configure the I2C ADT7463 for two-wire fans |
Jan Kundrát | 3cb9f5a | 2018-06-01 18:52:07 +0200 | [diff] [blame] | 3 | ConditionKernelCommandLine=|czechlight=sdn-roadm-add-drop |
| 4 | ConditionKernelCommandLine=|czechlight=sdn-roadm-line |
Jan Kundrát | 51c34e1 | 2019-04-04 21:00:19 +0200 | [diff] [blame] | 5 | ConditionKernelCommandLine=|czechlight=sdn-roadm-coherent-a-d |
Jan Kundrát | eb7e538 | 2019-04-17 12:04:26 +0200 | [diff] [blame] | 6 | ConditionKernelCommandLine=|czechlight=sdn-inline |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 7 | Before=netopeer2.service |
Jan Kundrát | f1406a7 | 2017-10-18 17:35:57 +0200 | [diff] [blame] | 8 | |
| 9 | [Service] |
| 10 | Type=oneshot |
Jan Kundrát | d37ee80 | 2018-06-08 21:34:07 +0200 | [diff] [blame] | 11 | |
| 12 | # Configuration for two-wire fans (0b1111) |
Jan Kundrát | f1406a7 | 2017-10-18 17:35:57 +0200 | [diff] [blame] | 13 | ExecStart=/sbin/i2cset -y 1 0x2e 0x73 0x0f b |
Jan Kundrát | d37ee80 | 2018-06-08 21:34:07 +0200 | [diff] [blame] | 14 | |
| 15 | # Set up the AC voltage threshold to: |
| 16 | # +/- 20mV: 0x00 (default) |
| 17 | # +/- 40mV: 0x04 |
| 18 | # +/- 80mV: 0x08 |
| 19 | # +/- 130mV: 0x0c |
| 20 | ExecStart=/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 |
| 30 | ExecStart=/sbin/i2cset -y 1 0x2e 0x78 0x08 b |
| 31 | |
Jan Kundrát | f1406a7 | 2017-10-18 17:35:57 +0200 | [diff] [blame] | 32 | # ADT7463: Register as an I2C device |
| 33 | ExecStart=/bin/sh -c 'echo adt7463 0x2e > /sys/bus/i2c/devices/i2c-1/new_device' |
| 34 | |
| 35 | [Install] |
| 36 | WantedBy=multi-user.target |