mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-30 22:05:11 +00:00
Skip SMBus probing by default if a Super I/O was found. The user can
still ask for SMBus probing, but in general, if there's a Super I/O with enabled hardware monitoring features, there won't be an additional hardware monitoring chip on the SMBus. Might need to be refined as some vendors (Asus, Tyan) are known to actually do that. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5511 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -37,6 +37,7 @@ SVN-HEAD
|
||||
Add an option to skip ISA probes except IPMI
|
||||
Skip ISA detection by default if a Super I/O was found (#2322)
|
||||
Do not scan I2C adapters on multimedia cards by default
|
||||
Skip SMBus probing by default if a Super I/O was found (#2322)
|
||||
|
||||
3.0.3 (2008-09-28)
|
||||
libsensors: Avoid namespace pollution
|
||||
|
@@ -2779,8 +2779,8 @@ sub probe_free_i2c_address
|
||||
}
|
||||
|
||||
# $_[0]: The number of the adapter to check
|
||||
# Returns: 1 if the I2C adapter is on a PCI multimedia adapter, 0 otherwise
|
||||
sub is_multimedia_i2c_adapter
|
||||
# Returns: PCI class of the adapter if available, 0 if not
|
||||
sub get_i2c_adapter_class
|
||||
{
|
||||
my ($adapter_nr) = @_;
|
||||
my ($adapter, $subsystem, $class);
|
||||
@@ -2792,25 +2792,33 @@ sub is_multimedia_i2c_adapter
|
||||
$class = sysfs_device_attribute("$adapter/device", "class");
|
||||
return 0 unless defined $class;
|
||||
$class = oct($class) if $class =~ /^0/;
|
||||
return ($class & 0xff0000) == 0x040000;
|
||||
return $class >> 8;
|
||||
}
|
||||
|
||||
# $_[0]: The number of the adapter to scan
|
||||
sub scan_i2c_adapter
|
||||
{
|
||||
my ($adapter_nr) = @_;
|
||||
my ($funcs, $chip, $addr, $multimedia, $input, @not_to_scan);
|
||||
my ($adapter_nr, $smbus_default) = @_;
|
||||
my ($funcs, $chip, $addr, $class, $default, $input, @not_to_scan);
|
||||
|
||||
# Do not probe adapters on PCI multimedia cards by default
|
||||
$multimedia = is_multimedia_i2c_adapter($adapter_nr);
|
||||
$class = get_i2c_adapter_class($adapter_nr);
|
||||
if (($class & 0xff00) == 0x0400) {
|
||||
# Do not probe adapters on PCI multimedia cards by default
|
||||
$default = 0;
|
||||
} elsif ($class == 0x0c01 || $class == 0x0c05
|
||||
|| find_i2c_adapter_driver($i2c_adapters[$adapter_nr]->{name})) {
|
||||
$default = $smbus_default;
|
||||
} else {
|
||||
$default = 1;
|
||||
}
|
||||
|
||||
printf "Next adapter: $i2c_adapters[$adapter_nr]->{name} (i2c-$adapter_nr)\n".
|
||||
"Do you want to scan it? (\%s): ",
|
||||
$multimedia ? "yes/NO/selectively" : "YES/no/selectively";
|
||||
"Do you want to scan it? (\%s/selectively): ",
|
||||
$default ? "YES/no" : "yes/NO";
|
||||
|
||||
$input = <STDIN>;
|
||||
if ($input =~ /^\s*n/i
|
||||
|| ($multimedia && $input !~ /^\s*[ys]/i)) {
|
||||
|| (!$default && $input !~ /^\s*[ys]/i)) {
|
||||
print "\n";
|
||||
return;
|
||||
}
|
||||
@@ -5012,6 +5020,7 @@ sub main
|
||||
}
|
||||
print "\n";
|
||||
|
||||
$superio_features = 0;
|
||||
# Skip "random" I/O port probing on PPC
|
||||
if ($kernel_arch ne 'ppc'
|
||||
&& $kernel_arch ne 'ppc64') {
|
||||
@@ -5057,7 +5066,8 @@ sub main
|
||||
|
||||
for (my $dev_nr = 0; $dev_nr < @i2c_adapters; $dev_nr++) {
|
||||
next unless exists $i2c_adapters[$dev_nr];
|
||||
scan_i2c_adapter($dev_nr);
|
||||
scan_i2c_adapter($dev_nr,
|
||||
~$superio_features & (FEAT_IN | FEAT_FAN | FEAT_TEMP));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user