Changeset 4314

Show
Ignore:
Timestamp:
02/04/07 19:23:12 (7 years ago)
Author:
ruik
Message:

Add detection of MAX1668, MAX1805, MAX1989 - original code by ticket#2125

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4313 r4314  
    77                          Add Maxim MAX6655/MAX6656 detection 
    88                           (Olexiy Avramchenko) 
     9                          Add Maxim MAX1668, MAX1805, MAX1989 detection 
    910                          Add VIA CX700 detection 
    1011                          Drop legacy W83627HF ISA detection 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r4313 r4314  
    11411141       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
    11421142       i2c_detect => sub { adm1021_detect(3, @_); }, 
     1143     }, 
     1144     { 
     1145       name => "Maxim MAX1668", 
     1146       driver => "max1668", 
     1147       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
     1148       i2c_detect => sub { max1668_detect(0, @_); }, 
     1149     }, 
     1150     { 
     1151       name => "Maxim MAX1805", 
     1152       driver => "max1668", 
     1153       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
     1154       i2c_detect => sub { max1668_detect(1, @_); }, 
     1155     }, 
     1156     { 
     1157       name => "Maxim MAX1989", 
     1158       driver => "max1668", 
     1159       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
     1160       i2c_detect => sub { max1668_detect(2, @_); }, 
    11431161     }, 
    11441162     { 
     
    44754493 
    44764494# $_[0]: Chip to detect 
     4495#   (0 = MAX1668, 1 = MAX1805, 2 = MAX1989) 
     4496# $_[1]: A reference to the file descriptor to access this chip. 
     4497#        We may assume an i2c_set_slave_addr was already done. 
     4498# $_[2]: Address 
     4499# Returns: undef if not detected, 7 if detected 
     4500# Registers used: 
     4501#   0xfe: Company ID 
     4502#   0xff: Device ID 
     4503sub max1668_detect 
     4504{ 
     4505  my ($chip, $file, $addr) = @_; 
     4506  my $man_id = i2c_smbus_read_byte_data($file, 0xfe); 
     4507  my $dev_id = i2c_smbus_read_byte_data($file, 0xff); 
     4508 
     4509  return if $man_id != 0x4d; 
     4510  return if $chip == 0 and $dev_id != 0x03; 
     4511  return if $chip == 1 and $dev_id != 0x05; 
     4512  return if $chip == 2 and $dev_id != 0x0b; 
     4513 
     4514  return 7; 
     4515} 
     4516 
     4517# $_[0]: Chip to detect 
    44774518#   (0 = MAX1619) 
    44784519# $_[1]: A reference to the file descriptor to access this chip.