2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-01 06:45:24 +00:00

Add Texas Instruments THMC51 detection.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5281 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-06-11 14:09:15 +00:00
parent d4358492e7
commit 04b9a162b9
2 changed files with 13 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ SVN-HEAD
Add Analog Devices ADT7481 support Add Analog Devices ADT7481 support
Refactor alias detection functions Refactor alias detection functions
Fix Andigilog aSC7621 support Fix Andigilog aSC7621 support
Add Texas Instruments THMC51 support
3.0.2 (2008-05-18) 3.0.2 (2008-05-18)
documentation: Delete the FAQ, now maintained on the wiki documentation: Delete the FAQ, now maintained on the wiki

View File

@@ -1237,6 +1237,12 @@ use vars qw(@pci_adapters_sis5595 @pci_adapters_sis645 @pci_adapters_sis96x);
i2c_addrs => [0x2e], i2c_addrs => [0x2e],
i2c_detect => sub { adm1022_detect(2, @_); }, i2c_detect => sub { adm1022_detect(2, @_); },
}, },
{
name => "Texas Instruments THMC51",
driver => "to-be-written", # thmc50
i2c_addrs => [0x2e], # At least (no datasheet)
i2c_detect => sub { adm1022_detect(3, @_); },
},
{ {
name => "VIA VT1211 (I2C)", name => "VIA VT1211 (I2C)",
driver => "use-isa-instead", driver => "use-isa-instead",
@@ -4773,7 +4779,8 @@ sub adm9240_detect
return (7); return (7);
} }
# $_[0]: Chip to detect (0 = ADM1022, 1 = THMC50, 2 = ADM1028) # $_[0]: Chip to detect (0 = ADM1022, 1 = THMC50, 2 = ADM1028,
# 3 = THMC51)
# $_[1]: A reference to the file descriptor to access this chip. # $_[1]: A reference to the file descriptor to access this chip.
# $_[2]: Address # $_[2]: Address
# Returns: undef if not detected, (8) if detected. # Returns: undef if not detected, (8) if detected.
@@ -4789,14 +4796,16 @@ sub adm1022_detect
$reg = i2c_smbus_read_byte_data($file, 0x3e); $reg = i2c_smbus_read_byte_data($file, 0x3e);
return unless ($chip == 0 and $reg == 0x41) or return unless ($chip == 0 and $reg == 0x41) or
($chip == 1 and $reg == 0x49) or ($chip == 1 and $reg == 0x49) or
($chip == 2 and $reg == 0x41); ($chip == 2 and $reg == 0x41) or
($chip == 3 and $reg == 0x49);
$reg = i2c_smbus_read_byte_data($file, 0x40); $reg = i2c_smbus_read_byte_data($file, 0x40);
return if ($reg & 0x10); # Soft Reset always reads 0 return if ($reg & 0x10); # Soft Reset always reads 0
return if ($chip != 0 and ($reg & 0x80)); # Reserved on THMC50 and ADM1028 return if ($chip != 0 and ($reg & 0x80)); # Reserved on THMC50 and ADM1028
$reg = i2c_smbus_read_byte_data($file, 0x3f) & 0xf0; $reg = i2c_smbus_read_byte_data($file, 0x3f) & 0xf0;
return unless ($chip == 0 and $reg == 0xc0) or return unless ($chip == 0 and $reg == 0xc0) or
($chip == 1 and $reg == 0xc0) or ($chip == 1 and $reg == 0xc0) or
($chip == 2 and $reg == 0xd0); ($chip == 2 and $reg == 0xd0) or
($chip == 3 and $reg == 0xd0);
return (8); return (8);
} }