Changeset 5423

Show
Ignore:
Timestamp:
11/24/08 17:59:25 (6 years ago)
Author:
khali
Message:

Merge both GL518 entries into one. We don't need separate entries as
both revisions are handled by the same driver anyway.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5422 r5423  
    813813     }, 
    814814     { 
    815        name => "Genesys Logic GL518SM Revision 0x00", 
     815       name => "Genesys Logic GL518SM", 
    816816       driver => "gl518sm", 
    817817       i2c_addrs => [0x2c, 0x2d], 
    818        i2c_detect => sub { gl518sm_detect(@_, 0); }, 
    819      }, 
    820      { 
    821        name => "Genesys Logic GL518SM Revision 0x80", 
    822        driver => "gl518sm", 
    823        i2c_addrs => [0x2c, 0x2d], 
    824        i2c_detect => sub { gl518sm_detect(@_, 1); }, 
     818       i2c_detect => sub { gl518sm_detect(@_); }, 
    825819     }, 
    826820     { 
     
    43674361} 
    43684362 
    4369 # Chip to detect: 0 = Revision 0x00, 1 = Revision 0x80 
    43704363# Registers used: 
    43714364#   0x00: Device ID 
     
    43754368sub gl518sm_detect 
    43764369{ 
    4377   my ($file, $addr, $chip) = @_; 
     4370  my ($file, $addr) = @_; 
    43784371  my $reg; 
    43794372  return unless i2c_smbus_read_byte_data($file, 0x00) == 0x80; 
    43804373  return unless (i2c_smbus_read_byte_data($file, 0x03) & 0x80) == 0x00; 
    43814374  $reg = i2c_smbus_read_byte_data($file, 0x01); 
    4382   return unless ($chip == 0 and $reg == 0x00) or 
    4383                 ($chip == 1 and $reg == 0x80); 
     4375  return unless $reg == 0x00 or $reg == 0x80; 
    43844376  return (6); 
    43854377}