diff options
author | groeck <groeck@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2015-03-03 16:48:20 +0000 |
---|---|---|
committer | groeck <groeck@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2015-03-03 16:48:20 +0000 |
commit | 9ad518071b615e8e2a4862542c55e5b9e96365c7 (patch) | |
tree | 6e4086e1f11aab2c6231b756fe55df093132499b | |
parent | a98e3c2aeb348da6cb6f90feebfb3636dde4f061 (diff) | |
download | lm-sensors-9ad518071b615e8e2a4862542c55e5b9e96365c7.tar.gz |
sensors-detect: Nuvoton chip updates
Document driver support for NCT7802Y.
Add detection of NCT7904D.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6277 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r-- | CHANGES | 2 | ||||
-rwxr-xr-x | prog/detect/sensors-detect | 33 |
2 files changed, 34 insertions, 1 deletions
@@ -33,6 +33,8 @@ SVN HEAD Add detection of Intel 5500/5520/X58 Loosen detection rules for TS3000/TSE2002 Add detection of TSE2004 and TS3001 + Document driver support for NCT7802Y + Add detection of NCT7904D 3.3.5 "Happy Birthday Beddy" (2014-01-22) libsensors: Improve documentation of two functions diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 8fb1ae3c..436cf956 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -734,10 +734,15 @@ use vars qw(@i2c_adapter_names); i2c_detect => sub { w83795_detect(@_); }, }, { name => "Nuvoton NCT7802Y", - driver => "to-be-written", + driver => "nct7802", i2c_addrs => [0x28..0x2f], i2c_detect => sub { nct7802_detect(@_); }, }, { + name => "Nuvoton NCT7904D", + driver => "nct7904", + i2c_addrs => [0x2d..0x2e], + i2c_detect => sub { nct7904_detect(@_); }, + }, { name => "Winbond W83627HF", driver => "use-isa-instead", i2c_addrs => [0x28..0x2f], @@ -5635,6 +5640,32 @@ sub nct7802_detect } # Registers used: +# 0x7a: Vendor ID +# 0x7b: Chip ID +# 0x7c: Device ID +# 0xff: Bank Select +# +sub nct7904_detect +{ + my ($reg); + my ($file, $addr) = @_; + + $reg = i2c_smbus_read_byte_data($file, 0x7a); + return unless $reg == 0x50; + + $reg = i2c_smbus_read_byte_data($file, 0x7b); + return unless $reg == 0xc5; + + $reg = i2c_smbus_read_byte_data($file, 0x7c); + return unless ($reg & 0xf0) == 0x50; + + $reg = i2c_smbus_read_byte_data($file, 0xff); + return unless ($reg & 0xf8) == 0x00; + + return 8; +} + +# Registers used: # 0x48: Full I2C Address # 0x4e: Vendor ID byte selection # 0x4f: Vendor ID |