Changeset 5779

Show
Ignore:
Timestamp:
10/03/09 12:38:14 (4 years ago)
Author:
khali
Message:

Add detection for National Semiconductor LM73.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r5773 r5779  
    1919                  Add detection for AMD Family 11h thermal sensors 
    2020                  Add detection for Intel Atom thermal sensors 
     21                  Add detection for National Semiconductor LM73 
    2122  sysconfig-lm_sensors-convert: Fix exit code 
    2223 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5774 r5779  
    949949                i2c_detect => sub { lm63_detect(@_, 2); }, 
    950950        }, { 
     951                name => "National Semiconductor LM73", 
     952                driver => "lm73", 
     953                i2c_addrs => [0x48..0x4a, 0x4c..0x4e], 
     954                i2c_detect => sub { lm73_detect(@_); }, 
     955        }, { 
    951956                name => "National Semiconductor LM92", 
    952957                driver => "lm92", 
     
    35833588        return 6 if $cur <= 100 and ($hyst >= 10 && $hyst <= 125) 
    35843589                and ($os >= 20 && $os <= 127) and $hyst < $os; 
     3590        return 3; 
     3591} 
     3592 
     3593# Registers used: 
     3594#   0x00: Temperature 
     3595#   0x01: Configuration 
     3596#   0x02: High Limit 
     3597#   0x03: Low Limit 
     3598#   0x04: Status 
     3599#   0x07: Manufacturer ID and Product ID 
     3600sub lm73_detect 
     3601{ 
     3602        my ($file, $addr) = @_; 
     3603 
     3604        my $conf = i2c_smbus_read_byte_data($file, 0x01); 
     3605        my $status = i2c_smbus_read_byte_data($file, 0x04); 
     3606 
     3607        # Bits that always return 0 
     3608        return if ($conf & 0x0c) or ($status & 0x10); 
     3609 
     3610        return if i2c_smbus_read_word_data($file, 0x07) != 0x9001; 
     3611 
     3612        # Make sure the chip supports SMBus read word transactions 
     3613        my $cur = i2c_smbus_read_word_data($file, 0x00); 
     3614        return if $cur < 0; 
     3615        my $high = i2c_smbus_read_word_data($file, 0x02); 
     3616        return if $high < 0; 
     3617        my $low = i2c_smbus_read_word_data($file, 0x03); 
     3618        return if $low < 0; 
     3619        return if ($cur & 0x0300) or (($high | $low) & 0x1f00); 
     3620 
    35853621        return 3; 
    35863622}