Changeset 2787 for lm-sensors/trunk/prog/detect/sensors-detect
- Timestamp:
- 12/06/04 21:18:35 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/detect/sensors-detect (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/detect/sensors-detect
r2779 r2787 853 853 m5879_detect pca9540_detect smartbatt_mgr_detect 854 854 smartbatt_chgr_detect adt7467_detect lm92_detect max1619_detect 855 lm93_detect lm77_detect lm63_detect pca9556_detect); 855 lm93_detect lm77_detect lm63_detect pca9556_detect 856 w83791sd_detect); 856 857 857 858 # This is a list of all recognized chips. … … 859 860 # name: The full chip name 860 861 # driver: The driver name (without .o extension). Put in exactly 861 # "to-be-written" if it is not yet available. 862 # "to-be-written" if it is not yet available. Put in exactly 863 # "not-a-sensor" if it is not a hardware monitoring chip and 864 # there is no known driver for it. 862 865 # i2c_addrs (optional): For I2C chips, the range of valid I2C addresses to 863 866 # probe. Recommend avoiding 0x69 because of clock chips. … … 1001 1004 i2c_addrs => [0x2c..0x2f], 1002 1005 i2c_detect => sub { w83781d_detect 8, @_}, 1006 }, 1007 { 1008 name => "Winbond W83791SD", 1009 driver => "not-a-sensor", 1010 i2c_addrs => [0x2c..0x2f], 1011 i2c_detect => sub { w83791sd_detect @_ }, 1003 1012 }, 1004 1013 { … … 3397 3406 return if $chip == 6 and $reg1 != 0x31; 3398 3407 return if $chip == 7 and $reg1 != 0x71; 3399 return if $chip == 8 and $reg1 != 0x72;3408 return if $chip == 7 and $reg1 != 0x7a; 3400 3409 $reg1 = i2c_smbus_read_byte_data($file,0x4a); 3401 3410 @res = (8); … … 3405 3414 push @res, (($reg1 & 0x70) >> 4) + 0x48 unless ($reg1 & 0x80 or $chip == 2); 3406 3415 return @res; 3416 } 3417 3418 # $_[0]: A reference to the file descriptor to access this chip. 3419 # We assume an i2c_set_slave_addr was already done. 3420 # $_[1]: Address 3421 # Returns: undef if not detected, 3 if detected 3422 # Registers used: 3423 # 0x48: Full I2C Address 3424 # 0x4e: Vendor ID byte selection 3425 # 0x4f: Vendor ID 3426 # 0x58: Device ID 3427 # Note that the datasheet was useless and this detection routine 3428 # is based on dumps we received from users. Also, the W83781SD is *NOT* 3429 # a hardware monitoring chip as far as we know, but we still want to 3430 # detect it so that people won't keep reporting it as an unknown chip 3431 # we should investigate about. 3432 sub w83791sd_detect 3433 { 3434 my ($file, $addr) = @_; 3435 my ($reg1, $reg2); 3436 3437 return unless (i2c_smbus_read_byte_data($file, 0x48) == $addr); 3438 3439 $reg1 = i2c_smbus_read_byte_data($file, 0x4e); 3440 $reg2 = i2c_smbus_read_byte_data($file, 0x4f); 3441 return unless (!($reg1 & 0x80) && $reg2 == 0xa3) 3442 || (($reg1 & 0x80) && $reg2 == 0x5c); 3443 3444 $reg1 = i2c_smbus_read_byte_data($file, 0x58); 3445 return unless $reg1 == 0x72; 3446 3447 return 3; 3407 3448 } 3408 3449 … … 4620 4661 if ($chip->{driver} eq "to-be-written") { 4621 4662 $modprobes .= "# no driver for $chip->{detected}[0]{chipname} yet\n"; 4622 } els e{4663 } elsif ($chip->{driver} ne "not-a-sensor") { 4623 4664 $modprobes .= "modprobe $chip->{driver}\n"; 4624 4665 }
