mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-09-30 21:43:05 +07:00
sensors-detect: Fix parent class discovery when multiplexer is present
Take multiplexers into account when looking up the parent device of each I2C adapter. We don't bother with old kernels as they didn't have support for multiplexers anyway. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6085 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -12,6 +12,7 @@ SVN HEAD
|
||||
Add detection of NCT6779D and NCT6102D/NCT6106D
|
||||
Add detection of SMSC LPC47N217 and SIO10N268
|
||||
Do not scan I2C adapters on graphics cards by default
|
||||
Fix parent class discovery when multiplexer is present
|
||||
|
||||
3.3.2 (2012-03-14)
|
||||
libsensors: Added support for new sysfs attributes
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# sensors-detect - Detect hardware monitoring chips
|
||||
# Copyright (C) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>
|
||||
# Copyright (C) 2004 - 2011 Jean Delvare <khali@linux-fr.org>
|
||||
# Copyright (C) 2004 - 2012 Jean Delvare <khali@linux-fr.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -2696,14 +2696,15 @@ sub initialize_i2c_adapters_list
|
||||
} elsif ($link =~ m/^(.*)\/i2c-$nr$/) {
|
||||
$entry->{path} = "${base_dir}/i2c-$nr/device";
|
||||
$entry->{parent} = "${base_dir}/i2c-$nr/$1";
|
||||
} else {
|
||||
$entry->{path} = "${base_dir}/i2c-$nr";
|
||||
$entry->{parent} = "$entry->{path}/device";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
# This works for all recent kernels (with or without
|
||||
# CONFIG_I2C_COMPAT)
|
||||
if (!defined $entry->{path}) {
|
||||
my $link = readlink("${base_dir}/i2c-$nr");
|
||||
$link =~ s/\/i2c-$nr$//;
|
||||
$entry->{path} = "${base_dir}/i2c-$nr";
|
||||
$link =~ s/(\/i2c-[0-9]+)+$//; # Handle multiplexers too
|
||||
$entry->{parent} = "${base_dir}/$link";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user