From d5365edf2033ae4cf1eb9564a28244de570a51f1 Mon Sep 17 00:00:00 2001 From: chris-est Date: Thu, 24 Oct 2019 19:42:34 +0200 Subject: sensors-detect: add support for FTS Teutates Chip This patch adds support for the FTS Teutates Chip, used on Fujitsu Mainboards for Intel Skylake and later Chipsets. It is based on a patch from Fujitsu and was tested on a D-3446-S Mainboard. The corresponding kernel module can be found here [1]. This is a revised version of an earlier pull request [2]. [1]: https://github.com/torvalds/linux/blob/master/drivers/hwmon/ftsteutates.c#L711 [2]: https://github.com/lm-sensors/lm-sensors/pull/9 --- prog/detect/sensors-detect | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 709a469f..6fc441aa 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1391,6 +1391,11 @@ use vars qw(@i2c_adapter_names); driver => "fschmd", i2c_addrs => [0x73], i2c_detect => sub { fsc_detect(@_, 7); }, + }, { + name => "FTS Teutates", + driver => "ftsteutates", + i2c_addrs => [0x73], + i2c_detect => sub { fts_detect(@_); }, }, { name => "ALi M5879", driver => "to-be-written", @@ -6364,6 +6369,33 @@ sub fsc_detect return 8; } +# Chip to detect: FTS Teutates +# Registers used: +# 0x00: Device ID +# 0x01: Revision +# 0x0C: Device Detection Register 1 +# 0x0D: Device Detection Register 2 +# 0x0E: Device Detection Register 3 +sub fts_detect +{ + my ($file) = @_; + + # Device ID must be 0x11 + # 0x10 == Baseboard Management Controller + # 0x01 == Teutates + return unless i2c_smbus_read_byte_data($file, 0x00) == 0x11; + + # Revision must be greater or equal 0x2b to use device detection + return unless i2c_smbus_read_byte_data($file, 0x01) >= 0x2b; + + # Device Detection Registers must be 0x17, 0x34, 0x54 + return unless i2c_smbus_read_byte_data($file, 0x0C) == 0x17 + and i2c_smbus_read_byte_data($file, 0x0D) == 0x34 + and i2c_smbus_read_byte_data($file, 0x0E) == 0x54; + + return 8; +} + # Chip to detect: 0 = LM93, 1 = LM94 # Registers used: # 0x3E: Manufacturer ID -- cgit v1.2.1