From fcb13c1e40a6f996175291773fe1f8713e1d1d7c Mon Sep 17 00:00:00 2001 From: Martin Knoblauch Date: Fri, 9 Nov 2001 13:35:56 +0000 Subject: [PATCH] (MKN) Add fscscy detection. Tested on D1230 based System. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1225 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index dd826ba1..38166351 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -470,7 +470,7 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect adm9240_detect adm1021_detect sis5595_isa_detect eeprom_detect via686a_isa_detect adm1022_detect ltc1710_detect gl525sm_detect lm87_detect ite_detect ite_isa_detect ite_alias_detect - ddcmonitor_detect ds1621_detect adm1024_detect fscpos_detect); + ddcmonitor_detect ds1621_detect adm1024_detect fscpos_detect fscscy_detect); # This is a list of all recognized chips. # Each entry must have the following fields: @@ -752,6 +752,12 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect i2c_addrs => [0x73], i2c_detect => sub { fscpos_detect @_ }, }, + { + name => "FSC Scylla chip", + driver => "fscscy", + i2c_addrs => [0x73], + i2c_detect => sub { fscscy_detect @_ }, + }, ); @@ -2235,7 +2241,7 @@ FAILURE: # $_[1]: Address # Returns: undef if not detected, (8) if detected. # Registers used: -# 0x00-0x02: Identification +# 0x00-0x02: Identification ('P','E','G' -> Pegasus ? :-) sub fscpos_detect { my ($file,$addr) = @_; @@ -2252,6 +2258,28 @@ sub fscpos_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 ('S','C','Y') +sub fscscy_detect +{ + my ($file,$addr) = @_; + # check the first 3 registers + if (i2c_smbus_read_byte_data($file,0x00) != 0x53) { + return; + } + if (i2c_smbus_read_byte_data($file,0x01) != 0x43) { + return; + } + if (i2c_smbus_read_byte_data($file,0x02) != 0x59) { + return; + } + return (8); +} + ################ # MAIN PROGRAM # ################