Changeset 5708

Show
Ignore:
Timestamp:
04/06/09 19:05:54 (4 years ago)
Author:
khali
Message:

Add National Semiconductor LM95241 detection.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r5684 r5708  
    88                  Use dmidecode to find IPMI interfaces if available 
    99                  Add Nuvoton W83795G/ADG detection 
     10                  Add National Semiconductor LM95241 detection 
    1011 
    11123.1.0 "Happy Birthday Lina" (2009-02-28) 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5684 r5708  
    912912                driver => "to-be-written", 
    913913                i2c_addrs => [0x2b, 0x19, 0x2a], 
    914                 i2c_detect => sub { lm95231_detect(@_); }, 
     914                i2c_detect => sub { lm95231_detect(@_, 0); }, 
     915        }, { 
     916                name => "National Semiconductor LM95241", 
     917                driver => "lm95241", 
     918                i2c_addrs => [0x2b, 0x19, 0x2a], 
     919                i2c_detect => sub { lm95231_detect(@_, 1); }, 
    915920        }, { 
    916921                name => "National Semiconductor LM63", 
     
    39083913} 
    39093914 
     3915# Chip to detect: 0 = LM95231, 1 = LM95241 
    39103916# Registers used: 
    3911 #   0x03: Configuration 
     3917#   0x02: Status (3 unused bits) 
     3918#   0x03: Configuration (3 unused bits) 
     3919#   0x06: Remote diode filter control (6 unused bits) 
     3920#   0x30: Remote diode model type select (6 unused bits) 
    39123921#   0xfe: Manufacturer ID 
    39133922#   0xff: Revision ID 
    39143923sub lm95231_detect 
    39153924{ 
    3916         my ($file, $addr) = @_; 
     3925        my ($file, $addr, $chip) = @_; 
    39173926        my $mid = i2c_smbus_read_byte_data($file, 0xfe); 
    39183927        my $cid = i2c_smbus_read_byte_data($file, 0xff); 
    3919         my $conf = i2c_smbus_read_byte_data($file, 0x03); 
    3920  
    3921         return if ($conf & 0x89) != 0; 
    3922         return if $mid != 0x01;         # National Semiconductor 
    3923         return if $cid != 0xa1;         # LM95231 
     3928 
     3929        return if $mid != 0x01;                         # National Semiconductor 
     3930        return if $chip == 0 && $cid != 0xa1;           # LM95231 
     3931        return if $chip == 1 && $cid != 0xa4;           # LM95231 
     3932 
     3933        return if i2c_smbus_read_byte_data($file, 0x02) & 0x70; 
     3934        return if i2c_smbus_read_byte_data($file, 0x03) & 0x89; 
     3935        return if i2c_smbus_read_byte_data($file, 0x06) & 0xfa; 
     3936        return if i2c_smbus_read_byte_data($file, 0x30) & 0xfa; 
    39243937 
    39253938        return 6;