diff --git a/CHANGES b/CHANGES index cb54bf99..3670537d 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ SVN-HEAD Display Super-I/O address even if LD is disabled Differentiate between PC8374L and WPCD377I Use dmidecode to find IPMI interfaces if available + Add Nuvoton W83795G/ADG detection 3.1.0 "Happy Birthday Lina" (2009-02-28) libsensors: Add support for instantaneous power sensors diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index cacff693..c2b6e95f 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -647,6 +647,11 @@ use vars qw(@i2c_adapter_names); driver => "w83793", i2c_addrs => [0x2c..0x2f], i2c_detect => sub { w83793_detect(@_); }, + }, { + name => "Nuvoton W83795G/ADG", + driver => "w83795", + i2c_addrs => [0x2c..0x2f], + i2c_detect => sub { w83795_detect(@_); }, }, { name => "Winbond W83627HF", driver => "use-isa-instead", @@ -4358,6 +4363,33 @@ sub w83793_detect return @res; } +# Registers used: +# 0xfc: Full I2C Address +# 0x00: Vendor ID byte selection, and bank selection(Bank 0, 1, 2) +# 0xfd: Vendor ID(Bank 0, 1, 2) +# 0xfe: Device ID(Bank 0, 1, 2) +sub w83795_detect +{ + my ($bank, $reg); + my ($file, $addr) = @_; + + $bank = i2c_smbus_read_byte_data($file, 0x00); + $reg = i2c_smbus_read_byte_data($file, 0xfd); + + return unless (($bank & 0x80) == 0x00 and $reg == 0xa3) or + (($bank & 0x80) == 0x80 and $reg == 0x5c); + + $reg = i2c_smbus_read_byte_data($file, 0xfe); + return if $reg != 0x79; + + # If bank 0 is selected, we can do more checks + return 6 unless ($bank & 0x07) == 0; + $reg = i2c_smbus_read_byte_data($file, 0xfc) & 0x7f; + return unless ($reg == $addr); + + return 8; +} + # Registers used: # 0x48: Full I2C Address # 0x4e: Vendor ID byte selection