From b2a1ac66226a0196348aeed3cdb0d6faf298ff0f Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Fri, 12 Nov 1999 03:13:22 +0000 Subject: [PATCH] (mds) Try again for as99127f detection. Remove verification of address register 0x48. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@625 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/w83781d.c | 14 +++++++++----- prog/detect/sensors-detect | 6 ++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/kernel/chips/w83781d.c b/kernel/chips/w83781d.c index 4c9bb8e7..20dacac8 100644 --- a/kernel/chips/w83781d.c +++ b/kernel/chips/w83781d.c @@ -714,15 +714,19 @@ int w83781d_detect(struct i2c_adapter *adapter, int address, if (kind < 0) { if (w83781d_read_value(new_client,W83781D_REG_CONFIG) & 0x80) goto ERROR1; - if (!is_isa && - (w83781d_read_value(new_client,W83781D_REG_I2C_ADDR) != address)) - goto ERROR1; val1 = w83781d_read_value(new_client,W83781D_REG_BANK); val2 = w83781d_read_value(new_client,W83781D_REG_CHIPMAN); + /* Check for Winbond or Asus ID if in bank 0 */ if (!(val1 & 0x07) && - ((!(val1 & 0x80) && (val2 != 0xa3)) || - ((val1 & 0x80) && (val2 != 0x5c)))) + ((!(val1 & 0x80) && (val2 != 0xa3) && (val2 != 0xc3)) || + ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) goto ERROR1; + /* If Winbond SMBus, check address at 0x48. Asus doesn't support */ + if ((!is_isa) && ((!(val1 & 0x80) && (val2 == 0xa3)) || + ((val1 & 0x80) && (val2 == 0x5c)))) { + if (w83781d_read_value(new_client,W83781D_REG_I2C_ADDR) != address) + goto ERROR1; + } } /* We have either had a force parameter, or we have already detected the diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 095c8599..24487c1e 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1286,14 +1286,16 @@ sub lm80_detect # 0x58: Device ID (only when in bank 0); ignore LSB. # Note: Fails if the W8378xD is not in bank 0! # Note: Detection overrules a previous LM78 detection +# Note: AS99127F address register 0x48 not supported? sub w83781d_detect { my ($reg1,$reg2,@res); my ($chip,$file,$addr) = @_; - return unless i2c_smbus_read_byte_data($file,0x48) == $addr; + return unless (i2c_smbus_read_byte_data($file,0x48) == $addr) + and ($chip < 4); $reg1 = i2c_smbus_read_byte_data($file,0x4e); $reg2 = i2c_smbus_read_byte_data($file,0x4f); - if ($chip < 3) { + if ($chip < 4) { return unless (($reg1 & 0x80) == 0x00 and $reg2 == 0xa3) or (($reg1 & 0x80) == 0x80 and $reg2 == 0x5c); }