From f11a2a6d3a1e0d7f08ef4fa37488748ed1c7e6bb Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 5 Jul 2010 16:53:59 +0000 Subject: [PATCH] Let ISA-access and non-sensor devices take part in the confidence comparison process. Otherwise, we might miss misdetections. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5848 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/detect/sensors-detect | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 29255a90..5d2773a1 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ SVN HEAD Add support for Fintek F71889ED Add support for ITE IT8721F Fix Maxim MAX6690 support + Fix handling of duplicate detections 3.1.2 (2010-02-02) libsensors: Support upcoming sysfs path to i2c adapters diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 61b0061f..f2a69e1f 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -3003,6 +3003,15 @@ sub add_i2c_to_chips_detected push @{$chips_detected{$chipdriver}}, $datahash; } +# Fake i2c drivers such as "not-a-sensor" or "use-isa-instead" have to be +# inserted so that confidence comparison can be performed. But then we have +# to filter them out so that the user doesn't get confused. +sub filter_out_fake_i2c_drivers +{ + delete $chips_detected{"not-a-sensor"}; + delete $chips_detected{"use-isa-instead"}; +} + # This adds a detection to the above structure. # $_[0]: chip driver # $_[1]: reference to data hash @@ -3190,9 +3199,6 @@ sub probe_free_i2c_address } print ")\n"; - return if ($chip->{driver} eq "not-a-sensor" - || $chip->{driver} eq "use-isa-instead"); - $new_hash = { conf => $conf, i2c_addr => $addr, @@ -5986,6 +5992,7 @@ sub main next unless exists $i2c_adapters[$dev_nr]; scan_i2c_adapter($dev_nr, $by_default); } + filter_out_fake_i2c_drivers(); } if (!keys %chips_detected) {