2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 06:15:15 +00:00

Get I2C adapter driver names from sysfs. The old method (matching against

regexp for known I2C adapters) is still used as a fallback, as early 2.6
kernels don't support the new method, and some drivers (i2c-viapro for
example) do not bind to their device so the new method doesn't work for
them.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5407 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-11-24 12:42:00 +00:00
parent a1db385f3c
commit 0b86f4e187
2 changed files with 6 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ SVN-HEAD
Drop support for Linux 2.4 (#2325)
Handle special case chips more efficiently
Fix SMBus detection of W83627EHF and W83627DHG
Get I2C adapter driver names from sysfs (#2328)
3.0.3 (2008-09-28)
libsensors: Avoid namespace pollution

View File

@@ -2366,7 +2366,11 @@ sub initialize_i2c_adapters_list
$entry->{'name'} = sysfs_device_attribute("${class_dir}/i2c-$1", "name")
|| sysfs_device_attribute("${class_dir}/i2c-$1/device", "name");
next if $entry->{'name'} eq "ISA main adapter";
$entry->{'driver'} = find_adapter_driver($entry->{'name'});
# First try to get the I2C adapter driver name from sysfs, and if it
# fails, fall back to searching our list of known I2C adapters.
$entry->{'driver'} = sysfs_device_driver("${class_dir}/i2c-$1/device")
|| find_adapter_driver($entry->{'name'});
$i2c_adapters[$1] = $entry;
}
closedir(ADAPTERS);