2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-03 15:55:15 +00:00

(mds) Added adm1022/thmc50 detection. Confidence 8. No driver though.

Changed adm9240 confidence from 8 to 7 to let adm1022 win,
      not sure about register 0x3F in adm1022.
      Removed 0x69 from i2c range on all drivers, that address
      looks entrenched for clock chips.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@540 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker
1999-08-28 19:10:27 +00:00
parent 84622329a3
commit b44bd6f578

View File

@@ -123,7 +123,8 @@ use vars qw(@pci_adapters @chip_ids @undetectable_adapters);
use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
lm80_detect w83781d_detect w83781d_alias_detect lm80_detect w83781d_detect w83781d_alias_detect
w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect
adm1021_detect sis5595_isa_detect eeprom_detect ltc1710_detect); adm1021_detect sis5595_isa_detect eeprom_detect
adm1022_detect ltc1710_detect);
# This is a list of all recognized chips. # This is a list of all recognized chips.
# Each entry must have the following fields: # Each entry must have the following fields:
@@ -131,7 +132,7 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
# driver (optional): The driver name (without .o extension). Omit if none is # driver (optional): The driver name (without .o extension). Omit if none is
# written yet. # written yet.
# i2c_addrs (optional): For I2C chips, the range of valid I2C addresses to # i2c_addrs (optional): For I2C chips, the range of valid I2C addresses to
# probe. # probe. Recommend avoiding 0x69 because of clock chips.
# i2c_driver_addrs (optional): For I2C chips, the range of valid I2C # i2c_driver_addrs (optional): For I2C chips, the range of valid I2C
# addresses probed by the kernel driver. Strictly optional. # addresses probed by the kernel driver. Strictly optional.
# i2c_detect (optional): For I2C chips, the function to call to detect # i2c_detect (optional): For I2C chips, the function to call to detect
@@ -152,7 +153,7 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
{ {
name => "National Semiconductor LM78", name => "National Semiconductor LM78",
driver => "lm78", driver => "lm78",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
i2c_detect => sub { lm78_detect 0, @_}, i2c_detect => sub { lm78_detect 0, @_},
isa_addrs => [0x290], isa_addrs => [0x290],
@@ -162,7 +163,7 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
{ {
name => "National Semiconductor LM78-J", name => "National Semiconductor LM78-J",
driver => "lm78", driver => "lm78",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
i2c_detect => sub { lm78_detect 1, @_ }, i2c_detect => sub { lm78_detect 1, @_ },
isa_addrs => [0x290], isa_addrs => [0x290],
@@ -172,7 +173,7 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
{ {
name => "National Semiconductor LM79", name => "National Semiconductor LM79",
driver => "lm78", driver => "lm78",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
i2c_detect => sub { lm78_detect 2, @_ }, i2c_detect => sub { lm78_detect 2, @_ },
isa_addrs => [0x290], isa_addrs => [0x290],
@@ -194,7 +195,7 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
{ {
name => "Winbond W83781D", name => "Winbond W83781D",
driver => "w83781d", driver => "w83781d",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_detect => sub { w83781d_detect 0, @_}, i2c_detect => sub { w83781d_detect 0, @_},
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
isa_addrs => [0x290], isa_addrs => [0x290],
@@ -204,7 +205,7 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
{ {
name => "Winbond W83782D", name => "Winbond W83782D",
driver => "w83781d", driver => "w83781d",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
i2c_detect => sub { w83781d_detect 1, @_}, i2c_detect => sub { w83781d_detect 1, @_},
isa_addrs => [0x290], isa_addrs => [0x290],
@@ -214,14 +215,14 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
{ {
name => "Winbond W83783S", name => "Winbond W83783S",
driver => "w83781d", driver => "w83781d",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
i2c_detect => sub { w83781d_detect 2, @_}, i2c_detect => sub { w83781d_detect 2, @_},
} , } ,
{ {
name => "Winbond W83627HF", name => "Winbond W83627HF",
driver => "w83781d", driver => "w83781d",
i2c_addrs => [0x00..0x7f], i2c_addrs => [0x00..0x68,0x6a..0x7f],
i2c_driver_addrs => [0x20..0x2f], i2c_driver_addrs => [0x20..0x2f],
i2c_detect => sub { w83781d_detect 3, @_}, i2c_detect => sub { w83781d_detect 3, @_},
isa_addrs => [0x290], isa_addrs => [0x290],
@@ -288,6 +289,18 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
i2c_detect => sub { adm1021_detect 3, @_ }, i2c_detect => sub { adm1021_detect 3, @_ },
}, },
{
name => "Analog Devices ADM1022",
# driver to be written
i2c_addrs => [0x2c..0x2f],
i2c_detect => sub { adm1022_detect 0, @_ },
},
{
name => "Texas Instruments THMC50",
# driver to be written
i2c_addrs => [0x2c..0x2f],
i2c_detect => sub { adm1022_detect 1, @_ },
},
{ {
name => "Silicon Integrated Systems SIS5595", name => "Silicon Integrated Systems SIS5595",
driver => "sis5595", driver => "sis5595",
@@ -1187,7 +1200,7 @@ sub lm78_alias_detect
# Returns: undef if not detected, (3) if detected. # Returns: undef if not detected, (3) if detected.
# Registers used: # Registers used:
# 0x01: Configuration # 0x01: Configuration
# 0x02: Hysteris # 0x02: Hysteresis
# 0x03: Overtemperature Shutdown # 0x03: Overtemperature Shutdown
# Detection really sucks! It is only based on the fact that the LM75 has only # Detection really sucks! It is only based on the fact that the LM75 has only
# four registers. Any other chip in the valid address range with only four # four registers. Any other chip in the valid address range with only four
@@ -1362,7 +1375,7 @@ sub gl520sm_detect
# $_[1]: A reference to the file descriptor to access this chip. # $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done. # We may assume an i2c_set_slave_addr was already done.
# $_[2]: Address # $_[2]: Address
# Returns: undef if not detected, (8) if detected. # Returns: undef if not detected, (7) if detected.
# Registers used: # Registers used:
# 0x3e: Company ID # 0x3e: Company ID
# 0x40: Configuration # 0x40: Configuration
@@ -1379,6 +1392,29 @@ sub adm9240_detect
return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00;
return unless i2c_smbus_read_byte_data($file,0x48) == $addr; return unless i2c_smbus_read_byte_data($file,0x48) == $addr;
return (7);
}
# $_[0]: Chip to detect (0 = ADM1022, 1 = THMC50)
# $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.
# $_[2]: Address
# Returns: undef if not detected, (8) if detected.
# Registers used:
# 0x3e: Company ID
# 0x3f: Revision
# 0x40: Configuration
# Note: Detection overrules a previous LM78 or ADM9240 detection
sub adm1022_detect
{
my $reg;
my ($chip, $file,$addr) = @_;
$reg = i2c_smbus_read_byte_data($file,0x3e);
return unless ($chip == 0 and $reg == 0x41) or
($chip == 1 and $reg == 0x49);
return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00;
return unless (i2c_smbus_read_byte_data($file,0x3f) & 0xc0) == 0xc0;
return (8); return (8);
} }