Changeset 5984 for lm-sensors/trunk/prog

Show
Ignore:
Timestamp:
07/10/11 21:22:53 (11 months ago)
Author:
groeck
Message:

Add code to detect LM95245

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5983 r5984  
    10091009                i2c_detect => sub { lm95231_detect(@_, 1); }, 
    10101010        }, { 
     1011                name => "National Semiconductor LM95245", 
     1012                driver => "lm95245", 
     1013                i2c_addrs => [0x18, 0x19, 0x29, 0x4c, 0x4d], 
     1014                i2c_detect => sub { lm95231_detect(@_, 2); }, 
     1015        }, { 
    10111016                name => "National Semiconductor LM63", 
    10121017                driver => "lm63", 
     
    45414546} 
    45424547 
    4543 # Chip to detect: 0 = LM95231, 1 = LM95241 
     4548# Chip to detect: 0 = LM95231, 1 = LM95241, 2 = LM95245 
    45444549# Registers used: 
    45454550#   0x02: Status (3 unused bits) 
    45464551#   0x03: Configuration (3 unused bits) 
    4547 #   0x06: Remote diode filter control (6 unused bits) 
    4548 #   0x30: Remote diode model type select (6 unused bits) 
     4552#   0x06: Remote diode filter control (6 unused bits, LM95231 and LM95241) 
     4553#   0x30: Remote diode model type select (6 unused bits, LM95231 and LM95241) 
     4554#   0x30: Local Temperature LSB (5 unused bits, LM95245) 
     4555#   0x33: Status register 2 (6 unused bits, LM95245) 
    45494556#   0xfe: Manufacturer ID 
    45504557#   0xff: Revision ID 
     
    45564563 
    45574564        return if $mid != 0x01;                         # National Semiconductor 
    4558         return if $chip == 0 && $cid != 0xa1;           # LM95231 
    4559         return if $chip == 1 && $cid != 0xa4;           # LM95241 
    4560  
    4561         return if i2c_smbus_read_byte_data($file, 0x02) & 0x70; 
    4562         return if i2c_smbus_read_byte_data($file, 0x03) & 0x89; 
    4563         return if i2c_smbus_read_byte_data($file, 0x06) & 0xfa; 
    4564         return if i2c_smbus_read_byte_data($file, 0x30) & 0xfa; 
     4565 
     4566        if ($chip == 0 || $chip == 1) { 
     4567                return if $chip == 0 && $cid != 0xa1;   # LM95231 
     4568                return if $chip == 1 && $cid != 0xa4;   # LM95241 
     4569                return if i2c_smbus_read_byte_data($file, 0x02) & 0x70; 
     4570                return if i2c_smbus_read_byte_data($file, 0x03) & 0x89; 
     4571                return if i2c_smbus_read_byte_data($file, 0x06) & 0xfa; 
     4572                return if i2c_smbus_read_byte_data($file, 0x30) & 0xfa; 
     4573        } elsif ($chip == 2) { 
     4574                return if $cid != 0xb3;                 # LM95245 
     4575                return if i2c_smbus_read_byte_data($file, 0x02) & 0x68; 
     4576                return if i2c_smbus_read_byte_data($file, 0x03) & 0xa1; 
     4577                return if i2c_smbus_read_byte_data($file, 0x30) & 0x1f; 
     4578                return if i2c_smbus_read_byte_data($file, 0x33) & 0x3f; 
     4579        } 
    45654580 
    45664581        return 6;