Changeset 5684
- Timestamp:
- 03/13/09 09:41:19 (4 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
prog/detect/sensors-detect (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r5681 r5684 7 7 Differentiate between PC8374L and WPCD377I 8 8 Use dmidecode to find IPMI interfaces if available 9 Add Nuvoton W83795G/ADG detection 9 10 10 11 3.1.0 "Happy Birthday Lina" (2009-02-28) -
lm-sensors/trunk/prog/detect/sensors-detect
r5683 r5684 649 649 i2c_detect => sub { w83793_detect(@_); }, 650 650 }, { 651 name => "Nuvoton W83795G/ADG", 652 driver => "w83795", 653 i2c_addrs => [0x2c..0x2f], 654 i2c_detect => sub { w83795_detect(@_); }, 655 }, { 651 656 name => "Winbond W83627HF", 652 657 driver => "use-isa-instead", … … 4357 4362 push @res, (($reg & 0x70) >> 4) + 0x48 unless $reg & 0x80; 4358 4363 return @res; 4364 } 4365 4366 # Registers used: 4367 # 0xfc: Full I2C Address 4368 # 0x00: Vendor ID byte selection, and bank selection(Bank 0, 1, 2) 4369 # 0xfd: Vendor ID(Bank 0, 1, 2) 4370 # 0xfe: Device ID(Bank 0, 1, 2) 4371 sub w83795_detect 4372 { 4373 my ($bank, $reg); 4374 my ($file, $addr) = @_; 4375 4376 $bank = i2c_smbus_read_byte_data($file, 0x00); 4377 $reg = i2c_smbus_read_byte_data($file, 0xfd); 4378 4379 return unless (($bank & 0x80) == 0x00 and $reg == 0xa3) or 4380 (($bank & 0x80) == 0x80 and $reg == 0x5c); 4381 4382 $reg = i2c_smbus_read_byte_data($file, 0xfe); 4383 return if $reg != 0x79; 4384 4385 # If bank 0 is selected, we can do more checks 4386 return 6 unless ($bank & 0x07) == 0; 4387 $reg = i2c_smbus_read_byte_data($file, 0xfc) & 0x7f; 4388 return unless ($reg == $addr); 4389 4390 return 8; 4359 4391 } 4360 4392
