From d5e4af02452c775692aceba8a13ba37de1c799d6 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 5 Apr 2004 19:01:14 +0000 Subject: [PATCH] List a few non-sensors Super IO chips. Use a hash for modules list, for performance. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2414 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 49 ++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 6cedb0b8..93c52a75 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1306,6 +1306,9 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect # name: The full chip name # driver: The driver name (without .o extension). Put in # "to-be-written" if it is not yet available. +# Put in "not-a-sensor" if the chip doesn't have hardware monitoring +# capabilities (listing such chips here removes the need of manual +# lookup when people report them). # enter: The password sequence to write to the address register # devid: The device ID(s) we have to match (base device) # logdev: The logical device containing the sensors @@ -1386,6 +1389,12 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect devid => 0xf0, logdev => 0x09, }, + { + name => "Nat. Semi. PC8741x Super IO", + driver => "not-a-sensor", + enter => [], + devid => 0xee, + }, { name => "SMSC 47B27x Super IO Fan Sensors", driver => "smsc47m1", @@ -1434,6 +1443,13 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect logdev => 0x0a, exit => [0xaa], }, + { + name => "SMSC 47M172 Super IO", + driver => "not-a-sensor", + enter => [0x55], + devid => 0x14, + exit => [0xaa], + }, { name => "VT1211 Super IO Sensors", driver => "vt1211", @@ -1482,6 +1498,13 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect logdev => 0x0b, exit => [0xaa], }, + { + name => "Winbond W83L517D Super IO", + driver => "not-a-sensor", + enter => [0x87, 0x87], + devid => 0x61, + exit => [0xaa], + }, ); ####################### @@ -1677,14 +1700,14 @@ sub kernel_version_at_least # MODULES # ########### -use vars qw(@modules_list); +use vars qw(%modules_list); sub initialize_modules_list { open INPUTFILE, "/proc/modules" or die "Can't access /proc/modules!"; while () { tr/_/-/; - push @modules_list, /^(\S*)/ ; + $modules_list{$1} = 1 if m/^(\S*)/; } close INPUTFILE; } @@ -1735,15 +1758,9 @@ sub initialize_proc_pci sub all_available_adapters { my @res = (); - my ($module,$adapter); - MODULES: - foreach $module (@modules_list) { - foreach $adapter (@pci_adapters) { - if (exists $adapter->{driver} and $module eq $adapter->{driver}) { - push @res, $module; - next MODULES; - } - } + foreach my $adapter (@pci_adapters) { + push @res, $adapter->{driver} + if exists $modules_list{$adapter->{driver}}; } return @res; } @@ -2451,6 +2468,12 @@ sub scan_superio } if($val == $$chip{devid}) { print " Success..."; +# does it have hardware monitoring capabilities + if($$chip{driver} eq "not-a-sensor") { + print " (no hardware monitoring capabilities)\n"; + exit_superio($addrreg, $datareg, $chip, 1); + next; + } # switch to the sensor logical device outb($addrreg, $superio{logdevreg}); outb($datareg, $$chip{logdev}); @@ -4318,7 +4341,7 @@ sub main print "We will now try to load each adapter module in turn.\n"; foreach $adapter (@adapters) { next if $adapter eq "DISABLED"; - if (contains $adapter, @modules_list) { + if (exists($modules_list{$adapter})) { print "Module `$adapter' already loaded.\n"; } else { print "Load `$adapter' (say NO if built into your kernel)? (YES/no): "; @@ -4341,7 +4364,7 @@ sub main print " To continue, we need module `i2c-dev' to be loaded.\n"; print " If it is built-in into your kernel, you can safely skip this.\n"; - if (contains "i2c-dev", @modules_list) { + if (exists($modules_list{"i2c-dev"})) { print "i2c-dev is already loaded.\n"; } else { if ($> != 0) {