From 51817d862ae67da65fdd6e5543c8b84eef90dd13 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 27 Sep 2003 08:19:20 +0000 Subject: [PATCH] Add FSC Hermes detection. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2002 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 9309c688..a001f181 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -776,7 +776,8 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect fscscy_detect pcf8591_detect arp_detect ipmi_kcs_detect ipmi_smic_detect via8231_isa_detect lm85_detect smartbatt_detect adm1026_detect w83l785ts_detect lm83_detect lm90_detect - saa1064_detect w83l784r_detect mozart_detect max6650_detect); + saa1064_detect w83l784r_detect mozart_detect max6650_detect + fscher_detect); # This is a list of all recognized chips. # Each entry must have the following fields: @@ -1195,17 +1196,23 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect i2c_detect => sub { ddcmonitor_detect @_ }, }, { - name => "FSC poseidon chip", + name => "FSC Poseidon", driver => "fscpos", i2c_addrs => [0x73], i2c_detect => sub { fscpos_detect @_ }, }, { - name => "FSC Scylla chip", + name => "FSC Scylla", driver => "fscscy", i2c_addrs => [0x73], i2c_detect => sub { fscscy_detect @_ }, }, + { + name => "FSC Hermes", + driver => "to-be-written", + i2c_addrs => [0x73], + i2c_detect => sub { fscher_detect @_ }, + }, { name => "Philips Semiconductors PCF8591", driver => "pcf8591", @@ -3304,6 +3311,28 @@ sub fscscy_detect return (8); } +# $_[0]: A reference to the file descriptor to access this chip. +# We may assume an i2c_set_slave_addr was already done. +# $_[1]: Address +# Returns: undef if not detected, (8) if detected. +# Registers used: +# 0x00-0x02: Identification ('H','E','R') +sub fscher_detect +{ + my ($file,$addr) = @_; + # check the first 3 registers + if (i2c_smbus_read_byte_data($file,0x00) != 0x48) { + return; + } + if (i2c_smbus_read_byte_data($file,0x01) != 0x45) { + return; + } + if (i2c_smbus_read_byte_data($file,0x02) != 0x52) { + return; + } + return (8); +} + # $_[0]: Chip to detect (0 = PCF8591, 1 = PCF8574, 2 = PCF8574A). # $_[1]: A reference to the file descriptor to access this chip. # We may assume an i2c_set_slave_addr was already done.