Changeset 5460

Show
Ignore:
Timestamp:
11/30/08 10:09:04 (5 years ago)
Author:
khali
Message:

Move non-hwmon I2C device definitions to a separate array.

Files:
1 modified

Legend:

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

    r5459 r5460  
    4040 
    4141use constant NO_CACHE => 1; 
    42 use vars qw(@pci_adapters @chip_ids $i2c_addresses_to_scan @superio_ids 
    43             @cpu_ids $revision @i2c_byte_cache); 
     42use vars qw(@pci_adapters @chip_ids @non_hwmon_chip_ids $i2c_addresses_to_scan 
     43            @superio_ids @cpu_ids $revision @i2c_byte_cache); 
    4444 
    4545$revision = '$Revision$ ($Date$)'; 
     
    440440#  driver: The driver name. Put in exactly: 
    441441#      * "to-be-written" if it is not yet available 
    442 #      * "not-a-sensor" if it is not a hardware monitoring chip 
    443442#      * "use-isa-instead" if no i2c driver will be written 
    444443#  i2c_addrs (optional): For I2C chips, the list of I2C addresses to 
     
    640639                i2c_detect => sub { w83793_detect(@_); }, 
    641640        }, { 
    642                 name => "Winbond W83791SD", 
    643                 driver => "not-a-sensor", 
    644                 i2c_addrs => [0x2c..0x2f], 
    645                 i2c_detect => sub { w83791sd_detect(@_); }, 
    646         }, { 
    647641                name => "Winbond W83627HF", 
    648642                driver => "use-isa-instead", 
     
    1002996                i2c_detect => sub { it8712_i2c_detect(@_); }, 
    1003997        }, { 
    1004                 name => "ITE IT8201R/IT8203R/IT8206R/IT8266R", 
    1005                 driver => "not-a-sensor", 
    1006                 i2c_addrs => [0x4e], 
    1007                 i2c_detect => sub { ite_overclock_detect(@_); }, 
    1008         }, { 
    1009                 name => "SPD EEPROM", 
    1010                 driver => "not-a-sensor", 
    1011                 # Can also live at 0x54-0x57, but we don't care: we only check 
    1012                 # for SPD and EDID EEPROMs because some hardware monitoring 
    1013                 # chips can live at 0x50-0x53. 
    1014                 i2c_addrs => [0x50..0x53], 
    1015                 i2c_detect => sub { eeprom_detect(@_); }, 
    1016         }, { 
    1017                 name => "EDID EEPROM", 
    1018                 driver => "not-a-sensor", 
    1019                 i2c_addrs => [0x50..0x53], 
    1020                 i2c_detect => sub { ddcmonitor_detect(@_); }, 
    1021         }, { 
    1022998                name => "FSC Poseidon I", 
    1023999                driver => sub { kernel_version_at_least(2, 6, 24) ? "fschmd" : "fscpos" }, 
     
    10691045                i2c_addrs => [0x2c..0x2e], 
    10701046                i2c_detect => sub { dme1737_detect(@_, 2); }, 
    1071         }, { 
    1072                 name => "Fintek F75111R/RG/N (GPIO)", 
    1073                 driver => "not-a-sensor", 
    1074                 i2c_addrs => [0x4e], # 0x37 not probed 
    1075                 i2c_detect => sub { fintek_detect(@_, 1); }, 
    10761047        }, { 
    10771048                name => "Fintek F75121R/F75122R/RG (VID+GPIO)", 
     
    11271098); 
    11281099 
     1100# Here is a similar list, but for devices which are not hardware monitoring 
     1101# chips. We only list popular devices which happen to live at the same I2C 
     1102# address as recognized hardware monitoring chips. The idea is to make it 
     1103# clear that the chip in question is of no interest for lm-sensors. 
     1104@non_hwmon_chip_ids = ( 
     1105        { 
     1106                name => "Winbond W83791SD", 
     1107                driver => "not-a-sensor", 
     1108                i2c_addrs => [0x2c..0x2f], 
     1109                i2c_detect => sub { w83791sd_detect(@_); }, 
     1110        }, { 
     1111                name => "Fintek F75111R/RG/N (GPIO)", 
     1112                driver => "not-a-sensor", 
     1113                i2c_addrs => [0x37, 0x4e], 
     1114                i2c_detect => sub { fintek_detect(@_, 1); }, 
     1115        }, { 
     1116                name => "ITE IT8201R/IT8203R/IT8206R/IT8266R", 
     1117                driver => "not-a-sensor", 
     1118                i2c_addrs => [0x4e], 
     1119                i2c_detect => sub { ite_overclock_detect(@_); }, 
     1120        }, { 
     1121                name => "SPD EEPROM", 
     1122                driver => "not-a-sensor", 
     1123                i2c_addrs => [0x50..0x57], 
     1124                i2c_detect => sub { eeprom_detect(@_); }, 
     1125        }, { 
     1126                name => "EDID EEPROM", 
     1127                driver => "not-a-sensor", 
     1128                i2c_addrs => [0x50], 
     1129                i2c_detect => sub { ddcmonitor_detect(@_); }, 
     1130        } 
     1131); 
    11291132 
    11301133# This is a list of all recognized superio chips. 
     
    21392142        foreach my $chip (@chip_ids) { 
    21402143                next if $chip->{driver} eq "to-be-written"; 
    2141                 next if $chip->{driver} eq "not-a-sensor"; 
    21422144                next if $chip->{driver} eq "use-isa-instead"; 
    21432145 
     
    27342736  foreach my $chip (@chip_ids) { 
    27352737    next unless defined $chip->{i2c_addrs}; 
    2736     next if $chip->{driver} eq 'not-a-sensor'; 
    27372738    foreach $addr (@{$chip->{i2c_addrs}}) { 
    27382739      $used[$addr]++; 
     
    28342835 
    28352836    $| = 1; 
    2836     foreach $chip (@chip_ids) { 
     2837    foreach $chip (@chip_ids, @non_hwmon_chip_ids) { 
    28372838      if (exists $chip->{i2c_addrs} and contains($addr, @{$chip->{i2c_addrs}})) { 
    28382839        printf("\%-60s", sprintf("Probing for `\%s'... ", $chip->{name}));