Changeset 5270

Show
Ignore:
Timestamp:
05/28/08 14:36:57 (5 years ago)
Author:
khali
Message:

Add Maxim MAX6654/MAX6690 detection.
Add National Semiconductor LM95231 detection.
Add Analog Devices ADT7481 detection.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r5266 r5270  
    77                  Improve MAX6657, MAX6658, MAX6659 detection 
    88                  Cache the byte data reads (#2326) 
     9                  Add Maxim MAX6654/MAX6690 support 
     10                  Add National Semiconductor LM95231 support 
     11                  Add Analog Devices ADT7481 support 
    912 
    10133.0.2 (2008-05-18) 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5269 r5270  
    10931093     }, 
    10941094     { 
     1095       name => "Maxim MAX6654/MAX6690", 
     1096       driver => "to-be-written", # probably lm90 
     1097       i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 
     1098       i2c_detect => sub { lm90_detect(4, @_); }, 
     1099     }, 
     1100     { 
    10951101       name => "Maxim MAX6657/MAX6658/MAX6659", 
    10961102       driver => "lm90", 
     
    11271133       i2c_addrs => [0x4c], 
    11281134       i2c_detect => sub { lm90_detect(9, @_); }, 
     1135     }, 
     1136     { 
     1137       name => "National Semiconductor LM95231", 
     1138       driver => "to-be-written", 
     1139       i2c_addrs => [0x2b, 0x19, 0x2a], 
     1140       i2c_detect => sub { lm95231_detect(@_); }, 
    11291141     }, 
    11301142     { 
     
    11711183       i2c_addrs => [0x4c..0x4d], 
    11721184       i2c_detect => sub { lm90_detect(5, @_); }, 
     1185     }, 
     1186     { 
     1187       name => "Analog Devices ADT7481", 
     1188       driver => "to-be-written", 
     1189       i2c_addrs => [0x4c, 0x4b], 
     1190       i2c_detect => sub { adt7481_detect(@_); }, 
    11731191     }, 
    11741192     { 
     
    39583976 
    39593977# $_[0]: Chip to detect 
    3960 #   (0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032, 
     3978#   (0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032, 4 = MAX6654/MAX6690, 
    39613979#    5 = ADT7461, 6 = MAX6648/MAX6692, 7 = MAX6680/MAX6681, 
    39623980#    8 = W83L771W/G, 9 = TI TMP401) 
     
    40054023    return 6 if ($cid & 0xf0) == 0x40; # ADM1032 
    40064024  } 
     4025  if ($chip == 4) { 
     4026    return if ($conf & 0x07) != 0; 
     4027    return if $rate > 0x07; 
     4028    return if $mid != 0x4d;     # Maxim 
     4029    return if $cid != 0x08;     # MAX6654/MAX6690 
     4030    return 8; 
     4031  } 
    40074032  if ($chip == 5) { 
    40084033    return if ($conf & 0x1b) != 0; 
     
    40724097 
    40734098  return 5; 
     4099} 
     4100 
     4101# $_[0]: A reference to the file descriptor to access this chip. 
     4102# $_[1]: Address 
     4103# Returns: undef if not detected, 6 if detected. 
     4104# Registers used: 
     4105#   0x03: Configuration 
     4106#   0xfe: Manufacturer ID 
     4107#   0xff: Revision ID 
     4108sub lm95231_detect 
     4109{ 
     4110  my ($file, $addr) = @_; 
     4111  my $mid = i2c_smbus_read_byte_data($file, 0xfe); 
     4112  my $cid = i2c_smbus_read_byte_data($file, 0xff); 
     4113  my $conf = i2c_smbus_read_byte_data($file, 0x03); 
     4114 
     4115  return if ($conf & 0x89) != 0; 
     4116  return if $mid != 0x01;     # National Semiconductor 
     4117  return if $cid != 0xa1;     # LM95231 
     4118 
     4119  return 6; 
     4120} 
     4121 
     4122# $_[0]: A reference to the file descriptor to access this chip. 
     4123# $_[1]: Address 
     4124# Returns: undef if not detected, 6 if detected. 
     4125# Registers used: 
     4126#   0x03: Configuration 1 
     4127#   0x24: Configuration 2 
     4128#   0x3d: Manufacturer ID 
     4129#   0x3e: Device ID 
     4130sub adt7481_detect 
     4131{ 
     4132  my ($file, $addr) = @_; 
     4133  my $mid = i2c_smbus_read_byte_data($file, 0x3d); 
     4134  my $cid = i2c_smbus_read_byte_data($file, 0x3e); 
     4135  my $conf1 = i2c_smbus_read_byte_data($file, 0x03); 
     4136  my $conf2 = i2c_smbus_read_byte_data($file, 0x24); 
     4137 
     4138  return if ($conf1 & 0x10) != 0; 
     4139  return if ($conf2 & 0x7f) != 0; 
     4140  return if $mid != 0x41;     # Analog Devices 
     4141  return if $cid != 0x81;     # ADT7481 
     4142 
     4143  return 6; 
    40744144} 
    40754145