From 09d444883dd4204e2aff27e04dabd45b87efdc43 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 24 Nov 2008 17:24:32 +0000 Subject: [PATCH] Merge the W83L785TS detection into w83l784r_detect. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5427 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index f6d1367b..11fd33a5 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -809,7 +809,7 @@ use vars qw(@i2c_adapter_names); name => "Winbond W83L785TS-S", driver => "w83l785ts", i2c_addrs => [0x2e], - i2c_detect => sub { w83l785ts_detect(@_); }, + i2c_detect => sub { w83l784r_detect(@_, 3); }, }, { name => "Genesys Logic GL518SM", @@ -4826,7 +4826,8 @@ sub smartbatt_detect return (5); } -# Chip to detect: 0 = W83L784R/AR/G, 1 = W83L785R/G, 2 = W83L786NR/NG/R/G +# Chip to detect: 0 = W83L784R/AR/G, 1 = W83L785R/G, 2 = W83L786NR/NG/R/G, +# 3 = W83L785TS-S # Registers used: # 0x40: Configuration # 0x4a: Full I2C Address (W83L784R only) @@ -4849,8 +4850,9 @@ sub w83l784r_detect return if $chip == 0 and $reg != 0x50; return if $chip == 1 and $reg != 0x60; return if $chip == 2 and $reg != 0x80; + return if $chip == 3 and $reg != 0x70; - return 6 if $chip != 0; # No subclients + return 8 if $chip != 0; # No subclients @res = (8); $reg = i2c_smbus_read_byte_data($file, 0x4b); @@ -4859,17 +4861,6 @@ sub w83l784r_detect return @res; } -# Registers used: -# 0x4C-4E: Mfr and Chip ID -sub w83l785ts_detect -{ - my ($file, $addr) = @_; - return unless i2c_smbus_read_byte_data($file, 0x4c) == 0xa3; - return unless i2c_smbus_read_byte_data($file, 0x4d) == 0x5c; - return unless i2c_smbus_read_byte_data($file, 0x4e) == 0x70; - return (8); -} - # The max6650 has no device ID register. However, a few registers have # spare bits, which are documented as being always zero on read. We read # all of these registers check the spare bits. Any non-zero means this