Changeset 5425
- Timestamp:
- 11/24/08 18:10:31 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
r5424 r5425 816 816 driver => "gl518sm", 817 817 i2c_addrs => [0x2c, 0x2d], 818 i2c_detect => sub { gl518sm_detect(@_ ); },818 i2c_detect => sub { gl518sm_detect(@_, 0); }, 819 819 }, 820 820 { … … 822 822 driver => "gl520sm", 823 823 i2c_addrs => [0x2c, 0x2d], 824 i2c_detect => sub { gl5 20sm_detect(@_); },824 i2c_detect => sub { gl518sm_detect(@_, 1); }, 825 825 }, 826 826 { … … 4361 4361 } 4362 4362 4363 # Chip to detect: 0 = GL518SM, 1 = GL520SM 4363 4364 # Registers used: 4364 4365 # 0x00: Device ID 4365 4366 # 0x01: Revision ID 4366 4367 # 0x03: Configuration 4367 # Mediocre detection4368 4368 sub gl518sm_detect 4369 4369 { 4370 my ($file, $addr ) = @_;4370 my ($file, $addr, $chip) = @_; 4371 4371 my $reg; 4372 return unless i2c_smbus_read_byte_data($file, 0x00) == 0x80; 4373 return unless (i2c_smbus_read_byte_data($file, 0x03) & 0x80) == 0x00; 4374 $reg = i2c_smbus_read_byte_data($file, 0x01); 4375 return unless $reg == 0x00 or $reg == 0x80; 4376 return (6); 4377 } 4378 4379 # Registers used: 4380 # 0x00: Device ID 4381 # 0x01: Revision ID 4382 # 0x03: Configuration 4383 # Mediocre detection 4384 sub gl520sm_detect 4385 { 4386 my ($file, $addr) = @_; 4387 return unless i2c_smbus_read_byte_data($file, 0x00) == 0x20; 4372 4373 $reg = i2c_smbus_read_byte_data($file, 0x00); 4374 return if $chip == 0 && $reg != 0x80; 4375 return if $chip == 1 && $reg != 0x20; 4376 4388 4377 return unless (i2c_smbus_read_byte_data($file, 0x03) & 0x80) == 0x00; 4389 4378 $reg = i2c_smbus_read_byte_data($file, 0x01);
