mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-28 20:58:22 +00:00
add sysfs support to sensors-detect by using 'i2cdetect -l'
instead of 'cat /proc/bus/i2c' git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2101 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
82caa7986f
commit
e3a7d54722
2 files changed
+10
-3
No files matched your search
@@ -3719,7 +3719,8 @@ sub generate_modprobes
|
||||
$configfile .= "alias char-major-89 i2c-dev\n";
|
||||
|
||||
# Collect all loaded adapters
|
||||
open INPUTFILE,"/proc/bus/i2c" or die "Couldn't open /proc/bus/i2c?!?";
|
||||
# i2cdetect -l either cats /proc/bus/i2c or scans sysfs for the same information
|
||||
open INPUTFILE,"i2cdetect -l |" or die "Couldn't find i2cdetect program!!";
|
||||
while (<INPUTFILE>) {
|
||||
my ($dev_nr,$type,$adap,$algo) = /^i2c-(\S+)\s+(\S+)\s+(.*?)\s*\t\s*(.*?)\s+$/;
|
||||
next if ($type eq "dummy");
|
||||
@@ -4181,7 +4182,8 @@ sub main
|
||||
" includes address 0x69 (clock chip).\n";
|
||||
|
||||
my ($inp,@not_to_scan,$inp2);
|
||||
open INPUTFILE,"/proc/bus/i2c" or die "Couldn't open /proc/bus/i2c?!?";
|
||||
# i2cdetect -l either cats /proc/bus/i2c or scans sysfs for the same information
|
||||
open INPUTFILE,"i2cdetect -l |" or die "Couldn't find i2cdetect program!!";
|
||||
while (<INPUTFILE>) {
|
||||
my ($dev_nr,$type,$adap,$algo) = /^i2c-(\S+)\s+(\S+)\s+(.*?)\s*\t\s*(.*?)\s+$/;
|
||||
next if ($type eq "dummy");
|
||||
|
||||
Reference in new issue
Block a user