Show
Ignore:
Timestamp:
07/27/03 12:37:32 (11 years ago)
Author:
khali
Message:

Add Asus Mozart-2 detection using Alex van Kaam information.

Untested.

Files:
1 modified

Legend:

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

    r1905 r1911  
    772772            ipmi_smic_detect via8231_isa_detect lm85_detect smartbatt_detect 
    773773            adm1026_detect w83l785ts_detect lm83_detect lm90_detect 
    774             saa1064_detect w83l784r_detect); 
     774            saa1064_detect w83l784r_detect mozart_detect); 
    775775 
    776776# This is a list of all recognized chips.  
     
    923923       i2c_addrs => [0x28..0x2f], 
    924924       i2c_detect => sub { w83781d_detect 6, @_}, 
     925     } , 
     926     { 
     927       name => "Asus ASM58 Mozart-2", 
     928       driver => "to-be-written", 
     929       i2c_addrs => [0x77], 
     930       i2c_detect => sub { mozart_detect 0, @_}, 
     931     } , 
     932     { 
     933       name => "Asus AS2K129R Mozart-2", 
     934       driver => "to-be-written", 
     935       i2c_addrs => [0x77], 
     936       i2c_detect => sub { mozart_detect 1, @_}, 
     937     } , 
     938     { 
     939       name => "Asus Mozart-2", 
     940       driver => "to-be-written", 
     941       i2c_addrs => [0x77], 
     942       i2c_detect => sub { mozart_detect 2, @_}, 
    925943     } , 
    926944     { 
     
    25422560#   0x4e: Vendor ID byte selection, and bank selection 
    25432561#   0x4f: Vendor ID 
    2544 #   0x58: Device ID (only when in bank 0); ignore LSB. 
     2562#   0x58: Device ID (only when in bank 0) 
    25452563# Note: Fails if the W8378xD is not in bank 0! 
    25462564# Note: Detection overrules a previous LM78 detection 
     
    25852603  push @res, (($reg1 & 0x70) >> 4) + 0x48 unless ($reg1 & 0x80 or $chip == 2); 
    25862604  return @res; 
     2605} 
     2606 
     2607# $_[0]: Chip to detect (0 = ASM58, 1 = AS2K129R, 2 = ???) 
     2608# $_[1]: A reference to the file descriptor to access this chip 
     2609# $_[2]: Address (unused) 
     2610# Returns: undef if not detected, 5 if detected 
     2611# Registers used: 
     2612#   0x4e: Vendor ID high byte 
     2613#   0x4f: Vendor ID low byte 
     2614#   0x58: Device ID 
     2615# Note: The values were given by Alex van Kaam, we don't have datasheets 
     2616#       to confirm. 
     2617sub mozart_detect 
     2618{ 
     2619  my ($vid,$dev); 
     2620  my ($chip,$file,$addr) = @_; 
     2621 
     2622  $vid = (i2c_smbus_read_byte_data($file,0x4e) << 8) 
     2623       +  i2c_smbus_read_byte_data($file,0x4f); 
     2624  $dev = i2c_smbus_read_byte_data($file,0x58); 
     2625 
     2626  return if ($chip == 0) and ($dev != 0x56 || $vid != 0x9436); 
     2627  return if ($chip == 1) and ($dev != 0x56 || $vid != 0x9406); 
     2628  return if ($chip == 2) and ($dev != 0x10 || $vid != 0x5ca3); 
     2629 
     2630  return 5; 
    25872631} 
    25882632