From 21ccf118854f9f6fb042f18e01b71e32cc87f283 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Jul 2003 17:39:41 +0000 Subject: [PATCH] Add detection of Philips NE1619 (ADM1025 clone). git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1905 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 60aac6af..d3ecb195 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1001,6 +1001,12 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect i2c_addrs => [0x2c..0x2e], i2c_detect => sub { adm1025_detect 0, @_ } }, + { + name => "Philips NE1619", + driver => "adm1025", + i2c_addrs => [0x2c..0x2d], + i2c_detect => sub { adm1025_detect 1, @_ } + }, { name => "Analog Devices ADM1024", driver => "adm1024", @@ -2730,7 +2736,7 @@ sub adm1022_detect return (8); } -# $_[0]: Chip to detect (0 = ADM1025) +# $_[0]: Chip to detect (0 = ADM1025, 1 = NE1619) # $_[1]: A reference to the file descriptor to access this chip. # We may assume an i2c_set_slave_addr was already done. # $_[2]: Address @@ -2744,10 +2750,14 @@ sub adm1025_detect { my $reg; my ($chip, $file,$addr) = @_; + $reg = i2c_smbus_read_byte_data($file,0x3e); - return unless ($reg == 0x41); + return if ($chip == 0) and ($reg != 0x41); + return if ($chip == 1) and ($reg != 0xA1); + return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; return unless (i2c_smbus_read_byte_data($file,0x3f) & 0xf0) == 0x20; + return (8); }